/* --- SHEDA DUBAI | Premium Product System --- */

:root {
    --shop-bg: #f6f4f1;
    --shop-accent: #d4af37;
    --shop-text: #1E1E1E;
    --shop-text-muted: #888888;
    --card-bg: #fdfdfd;
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

/* --- Layout & Container --- */
.shop-section {
    padding: 0 0 100px;
    background: var(--shop-bg);
}

.shop-header {
    text-align: center;
    margin-bottom: 0;
}

.shop-category-tag {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    color: var(--shop-accent);
    font-weight: 700;
    margin-bottom: 20px;
}

.shop-title {
    font-family: var(--font-serif);
    font-size: 52px;
    font-weight: 400;
    letter-spacing: -0.01em;
    margin-bottom: 0;
}

/* --- Toolbar & Filters --- */
.shop-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 0;
}

.filter-group {
    display: flex;
    gap: 40px;
}

.filter-btn {
    background: none;
    border: none;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color 0.3s var(--ease-out-expo);
}

.filter-btn:hover {
    color: var(--shop-accent);
}

.sort-select {
    border: none;
    background: none;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

/* --- Filter Drawer --- */
.filter-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 400px;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    z-index: 3000;
    box-shadow: 10px 0 50px rgba(0, 0, 0, 0.05);
    transform: translateX(-100%);
    transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1); /* Enhanced luxury smooth */
    display: flex;
    flex-direction: column;
    overscroll-behavior: contain;
    will-change: transform;
}

.filter-drawer.active {
    transform: translateX(0);
}

.filter-drawer .drawer-header,
.filter-drawer .filter-section,
.filter-drawer .drawer-footer {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s var(--ease-out);
}

.filter-drawer.active .drawer-header,
.filter-drawer.active .filter-section,
.filter-drawer.active .drawer-footer {
    opacity: 1;
    transform: translateY(0);
}

/* Elegant Stagger Delays */
.filter-drawer.active .drawer-header {
    transition-delay: 0.1s;
}
.filter-drawer.active .filter-section:nth-child(1) {
    transition-delay: 0.2s;
}
.filter-drawer.active .filter-section:nth-child(2) {
    transition-delay: 0.28s;
}
.filter-drawer.active .filter-section:nth-child(3) {
    transition-delay: 0.36s;
}
.filter-drawer.active .filter-section:nth-child(4) {
    transition-delay: 0.44s;
}
.filter-drawer.active .filter-section:nth-child(5) {
    transition-delay: 0.52s;
}
.filter-drawer.active .drawer-footer {
    transition-delay: 0.6s;
}

.drawer-header {
    padding: 20px 30px;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* Prevent header from shrinking */
}

.drawer-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.close-drawer {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.close-drawer:hover {
    opacity: 1;
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0; /* Important for flex-child overflow */
    padding: 15px 30px 10px; /* even tighter */
    -webkit-overflow-scrolling: touch; /* Smooth scroll for iOS */
    touch-action: pan-y; /* Ensure vertical touch works */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--shop-accent) #f5f5f5; /* Firefox */
}

/* Premium Scrollbar for Sidebar */
.drawer-content::-webkit-scrollbar {
    width: 3px;
}

.drawer-content::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.drawer-content::-webkit-scrollbar-thumb {
    background: var(--shop-accent);
    border-radius: 10px;
}

.drawer-content::-webkit-scrollbar-thumb:hover {
    background: #1E1E1E;
}

.filter-section {
    margin-bottom: 45px;
}

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

.filter-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 25px;
    color: var(--shop-text);
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    cursor: pointer;
    color: var(--shop-text-muted);
    transition: color 0.3s;
}

.filter-checkbox:hover {
    color: var(--shop-text);
}

.filter-checkbox input {
    accent-color: var(--shop-accent);
}

.filter-colors {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: transform 0.3s var(--ease-out-expo);
}

.color-swatch:hover {
    transform: scale(1.1);
}

/* Size Filter */
.filter-sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.size-box {
    width: 45px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    background: none;
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--shop-text);
    cursor: pointer;
    transition: all 0.3s;
}

.size-box:hover,
.size-box.active {
    border-color: var(--shop-accent);
    color: var(--shop-accent);
}

.drawer-footer {
    padding: 20px 30px;
    border-top: 1px solid #f5f5f5;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    background: #fff; /* Solid background for stickiness */
    position: sticky;
    bottom: 0;
    z-index: 10;
    flex-shrink: 0;
}

.drawer-footer .btn {
    padding: 12px 15px;
    font-size: 11px;
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 2999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    will-change: opacity;
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* --- Collection Hero --- */
.collection-hero {
    position: relative;
    height: 350px; /* "enough" height for a signature title area */
    display: flex;
    align-items: center;
    overflow: hidden;
    margin-top: 80px; /* Space for navbar */
    margin-bottom: 0;
    color: #fff;
    text-align: center;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-bg .overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.hero-content {
    position: relative;
    z-index: 10;
    width: 100%;
}

.collection-hero .shop-title {
    color: #fff;
}

.collection-hero .shop-category-tag {
    color: var(--shop-accent);
}

/* --- Product Grid --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 15px;
    margin-top: 30px;
}

/* --- Product Card --- */
.product-card {
    position: relative;
    cursor: pointer;
}

.product-img {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: #f4f4f4;
    margin-bottom: 25px;
}

.product-link-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s var(--ease-out-expo);
}

.product-img-hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition:
        opacity 0.8s var(--ease-out-expo),
        transform 1.2s var(--ease-out-expo);
}

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

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

/* --- Product Commerce Actions --- */
/* --- Product Commerce Actions --- */
.product-actions {
    display: none; /* Removed on desktop per request */
    flex-direction: column;
    gap: 10px;
    z-index: 5;
    flex: 1;
}

.action-btn {
    width: 100%;
    padding: 11px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add-to-cart {
    background: #1f3142;
    color: #f6f4f1;
    border: 1px solid #1f3142;
}

.btn-add-to-cart:hover {
    background: #cfb79e;
    color: #1f3142;
    border-color: #cfb79e;
}

.btn-buy-now {
    background: var(--shop-accent);
    color: #fff;
    padding: 8px 20px;
    font-size: 9px;
}

.btn-buy-now:hover {
    background: #cfb79e;
    color: #1f3142;
}

.wishlist-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.wishlist-btn svg {
    transition:
        fill 0.3s,
        stroke 0.3s;
}

.wishlist-btn:hover {
    transform: scale(1.1);
}

.wishlist-btn:hover svg {
    fill: #ff4d4d;
    stroke: #ff4d4d;
}

.wishlist-btn.wishlisted svg {
    fill: #ff4d4d;
    stroke: #ff4d4d;
}

.add-cart-icon {
    position: absolute;
    top: 70px; /* 20px top + 40px height + 10px spacing */
    right: 20px;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.add-cart-icon:hover {
    background: #1f3142;
    color: #f6f4f1;
    transform: scale(1.1);
}

.add-cart-icon svg {
    width: 18px;
    height: 18px;
}

/* Product Info */
.product-info {
    text-align: center;
}

.product-title {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--shop-text);
    min-height: 42px; /* Set a standard height for 1-2 lines to keep alignment */
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
}

.product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.product-title a:hover {
    color: #1E1E1E;
}

/* Product Card Sizes */
.product-sizes {
    position: absolute;
    /* Position above actions (100px bottom + 80px action height approx?) */
    /* actually actions is just buttons. */
    bottom: 150px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
    z-index: 6;
    pointer-events: none; /* Let clicks pass through if not interacting */
}

.product-card:hover .product-sizes {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.product-sizes span {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 4px 8px;
    color: var(--shop-text);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.product-sizes span:hover {
    border-color: #1f3142;
    color: #f6f4f1;
    background: #1f3142;
    
}

.product-price {
    font-size: 14px;
    color: var(--shop-text-muted);
    font-weight: 400;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: center; /* Centered on desktop */
    min-height: 45px;
    gap: 15px;
}

.product-footer .product-colors {
    display: flex;
    gap: 8px;
    flex-shrink: 0; /* Don't shrink swatches */
}

.product-footer .product-actions .action-btn {
    padding: 8px 15px; /* Slightly more compact for the inline look */
}

@media (max-width: 768px) {
    .product-footer .product-colors {
        gap: 12px;
        margin: 5px 0;
    }
    .product-footer .product-colors .swatch {
        width: 18px;
        height: 18px;
    }
}

.price-old {
    text-decoration: line-through;
    font-size: 12px;
    margin-right: 10px;
    opacity: 0.5;
}

/* Badge Styling */
.product-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 6px 12px;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 700;
    z-index: 2;
}

.badge-new {
    background: #fff;
    color: #1E1E1E;
}
.badge-sale {
    background: var(--shop-accent);
    color: #fff;
}

/* Utility Classes */
.w-100 {
    width: 100%;
}

/* Responsive Adjustments */
@media (max-width: 991px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px 20px;
    }
    .shop-title {
        font-size: 42px;
    }
    .filter-drawer {
        width: 320px;
        max-width: 85%;
        transform: translateX(-100%);
        left: 0;
    }
    .filter-drawer.active {
        transform: translateX(0);
    }
    .banner-title {
        font-size: 36px;
    }
}

@media (max-width: 768px) {
    .shop-section {
        padding-top: 20px;
    }
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px; /* Reduced from 30px 15px to match index.html */
    }
    .shop-toolbar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 10px;
    }
    .drawer-footer {
        grid-template-columns: 1fr 1fr;
        padding: 15px 20px 25px;
        gap: 10px;
    }
    .banner-wrapper {
        height: 350px;
    }
    .product-title {
        font-size: 16px;
        justify-content: unset;
    }
    .product-price {
        font-size: 12px;
    }

    /* Mobile Wishlist & Badge Resize */
    /* Mobile Wishlist & Cart Icon */
    .wishlist-btn {
        width: 28px;
        height: 28px;
        top: 8px;
        right: 8px;
    }

    .add-cart-icon {
        width: 28px;
        height: 28px;
        top: 42px; /* 8px top + 28px height + 6px spacing */
        right: 8px;
    }

    .wishlist-btn svg,
    .add-cart-icon svg {
        width: 14px;
        height: 14px;
    }

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

    /* Mobile: Stacked Layout (Image -> Info -> Sizes -> Button) */

    .product-card {
        display: flex;
        flex-direction: column;
        padding-bottom: 0;
        position: relative;
    }

    /* 1. Image Wrapper (Top) */
    .product-img {
        order: 1;
        display: block; /* Restore block context */
        width: 100%;
        margin-bottom: 0;
        overflow: hidden; /* Keep images contained */
        /* Maintain existing aspect ratio from desktop or redefine if needed */
    }

    /* Icons & Badge stay on top of image area */
    .product-badge,
    .wishlist-btn,
    .add-cart-icon {
        order: 1;
        z-index: 10;
        /* Position is relative to .product-card now */
    }

    /* Fix Icon Positions for Card Context */
    .product-badge {
        top: 10px;
        left: 10px;
    }
    .wishlist-btn {
        top: 10px;
        right: 10px;
    }
    .add-cart-icon {
        top: 50px;
        right: 10px;
    }

    /* 2. Product Info */
    .product-info {
        order: 2;
        margin-top: 15px;
        margin-bottom: 15px;
        z-index: 1;
    }

    /* 3. Sizes (Below Info) */
    .product-sizes {
        order: 3;
        position: static; /* No longer absolute */
        opacity: 1;
        transform: none;
        width: 100%;
        margin-bottom: 12px;
        pointer-events: auto;
        justify-content: center;
        display: flex;
        gap: 6px;
    }

    /* 4. Action Button (Bottom) */
    .product-actions {
        order: 4;
        position: static; /* No longer absolute */
        opacity: 1;
        transform: none;
        width: 100%;
        margin: 0;
        padding: 0;
        display: block;
    }

    /* Styling Updates for Stacked Look */
    .product-footer {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        min-height: auto;
    }

    .product-footer .product-actions {
        display: block; /* Show on mobile */
        opacity: 1;
        transform: none;
        width: 100%;
    }

    .action-btn {
        width: 100%;
        background: #1f3142;
        color: #f6f4f1;
        border-radius: 0;
        padding: 12px 0;
        font-size: 11px;
        font-weight: 600;
        border: none;
        letter-spacing: 0.1em;
    }

    .product-sizes span {
        background: transparent;
        border: 1px solid #e0e0e0;
        color: #1E1E1E;
        box-shadow: none;
        font-size: 10px;
        min-width: 28px;
        height: 28px;
        line-height: 26px; /* Center text vertically */
        padding: 0;
        text-align: center;
        border-radius: 2px;
    }
}

/* --- FAVORITES PAGE STYLES --- */
.favorites-page main {
    padding-top: 160px;
    background: #fff;
    min-height: 80vh;
}

.favorites-header {
    text-align: center;
    margin-bottom: 60px;
}

.favorites-header .subtitle {
    display: block;
    font-size: 14px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--shop-text-muted);
    margin-bottom: 15px;
}

.favorites-header .title {
    font-size: 42px;
    font-family: var(--font-serif);
    font-weight: 400;
}

.favorites-grid-wrapper {
    margin-bottom: 100px;
}

/* Filled Heart for Favorites Page */
.favorites-page .wishlist-btn {
    background: #ff4d4d;
    color: #fff;
}

.favorites-page .wishlist-btn svg {
    fill: #fff;
    stroke: #fff;
}

.favorites-page .wishlist-btn:hover {
    background: #e03e3e;
    transform: scale(1.1);
}

/* Empty State */
.favorites-empty {
    text-align: center;
    padding: 100px 0;
    max-width: 500px;
    margin: 0 auto;
}

.favorites-empty-icon {
    margin-bottom: 30px;
    color: #f0f0f0;
}

.favorites-empty h3 {
    font-family: var(--font-serif);
    font-size: 28px;
    margin-bottom: 15px;
    font-weight: 400;
}

.favorites-empty p {
    color: var(--shop-text-muted);
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Favorites Page Responsive */
@media (max-width: 768px) {
    .favorites-page main {
        padding-top: 100px;
    }

    .favorites-header .title {
        font-size: 32px;
    }

    .favorites-header {
        margin-bottom: 40px;
    }
}
