/* ========================================
   INKUPANDA - Catalogue Page V3
   Compact sidebar with accordion
   ======================================== */

/* Catalogue Section */
.catalogue-section {
    min-height: 100vh;
    padding: 120px 0 60px;
    background: var(--light-gray);
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1.1rem;
    color: var(--medium-gray);
}

/* ========================================
   Group Tabs with Dropdown
   ======================================== */
.group-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.group-tab-wrapper {
    position: relative;
}

.group-tab {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border: 2px solid var(--light-gray);
    border-radius: 30px;
    background: var(--white);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-black);
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.group-tab:hover {
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.group-tab.active {
    background: var(--primary-red);
    color: var(--white);
    border-color: var(--primary-red);
    box-shadow: 0 4px 15px rgba(227, 30, 36, 0.3);
}

.group-tab.active i { color: var(--white); }
.group-tab i { color: var(--primary-red); font-size: 1rem; }

.tab-count {
    background: rgba(0,0,0,0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-size: 0.75rem;
}

.group-tab.active .tab-count {
    background: rgba(255,255,255,0.3);
}

/* Tab Dropdown */
.tab-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.5rem;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 100;
    padding: 0.4rem 0;
    border: 1px solid var(--light-gray);
}

.tab-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-bottom: none;
    border-right: none;
    transform: translateX(-50%) rotate(45deg);
}

.group-tab-wrapper:hover .tab-dropdown {
    display: block;
}

.tab-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    text-align: left;
    font-size: 0.85rem;
    color: var(--primary-black);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-dropdown-item:hover {
    background: var(--light-gray);
    color: var(--primary-red);
}

.tab-dropdown-item i {
    width: 16px;
    text-align: center;
    margin-right: 0.4rem;
    color: var(--medium-gray);
    font-size: 0.75rem;
}

/* ========================================
   Catalogue Container
   ======================================== */
.catalogue-container {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* ========================================
   Sidebar - Compact
   ======================================== */
.catalogue-sidebar {
    background: var(--white);
    border-radius: 10px;
    padding: 0.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-red) transparent;
}

.catalogue-sidebar::-webkit-scrollbar {
    width: 4px;
}

.catalogue-sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 4px;
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Sidebar Accordion */
.sidebar-all-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: none;
    border-radius: 6px;
    background: var(--light-gray);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-black);
    transition: var(--transition);
}

.sidebar-all-btn:hover {
    background: #e8e8e8;
}

.sidebar-all-btn.active {
    background: var(--primary-red);
    color: var(--white);
}

.sidebar-all-btn .count {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Accordion Group */
.accordion-group {
    border-bottom: 1px solid #f0f0f0;
}

.accordion-group:last-child {
    border-bottom: none;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-black);
    transition: var(--transition);
    border-radius: 6px;
}

.accordion-header:hover {
    background: var(--light-gray);
}

.accordion-header.active {
    color: var(--primary-red);
}

.accordion-header .acc-left {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.accordion-header .acc-right {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.accordion-header .acc-count {
    font-size: 0.75rem;
    color: var(--medium-gray);
    font-weight: 400;
}

.accordion-header .acc-chevron {
    font-size: 0.6rem;
    color: var(--medium-gray);
    transition: transform 0.2s;
}

.accordion-header.open .acc-chevron {
    transform: rotate(180deg);
}

/* Accordion Items */
.accordion-items {
    display: none;
    padding: 0 0 0.3rem 0.5rem;
}

.accordion-items.open {
    display: block;
}

.accordion-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--primary-black);
    transition: var(--transition);
}

.accordion-item:hover {
    background: var(--light-gray);
}

.accordion-item.active {
    background: rgba(227, 30, 36, 0.08);
    color: var(--primary-red);
    font-weight: 600;
}

.accordion-item .item-count {
    font-size: 0.7rem;
    color: var(--medium-gray);
    background: var(--light-gray);
    padding: 0.1rem 0.35rem;
    border-radius: 8px;
}

.accordion-item.active .item-count {
    background: var(--primary-red);
    color: var(--white);
}

/* Brand Filter */
.filter-group-brands {
    border-top: 1px solid #f0f0f0;
    padding-top: 0.4rem;
    margin-top: 0.2rem;
}

.brand-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-black);
    border-radius: 6px;
    transition: var(--transition);
}

.brand-filter-header:hover {
    background: var(--light-gray);
}

.brand-filter-header i:first-child {
    color: var(--primary-red);
}

.brand-filter-header #brandChevron {
    font-size: 0.6rem;
    color: var(--medium-gray);
    transition: transform 0.2s;
}

.brand-filter-header.open #brandChevron {
    transform: rotate(180deg);
}

.filter-options-brands {
    padding: 0.2rem 0 0.2rem 0.3rem;
    max-height: 200px;
    overflow-y: auto;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.4rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}

.filter-checkbox:hover {
    background: var(--light-gray);
}

.filter-checkbox input {
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary-red);
    width: 14px;
    height: 14px;
}

.filter-checkbox span {
    flex: 1;
    font-size: 0.8rem;
}

.filter-checkbox .count {
    font-size: 0.7rem;
    color: var(--medium-gray);
}

/* Reset button compact */
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-full {
    width: 100%;
}

/* ========================================
   Catalogue Main
   ======================================== */
.catalogue-main {
    min-height: 500px;
}

/* Toolbar */
.catalogue-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1.2rem;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.results-count {
    font-size: 1rem;
    font-weight: 600;
}

.results-count span {
    color: var(--primary-red);
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-options label {
    font-weight: 600;
    font-size: 0.85rem;
}

.sort-options select {
    padding: 0.4rem 0.8rem;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.sort-options select:focus {
    outline: none;
    border-color: var(--primary-red);
}

/* ========================================
   Products Grid
   ======================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

/* Product Card */
.product-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(227, 30, 36, 0.2);
}

.product-image {
    position: relative;
    width: 100%;
    height: 280px;
    background: var(--light-gray);
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--gradient-red);
    color: var(--white);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Product Info */
.product-info {
    padding: 1.2rem;
}

.product-brand {
    color: var(--medium-gray);
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.product-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-black);
    margin-bottom: 0.3rem;
}

.product-description {
    font-size: 0.85rem;
    color: var(--medium-gray);
    line-height: 1.4;
    margin-bottom: 0.8rem;
}

.product-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-red);
    margin-bottom: 0.8rem;
}

.product-price .starting {
    font-size: 0.8rem;
    color: var(--medium-gray);
    font-weight: 400;
}

.product-colors {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.more-colors {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--medium-gray);
    padding: 0.1rem 0.3rem;
}

.color-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--light-gray);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.color-dot:hover {
    transform: scale(1.2);
    border-color: var(--primary-red);
}

.product-card .btn {
    width: 100%;
}

/* ========================================
   Loading / Empty States
   ======================================== */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 1rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-gray);
    border-top-color: var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state i {
    font-size: 5rem;
    color: var(--medium-gray);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-black);
}

.empty-state p {
    color: var(--medium-gray);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 968px) {
    .catalogue-container {
        grid-template-columns: 1fr;
    }

    .catalogue-sidebar {
        position: static;
        max-height: none;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .group-tabs {
        gap: 0.3rem;
    }

    .group-tab {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    .group-tab span:not(.tab-count) {
        display: none;
    }

    .tab-dropdown {
        display: none !important;
    }
}

@media (max-width: 600px) {
    .page-header h1 {
        font-size: 1.8rem;
    }

    .catalogue-toolbar {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .sort-options {
        flex-direction: column;
        align-items: stretch;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.5rem;
    }

    .page-header p {
        font-size: 0.95rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .product-image {
        height: 220px;
    }

    .accordion-header {
        min-height: 44px;
        padding: 0.6rem;
    }

    .accordion-item {
        min-height: 40px;
        padding: 0.5rem;
    }

    .group-tab {
        min-height: 44px;
    }

    .catalogue-section {
        padding: 100px 0 40px;
    }

    .catalogue-toolbar {
        padding: 0.5rem 0.8rem;
    }
}
