/* ==========================
   PRODUCTS PAGE
========================== */

.collection-section {
    padding: 60px 8%;
}

.collection-label {
    color: #ff4e8b;
    letter-spacing: 4px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
}

.collection-title {
    font-family: 'Playfair Display', serif;
    font-size: 60px;
    color: #4b145f;
    margin-bottom: 30px;
}

.filter-section {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    padding: 0 8% 40px;
}

.filter-btn {
    padding: 12px 28px;
    border-radius: 30px;
    border: 1px solid #f4d9e8;
    background: #fff;
    color: #4b145f;
    font-weight: 600;
    cursor: pointer;
}

.filter-btn.active {
    background: linear-gradient(135deg, #ff4e8b, #ff1e78);
    color: white;
    border: none;
}


.products-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px;
    padding: 24px 4%;
    align-items: start;
}

@media (max-width: 1100px) and (min-width: 769px) {
    .products-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;
        padding: 22px 3%;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        padding: 16px 12px 28px;
    }
}


.product-card {
    position: relative;
    min-width: 0;
    background: #fff;
    border: 1px solid #f3e5f0;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(75, 20, 95, 0.07);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(75, 20, 95, 0.13);
}

.product-card img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #fff7fb;
}

.product-card h3 {
    margin: 0;
    padding: 10px 10px 4px;
    color: #4b145f;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
    overflow-wrap: anywhere;
}

@media (max-width: 768px) {
    .product-card {
        border-radius: 12px;
    }

    .product-card h3 {
        padding: 9px;
        font-size: 13px;
    }
}
.cart-btn {
    width: 100%;
    margin-top: 20px;
    padding: 14px;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #8e2de2, #ff4e8b);
}

/* ==========================
   PRODUCT POPUP
========================== */


.popup-left {
    width: 50%;
    padding: 20px;
}



.main-image-container img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: 12px;
}

.thumbnail-strip {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.thumbnail-strip img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 8px;
}

.quantity-section {
    margin-top: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
}

.quantity-section button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #8e2de2;
    color: white;
    cursor: pointer;
    font-size: 18px;
}

.quantity-value {
    min-width: 24px;
    text-align: center;
    font-weight: 700;
    color: #4b145f;
}

.actual-price {
    text-decoration: line-through;
    color: #888;
}

.offer-price {
    color: #ff1e78;
    font-weight: 700;
}

@media (max-width: 768px) {
   

    .collection-title {
        font-size: 40px;
    }

}


/* ==========================
   PRODUCT QUICK VIEW OVERLAY
========================== */

.popup-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
}

/* Hidden must override the overlay's display:flex */
.popup-overlay.hidden {
    display: none !important;
}

/* The overlay handles centering.
   Do NOT make .product-popup position: fixed. */
.product-popup {
    position: relative;
    width: min(1100px, 95vw);
    max-height: 90vh;
    margin: auto;
    background: #fff;
    border-radius: 20px;
    display: flex;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
    transform: none;
}

/* Keep the details scrollable inside the popup */
.popup-right {
    width: 50%;
    padding: 30px;
    position: relative;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Lock background scrolling while Quick View is open */
body.popup-open {
    overflow: hidden !important;
}


/* ==========================
   PRODUCT SEARCH SORT FILTER
========================== */


/* Search and sorting toolbar */
.product-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    padding: 0 4%;
    margin: 0 auto 20px;
}

.product-tools input,
.product-tools select {
    display: block;
    min-width: 0;
    height: 46px;
    padding: 0 12px;
    border: 1px solid #e5d4e9;
    border-radius: 10px;
    background: #fff;
    color: #333;
    font: inherit;
    font-size: 14px;
}

.product-tools input {
    width: min(280px, 28vw);
}

.product-tools select {
    width: 190px;
}

.product-tools input:focus,
.product-tools select:focus {
    outline: 2px solid #8e2de2;
    outline-offset: 2px;
}

.open-filter-btn {
    flex: 0 0 auto;
    min-height: 46px;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #8e2de2, #ff4e8b);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (min-width: 769px) {
    .product-tools {
        padding-right: 4%;
    }
}

@media (max-width: 768px) {
    .product-tools {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px;
        padding: 0 12px;
        margin-bottom: 16px;
    }

    .product-tools input {
        grid-column: 1 / -1;
        width: 100%;
    }

    .product-tools select {
        width: 100%;
    }

    .open-filter-btn {
        width: 100%;
        min-height: 46px;
        padding: 8px;
        font-size: 13px;
    }
}
.filter-sheet-panel input {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #e5d4e9;
    border-radius: 10px;
    background: #fff;
    color: #333;
    font: inherit;
}

.product-tools label,
.filter-sheet-panel label {
    color: #4b145f;
    font-size: 13px;
    font-weight: 600;
}

.open-filter-btn,
.filter-sheet-actions button {
    min-height: 44px;
    padding: 10px 14px;
    border: 0;
    border-radius: 10px;
    background: #4b145f;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.filter-sheet {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 12px;
    background: rgba(25, 10, 30, 0.55);
}

.filter-sheet.hidden {
    display: none !important;
}

.filter-sheet-panel {
    width: min(520px, 100%);
    max-height: 85vh;
    overflow-y: auto;
    padding: 22px;
    border-radius: 20px 20px 12px 12px;
    background: #fff;
    display: grid;
    gap: 12px;
}

.filter-sheet-panel h2 {
    color: #4b145f;
    font-family: "Playfair Display", serif;
}

.filter-sheet-actions {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.filter-sheet-actions button:nth-child(2) {
    background: linear-gradient(135deg, #8e2de2, #ff4e8b);
}

.filter-sheet-actions button:nth-child(3) {
    background: #f4edf7;
    color: #4b145f;
}


/* ==========================
Quick View purchase details 
==========================*/
.price-box {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
    font-size: 23px;
}

.purchase-trust {
    margin-top: 16px;
    padding: 13px;
    border-radius: 12px;
    background: #fff7fb;
    color: #4b145f;
    font-size: 12px;
    line-height: 1.6;
}

.purchase-trust p + p {
    margin-top: 6px;
}

.purchase-trust a {
    color: #8e2de2;
    font-weight: 700;
}

.popup-share-btn {
    width: 100%;
    min-height: 44px;
    margin-top: 10px;
    border: 1px solid #e5d4e9;
    border-radius: 10px;
    background: #fff;
    color: #4b145f;
    font-weight: 600;
    cursor: pointer;
}

.quantity-section button {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    font-size: 21px;
}

.cart-btn {
    min-height: 50px;
    margin-top: 16px;
}

@media (max-width: 768px) {
    .popup-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .product-popup {
        width: 100%;
        max-width: none;
        max-height: 92dvh;
        margin: 0;
        border-radius: 22px 22px 0 0;
        flex-direction: column;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .popup-left,
    .popup-right {
        width: 100%;
        padding: 12px 16px;
    }

    .main-image-container img {
        width: 100%;
        height: clamp(210px, 48vh, 330px);
        object-fit: contain;
        background: #fff7fb;
    }

    .popup-right {
        overflow: visible;
    }

    .quantity-section {
        gap: 18px;
    }

    .quantity-section button {
        width: 48px;
        height: 48px;
    }

    
.close-popup {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 20;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;
    padding: 0;

    border: 1px solid rgba(75, 20, 95, 0.15);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #4b145f;

    font-size: 27px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

}


/* GLIMMER PRODUCT CARD DETAILS */
.product-image-wrap {
    position: relative;
    overflow: hidden;
    background: #fff;
    border-radius: 10px 10px 0 0;
}

.product-image-wrap > img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #fff;
}

.product-badge {
    position: absolute;
    z-index: 2;
    top: 10px;
    left: 10px;
    padding: 6px 11px;
    border-radius: 3px 12px 12px 3px;
    background: linear-gradient(135deg, #8e2de2, #ff4e8b);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(75, 20, 95, 0.14);
}

.product-badge.trending-badge {
    background: linear-gradient(135deg, #4b145f, #8e2de2);
}

.product-rating {
    position: absolute;
    left: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.94);
    color: #555;
    font-size: 12px;
}

.product-rating span:first-child {
    color: #4b145f;
    font-weight: 600;
}

.product-card-info {
    padding: 10px 2px 14px;
}

.product-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.product-prices {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
}

.product-prices strong {
    color: #222;
    font-size: 16px;
    font-weight: 700;
}

.product-prices del {
    color: #888;
    font-size: 12px;
}

.product-add-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 38px;
    margin-top: 10px;
    padding: 8px 12px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #8e2de2, #ff4e8b);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.product-add-cart:hover {
    box-shadow: 0 4px 12px rgba(142, 45, 226, 0.25);
    transform: translateY(-1px);
}

.product-card-out-of-stock {
    color: #a33;
    font-size: 11px;
    font-weight: 600;
}

.product-card-info h3 {
    margin: 8px 0 0;
    color: #4b145f;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 500;
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 12px;
        padding: 16px;
    }

    .product-prices strong {
        font-size: 14px;
    }

    .product-prices del {
        font-size: 11px;
    }

    .product-card-info {
        padding-top: 8px;
    }
}

@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}


/* PRODUCT CARD ALIGNMENT FIX — DESKTOP AND MOBILE */
.products-grid {
    align-items: stretch;
}

.products-grid .product-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.products-grid .product-image-wrap {
    flex: 0 0 auto;
    width: 100%;
    margin: 0;
    padding: 0;
    border-radius: 0;
    overflow: hidden;
    background: #fff;
}

.products-grid .product-image-wrap > img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    margin: 0;
    padding: 0;
    object-fit: contain;
    object-position: center;
    border: 0;
    border-radius: 0;
    box-sizing: border-box;
}

.products-grid .product-card-info {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 10px 12px 12px;
    box-sizing: border-box;
}

.products-grid .product-prices {
    width: 100%;
    min-width: 0;
}

.products-grid .product-card-info h3 {
    width: 100%;
    margin: 8px 0 0;
    padding: 0;
    box-sizing: border-box;
    overflow-wrap: anywhere;
}

.products-grid .product-card-info .product-add-cart {
    width: 100%;
    margin-top: auto;
    margin-bottom: 0;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .products-grid {
        gap: 12px;
        padding: 12px;
    }

    .products-grid .product-card-info {
        padding: 9px 9px 11px;
    }

    .products-grid .product-prices strong {
        font-size: 14px;
    }

    .products-grid .product-card-info h3 {
        font-size: 13px;
    }

    .products-grid .product-card-info .product-add-cart {
        min-height: 36px;
        padding: 8px 6px;
        font-size: 12px;
    }
}


/* FINAL PRODUCT CARD WIDTH AND ALIGNMENT FIX */
.products-grid .product-card {
    padding: 0 !important;
    overflow: hidden;
    box-sizing: border-box;
}

.products-grid .product-card .product-image-wrap {
    display: block;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0;
    border-radius: 0;
    overflow: hidden;
    line-height: 0;
    box-sizing: border-box;
}

.products-grid .product-card .product-image-wrap > img {
    display: block;
    width: 100% !important;
    max-width: none !important;
    height: auto;
    aspect-ratio: 1 / 1;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: cover;
    object-position: center;
    border: 0 !important;
    border-radius: 0 !important;
    box-sizing: border-box;
}

.products-grid .product-card .product-card-info {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 10px 12px 12px;
    box-sizing: border-box;
}

.products-grid .product-card .product-prices,
.products-grid .product-card .product-card-info h3,
.products-grid .product-card .product-add-cart {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.products-grid .product-card .product-add-cart {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
    border-radius: 9px;
}

@media (max-width: 768px) {
    .products-grid .product-card .product-card-info {
        padding: 9px 9px 11px;
    }

    .products-grid .product-card .product-prices strong {
        font-size: 14px;
    }
}
