/* ============================================
   COLLECTION PAGE STYLES
   ============================================ */

.collection-page {
    padding: 40px 0 80px;
}

.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
}

/* Controls */
.collection-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 10px 20px;
    border-radius: 20px;
    background: transparent;
    border: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-gray);
    transition: var(--transition);
    cursor: pointer;
}

.filter-tab:hover {
    border-color: var(--primary-dark);
    color: var(--primary-dark);
}

.filter-tab.active {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

.collection-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.sort-select {
    padding: 10px 36px 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-dark);
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234a7c62' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

.product-card {
    position: relative;
    display: block;
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-4px);
}

.product-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Product Image */
.product-image {
    position: relative;
    aspect-ratio: 3/4;
    /* border-radius: var(--radius-md); */
    overflow: hidden;
    background: var(--bg-cream);
    margin-bottom: 16px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

/* Wishlist Button */
.wishlist-btn-form,
.wishlist-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    z-index: 2;
    opacity: 0;
    transition: var(--transition);
}

.product-card:hover .wishlist-btn-form,
.product-card:hover .wishlist-btn {
    opacity: 1;
}

.wishlist-btn-form button,
.wishlist-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-decoration: none;
    cursor: pointer;
}

.wishlist-btn-form button:hover,
.wishlist-btn:hover {
    background: var(--bg-cream);
}

.wishlist-btn-form .ui-icon,
.wishlist-btn .ui-icon,
.wishlist-btn-form svg,
.wishlist-btn svg {
    width: 18px;
    height: 18px;
    object-fit: contain;
    color: var(--text-gray);
}

.wishlist-btn-form button:hover svg,
.wishlist-btn:hover svg {
    color: var(--primary);
}

.wishlist-btn-form button.active,
.wishlist-btn.active {
    border-color: var(--brand-green);
    background: #fff;
    color: var(--brand-navy);
}

.wishlist-btn-form button.active svg,
.wishlist-btn.active svg {
    color: var(--brand-navy);
    fill: currentColor;
}

.wishlist-btn-form.is-loading {
    opacity: 0.65;
    pointer-events: none;
}

/* Free Shipping Badge */
.free-shipping-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: var(--success);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-info {
    padding: 0 4px;
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-dark);
}

.product-price {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 8px;
}

.product-colors {
    display: flex;
    gap: 6px;
}

.color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--border-color);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 32px 0 64px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    background: white;
    transition: var(--transition);
}

.page-link:hover {
    border-color: var(--primary-dark);
    color: var(--primary-dark);
    text-decoration: none;
}

.page-link.current {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

/* Load More */
.load-more {
    text-align: center;
    margin-bottom: 64px;
}

/* Brand Banner */
.brand-banner {
    position: relative;
    min-height: 400px;
    background: var(--primary-dark);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.banner-image {
    display: block;
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.banner-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    width: 58%;
    padding: 48px;
    color: white;
    background: linear-gradient(90deg, rgba(47, 90, 69, 0.82) 0%, rgba(47, 90, 69, 0.58) 58%, rgba(47, 90, 69, 0) 100%);
}

.banner-content h2 {
    max-width: 460px;
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.banner-content p {
    max-width: 390px;
    font-size: 18px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.86);
    margin-bottom: 32px;
}

.banner-content .btn-primary {
    padding: 14px 32px;
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.banner-content .btn-primary:hover {
    background: #234b39;
    border-color: #234b39;
}

/* Responsive */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .banner-image {
        height: 320px;
    }
}

@media (max-width: 768px) {
    .collection-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .banner-content {
        width: 100%;
        padding: 32px 24px;
        background: linear-gradient(90deg, rgba(47, 90, 69, 0.84) 0%, rgba(47, 90, 69, 0.48) 100%);
    }
    
    .banner-content h2 {
        font-size: 28px;
    }
    
    .banner-content p {
        font-size: 16px;
    }
}

.collection-page {
    padding: 0 0 88px;
    background: #fff;
}

.collection-page > .container {
    max-width: 1440px;
}

.page-header {
    margin-bottom: 34px;
    padding: 22px 0 0;
    border-top: 1px solid var(--border-light);
}

.collection-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 34px;
    color: var(--text-light);
    font-size: 11px;
}

.collection-breadcrumbs a {
    color: var(--primary-light);
}

.collection-page .page-title {
    margin: 0;
    color: var(--text-dark);
    font-size: clamp(32px, 4vw, 52px);
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.05;
}

.collection-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: clamp(28px, 4vw, 56px);
    align-items: start;
}

.collection-sidebar {
    position: sticky;
    top: calc(var(--site-header-height, 122px) + 16px);
    max-height: calc(100vh - var(--site-header-height, 122px) - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    border: 1px solid var(--border-light);
    background: #fff;
}

.collection-filter-sheet-head,
.collection-filter-backdrop,
.collection-filter-toggle {
    display: none;
}

.collection-sidebar .collection-filter-list--pills {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
}

.collection-sidebar .collection-filter-list--pills li {
    margin: 0;
}

.collection-sidebar .collection-filter-list--pills a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    font-size: 12px;
}

.collection-sidebar .collection-filter-list--pills a span {
    color: var(--text-light);
    font-size: 10px;
}

.collection-sidebar .collection-filter-list--pills a.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.collection-sidebar .collection-filter-list--pills a.active span {
    color: rgba(255, 255, 255, 0.75);
}

.collection-filter-count {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
}

.collection-filter-section {
    padding: 22px 18px;
    border-bottom: 1px solid var(--border-light);
}

.collection-filter-section:last-child {
    border-bottom: 0;
}

.collection-filter-section h2 {
    margin: 0 0 18px;
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.collection-filter-list,
.collection-color-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.collection-filter-list a,
.collection-color-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--text-gray);
    font-size: 12px;
    line-height: 1.3;
    text-decoration: none;
}

.collection-filter-list a span:last-child,
.collection-color-list a span:last-child {
    color: var(--text-light);
    font-size: 10px;
}

.collection-filter-list a:hover,
.collection-filter-list a.active,
.collection-color-list a:hover,
.collection-color-list a.active {
    color: var(--primary);
}

.collection-color-list a {
    justify-content: flex-start;
}

.collection-color-list a span:last-child {
    margin-left: auto;
}

.collection-color-swatch {
    display: inline-block;
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    background: var(--color);
}

.price-range {
    position: relative;
    height: 28px;
    margin: 24px 2px 18px;
}

.price-range-track {
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    height: 4px;
    margin: 0;
    border-radius: 999px;
    background: var(--border-light);
    transform: translateY(-50%);
}

.price-range-track::before,
.price-range-track::after {
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    content: '';
    transform: translateY(-50%);
}

.price-range-track::before {
    left: -1px;
}

.price-range-track::after {
    right: -1px;
}

.price-range-track span {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: inherit;
    background: var(--primary);
}

.price-range-slider {
    position: absolute;
    top: 50%;
    left: 0;
    z-index: 2;
    width: 100%;
    height: 18px;
    margin: 0;
    appearance: none;
    background: transparent;
    pointer-events: none;
    transform: translateY(-50%);
}

.price-range-slider--min {
    z-index: 3;
}

.price-range-slider::-webkit-slider-runnable-track {
    height: 4px;
    background: transparent;
}

.price-range-slider::-moz-range-track {
    height: 4px;
    background: transparent;
}

.price-range-slider::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
    margin-top: -4px;
    appearance: none;
    border: 0;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0, 0, 0, 0.18);
    cursor: grab;
    pointer-events: auto;
}

.price-range-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 2px #fff, 0 1px 4px rgba(0, 0, 0, 0.18);
    cursor: grab;
    pointer-events: auto;
}

.price-range-slider:active::-webkit-slider-thumb,
.price-range-slider:active::-moz-range-thumb {
    cursor: grabbing;
}

.price-range-slider:focus-visible::-webkit-slider-thumb,
.price-range-slider:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 3px rgba(74, 124, 98, 0.25), 0 0 0 2px #fff;
}

.price-inputs {
    display: flex;
    align-items: end;
    gap: 7px;
}

.price-inputs label {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 5px;
    color: var(--text-light);
    font-size: 10px;
}

.price-inputs input {
    width: 100%;
    min-width: 0;
    padding: 7px 6px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background: #fff;
    color: var(--text-dark);
    font-size: 11px;
}

.filter-submit {
    width: 100%;
    margin-top: 14px;
    padding: 8px 12px;
    border: 1px solid var(--primary);
    border-radius: 3px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.clear-filters {
    display: inline-block;
    margin-top: 14px;
    color: var(--primary);
    font-size: 11px;
    text-decoration: underline;
}

.collection-results {
    min-width: 0;
}

.collection-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.collection-result-count {
    margin: 0;
    color: var(--text-gray);
    font-size: 12px;
}

.collection-result-count strong {
    color: var(--primary);
}

.collection-actions {
    gap: 8px;
}

.sort-label {
    color: var(--text-light);
    font-size: 11px;
}

.collection-page .sort-select {
    min-width: 136px;
    padding: 8px 28px 8px 10px;
    border-color: var(--border-light);
    border-radius: 3px;
    font-size: 11px;
}

.collection-page .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px 8px;
    margin-bottom: 48px;
}

.collection-page .product-card {
    min-width: 0;
}

.collection-page .product-image {
    aspect-ratio: 4 / 5;
    margin-bottom: 8px;
    padding: 0;
    border: 1px solid var(--border-light);
    background: var(--bg-cream);
}

.collection-page .product-image img {
    object-fit: cover;
    object-position: center;
    mix-blend-mode: normal;
}

.collection-page .product-card:hover .product-image img {
    transform: none;
}

.collection-page .product-info {
    padding: 0 4px;
}

.collection-page .product-category {
    display: block;
    margin-bottom: 4px;
    color: var(--text-light);
    font-size: 9px;
    line-height: 1.2;
    text-transform: capitalize;
}

.collection-page .product-name {
    display: -webkit-box;
    min-height: 2.6em;
    margin-bottom: 5px;
    overflow: hidden;
    color: var(--text-dark);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    -webkit-line-clamp: 2;
}

.collection-page .product-price {
    margin-bottom: 9px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
}

.collection-page .color-dot {
    width: 11px;
    height: 11px;
    border-width: 1px;
}

.collection-page .wishlist-btn-form,
.collection-page .wishlist-btn {
    opacity: 1;
}

.collection-page .wishlist-btn-form,
.collection-page .wishlist-btn,
.collection-page .wishlist-btn-form button {
    width: 22px;
    height: 22px;
}

.collection-page .wishlist-btn-form,
.collection-page .wishlist-btn {
   top: 2px;
    right: 2px;
}

.collection-page .wishlist-btn-form button:not(.active),
.collection-page .wishlist-btn:not(.active) {
    background: rgba(255, 255, 255, 0.9);
}

.collection-page .wishlist-btn-form .ui-icon,
.collection-page .wishlist-btn .ui-icon {
    width: 16px;
    height: 16px;
}

.collection-empty {
    grid-column: 1 / -1;
    padding: 48px 0;
    color: var(--text-gray);
    text-align: center;
}

@media (max-width: 1024px) and (min-width: 769px) {
    .collection-layout {
        grid-template-columns: 196px minmax(0, 1fr);
        gap: 24px;
    }

    .collection-page .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px 6px;
    }
}

@media (max-width: 768px) {
    .collection-page {
        padding-bottom: 64px;
    }

    .page-header {
        padding-top: 16px;
    }

    .collection-breadcrumbs {
        margin-bottom: 26px;
    }

    .collection-filter-toggle {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 10px;
        border: 1px solid var(--border-color);
        border-radius: 3px;
        background: #fff;
        color: var(--text-dark);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
    }

    .collection-layout {
        display: block;
    }

    .collection-sidebar {
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1300;
        max-height: 82vh;
        border: 0;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -12px 40px rgba(17, 33, 25, 0.18);
        transform: translateY(105%);
        visibility: hidden;
        transition: transform 0.28s ease, visibility 0s linear 0.28s;
    }

    .collection-sidebar.is-open {
        transform: translateY(0);
        visibility: visible;
        transition: transform 0.28s ease;
    }

    .collection-filter-sheet-head {
        position: sticky;
        top: 0;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 18px;
        border-bottom: 1px solid var(--border-light);
        background: #fff;
        font-size: 13px;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .collection-filter-close {
        border: 0;
        background: transparent;
        color: var(--text-dark);
        font-size: 26px;
        line-height: 1;
    }

    .collection-filter-backdrop:not([hidden]) {
        position: fixed;
        inset: 0;
        z-index: 1299;
        display: block;
        background: rgba(10, 20, 15, 0.42);
    }

    .collection-toolbar {
        margin-bottom: 18px;
    }

    .collection-result-count {
        font-size: 11px;
    }

    .collection-actions .sort-label {
        display: none;
    }

    .collection-page .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 4px;
    }

    .collection-page .product-name {
        font-family: var(--font-heading);
        font-size: 12px;
        font-weight: 400;
        letter-spacing: 0.02em;
        line-height: 1.2;
    }

    .collection-page .product-price {
        font-size: 13px;
    }

    .collection-page .product-image {
        padding: 0;
    }

    .collection-page .product-image img {
        object-fit: cover;
        object-position: center;
    }
}

@media (max-width: 600px) {
    .collection-page .page-title {
        font-size: 28px;
    }
}
