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

/* Page Heading */
.collection-heading {
    text-align: center;
    padding: 40px 20px 24px;
    font-family: "Poppins", sans-serif;
}

.collection-heading__title {
    font-size: 32px;
    font-weight: 500;
    line-height: 42px;
    color: #000;
}

/* ===========================
   CATEGORY BADGES (circular)
   =========================== */
.category-badges {
    padding: 16px 40px 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
}

.category-badges::-webkit-scrollbar {
    display: none;
}

.category-badges__track {
    display: flex;
    gap: 24px;
    justify-content: center;
    min-width: max-content;
}

.category-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #000;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.category-badge:hover {
    opacity: 0.75;
}

.category-badge.active {
    opacity: 1;
}

.category-badge__img-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.category-badge.active .category-badge__img-wrap {
    border-color: var(--nanda-accent, #c6233a);
}

.category-badge__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-badge__label {
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #000;
    text-align: center;
    white-space: nowrap;
}

/* ===========================
   FILTER / SORT TOOLBAR
   =========================== */
.filter-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 40px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    font-family: "DM Sans", sans-serif;
    background: #fff;
}

.filter-toolbar__left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.filter-toolbar__grid-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-toolbar__grid-btn {
    display: flex;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    opacity: 0.3;
    transition: opacity 0.2s;
}

.filter-toolbar__grid-btn.active {
    opacity: 1;
}

.filter-toolbar__grid-btn:hover {
    opacity: 0.7;
}

.grid-bar {
    width: 3px;
    height: 18px;
    background-color: #000;
    border-radius: 1px;
}

.filter-toolbar__count {
    font-size: 14px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.7);
}

.filter-toolbar__right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.filter-toolbar__sort {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.filter-toolbar__sort-icon {
    display: flex;
    align-items: center;
}

.filter-toolbar__sort-label {
    font-size: 14px;
    font-weight: 500;
    color: #000;
}

.filter-toolbar__sort-select {
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.7);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 16px;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
}

.filter-toolbar__filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #000;
    padding: 6px 0;
    transition: opacity 0.2s;
}

.filter-toolbar__filter-btn:hover {
    opacity: 0.7;
}

.filter-toolbar__filter-icon {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 18px;
}

.filter-toolbar__filter-line {
    height: 2px;
    background-color: #000;
    border-radius: 1px;
}

.filter-toolbar__filter-line:nth-child(1) {
    width: 100%;
}

.filter-toolbar__filter-line:nth-child(2) {
    width: 70%;
}

.filter-toolbar__filter-line:nth-child(3) {
    width: 40%;
}

/* ===========================
   FILTER SIDEBAR
   =========================== */
.filter-sidebar {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
}

.filter-sidebar.open {
    display: block;
}

.filter-sidebar__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.3s ease;
}

.filter-sidebar__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 360px;
    max-width: 90%;
    height: 100%;
    background: #fff;
    padding: 24px;
    overflow-y: auto;
    animation: slideLeft 0.3s ease;
}

.filter-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.filter-sidebar__title {
    font-family: "Poppins", sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: #000;
}

.filter-sidebar__close {
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    font-size: 24px;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-group {
    margin-bottom: 24px;
}

.filter-group__heading {
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #000;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group__options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    color: #333;
    padding: 4px 0;
}

.filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--nanda-accent, #c6233a);
    cursor: pointer;
}

.filter-option__label {
    flex: 1;
}

.filter-option__count {
    color: rgba(0, 0, 0, 0.4);
    font-size: 12px;
}

.filter-sidebar__actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.filter-sidebar__apply {
    flex: 1;
    padding: 12px;
    background-color: #000;
    color: #fff;
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.filter-sidebar__apply:hover {
    background-color: #333;
}

.filter-sidebar__clear {
    flex: 1;
    padding: 12px;
    background: none;
    color: #000;
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-sidebar__clear:hover {
    border-color: #000;
}

/* ===========================
   COLLECTION PRODUCT GRID
   =========================== */
.collection-products {
    padding: 24px 40px 60px;
}

.collection-grid {
    width: 100%;
}

.collection-grid .products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.collection-grid .products::before,
.collection-grid .products::after {
    display: none;
}

.collection-grid .products .product {
    margin: 0;
    padding: 0;
    float: none;
    width: auto !important;
}

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

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

/* Product card (reusing styles from main page) */
.coll-product-card {
    position: relative;
}

.coll-product-card__link {
    display: block;
    text-decoration: none;
    color: #000;
}

.coll-product-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 8px;
    background-color: #f0f0f0;
}

.coll-product-card__img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    transition: opacity 0.35s ease;
}

.coll-product-card__img--primary {
    opacity: 1;
}

.coll-product-card__img--hover {
    opacity: 0;
}

.coll-product-card__media:hover .coll-product-card__img--primary {
    opacity: 0;
}

.coll-product-card__media:hover .coll-product-card__img--hover {
    opacity: 1;
}

.coll-product-card__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 4px 10px;
    background-color: var(--nanda-accent, #c6233a);
    color: #fff;
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coll-product-card__wishlist {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.coll-product-card__wishlist:hover {
    background: #fff;
}

.coll-product-card__wishlist svg {
    width: 18px;
    height: 18px;
}

.coll-product-card__info {
    padding: 12px 4px 0;
}

.coll-product-card__name {
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    color: #000;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.coll-product-card__prices {
    display: flex;
    align-items: center;
    gap: 8px;
}

.coll-product-card__price--sale {
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #000;
}

.coll-product-card__price--compare {
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.45);
    text-decoration: line-through;
}

.coll-product-card__discount {
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--nanda-accent, #c6233a);
}

/* ===========================
   ANIMATIONS
   =========================== */
@keyframes slideLeft {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

    .filter-toolbar__grid-btns {
        display: none;
    }

    .collection-products {
        padding: 20px 20px 48px;
    }

    .category-badges {
        padding: 12px 20px 20px;
    }

    .filter-toolbar {
        padding: 10px 20px;
    }
}

@media (max-width: 768px) {

    /* --- Page Heading --- */
    .collection-heading {
        padding: 20px 16px 12px;
    }

    .collection-heading__title {
        font-size: 22px;
        line-height: 30px;
    }

    /* --- Category Badges (horizontal scroll) --- */
    .category-badges {
        padding: 8px 0 16px;
    }

    .category-badges__track {
        justify-content: flex-start;
        gap: 16px;
        padding: 0 16px;
    }

    .category-badge {
        gap: 6px;
    }

    .category-badge__img-wrap {
        width: 56px;
        height: 56px;
    }

    .category-badge__label {
        font-size: 10px;
        max-width: 60px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* --- Filter Toolbar (sticky on mobile) --- */
    .filter-toolbar {
        padding: 10px 16px;
        position: sticky;
        top: 0;
        z-index: 10;
        gap: 8px;
    }

    .filter-toolbar__left {
        gap: 8px;
    }

    .filter-toolbar__grid-btns {
        display: none;
    }

    .filter-toolbar__count {
        font-size: 12px;
    }

    .filter-toolbar__right {
        gap: 12px;
    }

    .filter-toolbar__sort-label {
        display: none;
    }

    .filter-toolbar__sort-select {
        font-size: 12px;
    }

    .filter-toolbar__filter-btn {
        font-size: 12px;
        gap: 6px;
        padding: 6px 12px;
        border: 1px solid rgba(0,0,0,0.15);
        border-radius: 20px;
    }

    .filter-toolbar__filter-icon {
        width: 14px;
    }

    /* --- Filter Sidebar (full width on mobile) --- */
    .filter-sidebar__panel {
        width: 100%;
        max-width: 100%;
        padding: 20px 16px;
        box-sizing: border-box;
    }

    .filter-sidebar__header {
        margin-bottom: 20px;
        padding-bottom: 12px;
    }

    .filter-sidebar__title {
        font-size: 16px;
    }

    .filter-group {
        margin-bottom: 20px;
    }

    .filter-group__heading {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .filter-option {
        padding: 6px 0;
        font-size: 13px;
    }

    .filter-option input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    .filter-sidebar__actions {
        position: sticky;
        bottom: 0;
        background: #fff;
        margin: 0 -16px 0;
        padding: 16px;
        border-top: 1px solid rgba(0,0,0,0.1);
        gap: 10px;
    }

    .filter-sidebar__apply,
    .filter-sidebar__clear {
        padding: 14px;
        font-size: 14px;
        border-radius: 10px;
    }

    /* --- Product Grid --- */
    .collection-products {
        padding: 12px 12px 40px;
        overflow: hidden;
    }

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

    .coll-product-card__media {
        border-radius: 6px;
    }

    .coll-product-card__badge {
        font-size: 10px;
        padding: 3px 8px;
        top: 6px;
        left: 6px;
    }

    .coll-product-card__wishlist {
        width: 30px;
        height: 30px;
        top: 6px;
        right: 6px;
    }

    .coll-product-card__wishlist svg {
        width: 14px;
        height: 14px;
    }

    .coll-product-card__info {
        padding: 6px 2px 0;
    }

    .coll-product-card__name {
        font-size: 11px;
        line-height: 16px;
        -webkit-line-clamp: 2;
    }

    .coll-product-card__prices {
        gap: 4px;
    }

    .coll-product-card__price--sale {
        font-size: 12px;
    }

    .coll-product-card__price--compare {
        font-size: 10px;
    }

    .coll-product-card__discount {
        font-size: 10px;
    }
}
