/* Collections Page Styling */

.collection-page {
    padding: 1rem 4% 2rem;
    /* Reduced top padding from 2rem to 1rem */
    max-width: 1536px;
    margin: 0 auto;
}

/* Remove all shadows from collection page elements */
.collection-page * {
    box-shadow: none !important;
}

/* Override navbar shadow specifically for this page */
.app-navbar {
    box-shadow: none !important;
    border-bottom: 1px solid var(--border-color);
    /* Add a light border instead of shadow to separate from content */
}

/* Header & Search */
.collection-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
    /* Reduced from 2rem */
    text-align: center;
    width: 100%;
}

.collection-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: none;
    /* Hide if still present */
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    /* Make search full width */
}

.search-input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    /* Less rounded like the reference image */
    outline: none;
    transition: all 0.3s ease;
    box-shadow: none;
    /* Removed shadow */
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: none;
    /* Removed shadow */
}

.search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    width: 18px;
    height: 18px;
}

/* Layout */
.collection-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Filters Sidebar */
.collection-filters {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    /* Changed to match search bar */
    border: 1px solid var(--border-color);
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

/* Scrollbar for filters */
.collection-filters::-webkit-scrollbar {
    width: 6px;
}

.collection-filters::-webkit-scrollbar-track {
    background: transparent;
}

.collection-filters::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 3px;
}

.collection-filters::-webkit-scrollbar-thumb:hover {
    background: #c0c0c0;
}

.filter-header-mobile {
    display: none;
}

.filter-group {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.filter-group:last-of-type {
    border-bottom: none;
    margin-bottom: 1rem;
}

.filter-title-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    margin-bottom: 0.8rem;
    cursor: pointer;
}

.filter-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    /* Reduced from 1.1rem */
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.accordion-icon {
    width: 16px;
    height: 16px;
    color: #666;
    transition: transform 0.3s ease;
}

.filter-group.expanded .accordion-icon {
    transform: rotate(180deg);
}

.filter-content {
    display: none;
}

.filter-group.expanded .filter-content {
    display: block;
}

.filter-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.filter-list label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    /* Reduced from 0.8rem */
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    /* Reduced from 0.95rem */
    color: #444;
    cursor: pointer;
    transition: color 0.2s;
}

.filter-list label:hover {
    color: var(--primary-color);
}

.filter-list input[type="checkbox"],
.filter-list input[type="radio"] {
    width: 16px;
    /* Reduced from 18px */
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.color-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: none;
    /* Removed shadow */
    transition: transform 0.2s ease;
    position: relative;
    /* For tooltip */
}

/* Custom Instant Tooltip */
.color-swatch::after {
    content: attr(aria-label);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #222;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 10;
}

.color-swatch::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: #222 transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 10;
}

.color-swatch:hover::after,
.color-swatch:hover::before {
    opacity: 1;
    visibility: visible;
}

.color-swatch:hover {
    transform: scale(1.15);
    box-shadow: none;
    /* Removed shadow */
}

.clear-filters-btn {
    width: 100%;
    margin-top: 1rem;
}

/* Products Section */
.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.results-count {
    font-family: 'Inter', sans-serif;
    color: #666;
    font-size: 0.9rem;
}

.custom-dropdown {
    position: relative;
    width: 200px;
}

.dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    /* Matched search bar */
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text-color);
    background-color: white;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-toggle:focus,
.custom-dropdown.open .dropdown-toggle {
    border-color: var(--primary-color);
}

.dropdown-toggle .lucide {
    width: 16px;
    height: 16px;
    color: #666;
    transition: transform 0.2s ease;
}

.custom-dropdown.open .dropdown-toggle .lucide {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    z-index: 100;
}

.custom-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-option {
    padding: 0.5rem 1.2rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.dropdown-option:hover {
    background-color: #f5f5f5;
}

.dropdown-option.selected {
    color: var(--primary-color);
    font-weight: 500;
    background-color: #f0f8f8;
}

.mobile-filter-btn {
    display: none;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem 1rem;
    /* 2rem for rows, 1rem for columns */
}

/* Responsiveness */
@media (max-width: 1280px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 991px) {
    .collection-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .products-header {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .mobile-filter-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.6rem 1.2rem;
        background-color: #f5f5f5;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        /* Matched search bar radius */
        font-family: 'Inter', sans-serif;
        font-weight: 500;
        cursor: pointer;
    }

    .collection-filters {
        position: fixed;
        top: 0;
        left: -100%;
        width: 300px;
        height: 100vh;
        max-height: 100vh;
        z-index: 9999;
        /* Increased to sit above navbar */
        border-radius: 0;
        border: none;
        box-shadow: none;
        /* Removed shadow */
        transition: left 0.3s ease;
        padding: 0;
    }

    .collection-filters.active {
        left: 0;
    }

    .filter-header-mobile {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 1.5rem;
        background-color: #f9f9f9;
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 1.5rem;
    }

    .filter-header-mobile h3 {
        font-size: 1.3rem;
        margin: 0;
        color: var(--primary-color);
    }

    .close-filters {
        background: none;
        border: none;
        cursor: pointer;
        color: var(--text-color);
    }

    .filter-group {
        padding: 0 1.5rem 1.5rem;
    }

    .clear-filters-btn {
        margin: 0 1.5rem 1.5rem;
        width: calc(100% - 3rem);
    }

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

@media (max-width: 576px) {
    .collection-title {
        font-size: 2rem;
    }

    /* Kept 2 columns for mobile as requested */

    .products-header {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "results sort"
            "filters filters";
        gap: 0.8rem;
        align-items: center;
    }

    .custom-dropdown {
        grid-area: sort;
        width: 100%;
    }

    .mobile-filter-btn {
        grid-area: filters;
        width: 100%;
        justify-content: center;
    }

    .results-count {
        grid-area: results;
        text-align: left;
        margin-bottom: 0;
    }
}