/* ============================================
   PRODUCTS LIST - FILTROS E LISTAGEM
   ============================================ */

.products-page {
    padding: 40px 0;
    background: #f9fafb;
    min-height: 100vh;
}

.products-page .container {
    max-width: 1240px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
}

.page-title {
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    font-size: 2.5rem;
    color: #1a1a1a;
    margin-bottom: 10px;
    text-align: center;
}

.page-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
}

.products-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

/* ===== SIDEBAR DE FILTROS ===== */
.filters-sidebar {
    background: white;
    border-radius: 12px;
    padding: 25px;
    height: fit-content;
    position: sticky;
    top: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.filters-header h3 {
    font-size: 1.3rem;
    color: #1a1a1a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-clear-filters {
    display: none;
    align-items: center;
    gap: 6px;
    background: #dc2626;
    color: white;
    border: none;
    padding: 7px 13px;
    border-radius: 6px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-clear-filters:hover {
    background: #b91c1c;
}

/* ===== ACTIVE FILTER TAGS ===== */
.active-filters-tags {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 20px;
    padding: 4px 10px 4px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    animation: fadeInDown 0.2s ease;
}

.filter-tag button {
    background: none;
    border: none;
    cursor: pointer;
    color: #dc2626;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.filter-tag button:hover {
    opacity: 1;
}

/* ===== FILTER GROUP ===== */
.filter-group {
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e5e7eb;
}

.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-group-title {
    font-size: 1rem;
    color: #374151;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.filter-group-title span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-icon {
    font-size: 0.8rem;
    color: #9ca3af;
    transition: transform 0.2s;
}

.filter-group h4 {
    font-size: 1rem;
    color: #374151;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group-body {
    display: block;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    padding: 7px 6px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}

.filter-checkbox:hover {
    background: #f3f4f6;
}

.filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #dc2626;
    flex-shrink: 0;
}

.filter-label {
    flex: 1;
    margin-left: 9px;
    font-size: 0.93rem;
    color: #374151;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-count {
    color: #9ca3af;
    font-size: 0.82rem;
    margin-left: 4px;
}

/* ===== DYNAMIC DIMENSIONS (dropdowns abaixo da toolbar) ===== */
.dim-filter-bar {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 22px;
    animation: fadeInDown 0.25s ease;
}

.dim-filter-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}

/* Cada grupo é um dropdown independente */
.dim-filter-group {
    position: relative;
    flex: 0 0 auto;
}

/* Botão do dropdown */
.dim-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    white-space: nowrap;
    user-select: none;
}

.dim-dropdown-toggle:hover {
    border-color: #dc2626;
    color: #dc2626;
}

.dim-dropdown-toggle.has-selection {
    border-color: #dc2626;
    background: #fff5f5;
    color: #dc2626;
}

.dim-chevron {
    font-size: 0.72rem;
    color: #9ca3af;
    transition: transform 0.2s;
    margin-left: 2px;
}

.dim-dropdown-toggle.has-selection .dim-chevron {
    color: #dc2626;
}

/* Badge de quantidade selecionada */
.dim-selected-badge {
    display: none;
    align-items: center;
    justify-content: center;
    background: #dc2626;
    color: white;
    border-radius: 12px;
    min-width: 18px;
    height: 18px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0 5px;
    line-height: 1;
}

/* Painel do dropdown (lista de checkboxes) */
.dim-dropdown-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 200;
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    min-width: 180px;
    max-width: 240px;
    padding: 6px 0;
    animation: fadeInDown 0.18s ease;
}

.dim-dropdown-panel.open {
    display: block;
}

.dim-filter-items {
    display: flex;
    flex-direction: column;
    gap: 1px;
    max-height: 220px;
    overflow-y: auto;
    padding: 2px 6px;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
}

.dim-filter-items::-webkit-scrollbar {
    width: 4px;
}
.dim-filter-items::-webkit-scrollbar-track { background: transparent; }
.dim-filter-items::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.dim-filter-checkbox {
    display: flex;
    align-items: center;
    padding: 7px 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.12s;
    gap: 8px;
    white-space: nowrap;
}

.dim-filter-checkbox:hover  { background: #f3f4f6; }
.dim-filter-checkbox.checked { background: #fff5f5; }

.dim-filter-checkbox input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #dc2626;
    flex-shrink: 0;
    cursor: pointer;
}

.dim-filter-text {
    flex: 1;
    font-size: 0.9rem;
    color: #374151;
    font-weight: 500;
}

.dim-filter-checkbox.checked .dim-filter-text {
    color: #dc2626;
    font-weight: 600;
}

.dim-filter-count {
    font-size: 0.78rem;
    color: #9ca3af;
}

/* Skeleton loading */
.dim-loading {
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
}

.skeleton-line {
    height: 28px;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    border-radius: 6px;
    animation: shimmer 1.2s infinite;
}

.skeleton-line.short {
    width: 60%;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Dimension groups */
.dim-group {
    margin-bottom: 12px;
}

.dim-group:last-child {
    margin-bottom: 0;
}

.dim-group-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 7px;
}

.dim-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dim-chip {
    padding: 5px 11px;
    border: 1.5px solid #e5e7eb;
    border-radius: 20px;
    background: white;
    font-size: 0.83rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.dim-chip:hover {
    border-color: #dc2626;
    color: #dc2626;
    background: #fff5f5;
}

.dim-chip.selected {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

.dim-chip.selected .dim-cnt {
    color: rgba(255,255,255,0.75);
}

.dim-cnt {
    font-size: 0.72rem;
    color: #9ca3af;
}

/* ===== PRODUTOS MAIN ===== */
.products-main {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.products-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.products-count {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
}

.products-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.products-sort label {
    font-size: 0.95rem;
    color: #666;
}

.products-sort select {
    padding: 8px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.95rem;
}

/* ===== GRID DE PRODUTOS ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

/* ===== PAGINAÇÃO ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination-btn,
.pagination-number {
    padding: 10px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #374151;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.pagination-btn:hover,
.pagination-number:hover {
    border-color: #dc2626;
    color: #dc2626;
}

.pagination-number.active {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

.pagination-ellipsis {
    padding: 10px 6px;
    color: #6b7280;
    font-weight: 600;
    user-select: none;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #9ca3af;
}

.empty-state i {
    font-size: 5rem;
    margin-bottom: 20px;
    color: #d1d5db;
}

.empty-state h3 {
    font-size: 1.8rem;
    color: #374151;
    margin-bottom: 10px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== MARCAS EM DESTAQUE ===== */
.brands-subsection-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9ca3af;
    margin: 0 0 6px 0;
}

.brands-featured-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 4px;
}

.brand-logo-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 6px 6px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 60px;
}

.brand-logo-card:hover {
    border-color: var(--vermelho-diniz, #e30613);
    box-shadow: 0 2px 8px rgba(227, 6, 19, 0.12);
}

.brand-logo-card.active {
    border-color: var(--vermelho-diniz, #e30613);
    background: #fff5f5;
    box-shadow: 0 2px 8px rgba(227, 6, 19, 0.15);
}

.brand-logo-card img {
    max-width: 100%;
    max-height: 36px;
    object-fit: contain;
}

.brand-logo-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: #374151;
    text-align: center;
    line-height: 1.2;
}

.brand-logo-count {
    font-size: 0.7rem;
    color: #9ca3af;
}

.brands-divider {
    border: none;
    border-top: 1px dashed #e5e7eb;
    margin: 10px 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .products-layout {
        grid-template-columns: 1fr;
    }

    .filters-sidebar {
        position: static;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .products-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .pagination {
        gap: 6px;
        flex-wrap: nowrap;
    }

    .pagination-btn,
    .pagination-number {
        padding: 8px 10px;
        font-size: 0.82rem;
        min-width: 36px;
        text-align: center;
    }

    .pagination-btn-text {
        display: none;
    }

    .pagination-ellipsis {
        padding: 8px 2px;
    }

    .filter-group-body {
        display: none;
    }

    .filter-group-title .toggle-icon {
        transform: rotate(-90deg);
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

.subtitle-filters-direction-mobile {
    display: none;
}

@media (max-width: 768px) {
    .subtitle-filters-direction {
        display: none;
    }
    .subtitle-filters-direction-mobile {
        display: inline;
    }
}

.btn-secondary-sm {
    display: inline-block;
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    padding: 4px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    transition: all 0.3s;
    vertical-align: middle;
    margin-left: 6px;
}

.btn-secondary-sm:hover {
    background: var(--primary);
    color: #fff;
}
