/* =========================================
   TABLET OPTIMIZATION (min-width: 600px)
   Keeps the "Vertical App" feel but prevents
   elements from stretching too wide.
   ========================================= */
@media screen and (min-width: 600px) {
    
    /* Center the main content column to mimic a mobile app on tablet */
    .main-container, 
    .checkout-container, 
    .entry-grid {
        max-width: 540px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Keep the navbar contents centered within the "app" width */
    .navbar {
        display: flex;
        justify-content: center;
    }
    .navbar > div {
        width: 100%;
        max-width: 540px;
        display: flex;
        justify-content: space-between;
    }
    
    /* Ensure floating bottom elements stay centered and don't stretch */
    .resume-bar,
    .checkout-pill,
    .cta,
    .post-actions-container {
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 100% !important;
        max-width: 400px !important;
        bottom: 30px !important;
    }
    
    /* Animation states for floating elements override */
    .resume-bar.show { transform: translate(-50%, 0) !important; }
    .cta.show { transform: translate(-50%, 0) !important; }
    
    /* Fix Modal widths on tablet */
    .modal-card, 
    .upsell-modal-card {
        max-width: 400px !important;
    }
}

/* =========================================
   DESKTOP OVERHAUL (min-width: 1025px)
   Transforms the layout into a premium web experience.
   ========================================= */
@media screen and (min-width: 1025px) {

    /* --- GLOBAL LAYOUT --- */
    body {
        background-color: #fcfcfc; /* Cleaner desktop background */
    }

    /* 1. HERO BANNER: Full Screen Impact */
    .hero {
        height: 85vh !important; /* Fill most of the screen */
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;
        margin-top: -64px; /* Pull up behind transparent nav if needed */
    }
    
    .hero img {
        object-position: 50% 30%; /* Focus on model's face/jewelry */
    }

    .hero-text {
        left: 80px !important;
        bottom: 80px !important;
    }

    .hero-text h1 {
        font-size: 64px !important;
        margin-bottom: 16px !important;
    }

    .hero-text p {
        font-size: 18px !important;
        opacity: 0.9;
    }

    /* --- 2. HOME GRID (Cards) --- */
    .entry-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr); /* 3 Columns */
        gap: 32px !important;
        max-width: 1200px !important; /* Wide container */
        padding: 60px 40px !important;
        margin-top: 0 !important;
    }

    /* Standard Vertical Cards (Bracelet, Earring, Combo) */
    .entry-card {
        max-width: 100% !important; /* Reset tablet constraint */
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 24px !important;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .entry-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    }

    /* Reduce image size slightly so CTA is visible */
    .card-image {
        aspect-ratio: 1 / 1 !important; /* Square instead of portrait */
        margin-bottom: 20px !important;
    }

    /* --- 3. CURATED CARD: Wide Banner Style --- */
    .entry-card.curated-card {
        grid-column: 1 / -1; /* Span all 3 columns */
        display: grid;
        grid-template-columns: 1.2fr 1fr; /* Image on left, text on right */
        grid-template-rows: auto auto auto;
        align-content: center;
        height: 420px; /* Fixed height banner */
        padding: 0 !important;
        overflow: hidden;
        background: #000; /* Distinctive background */
        color: #fff;
    }

    /* Re-target elements inside Curated Card */
    .curated-card .card-image {
        grid-row: 1 / span 4;
        width: 100%;
        height: 100%;
        margin: 0 !important;
        border-radius: 0 !important;
        aspect-ratio: auto !important;
    }
    
    .curated-card h2 {
        grid-column: 2;
        align-self: end;
        font-size: 36px !important;
        margin: 0 0 12px 40px !important;
        color: #fff !important;
    }

    .curated-card p {
        grid-column: 2;
        font-size: 16px !important;
        margin: 0 0 24px 40px !important;
        max-width: 400px;
        color: #ccc !important;
    }

    .curated-card button {
        grid-column: 2;
        align-self: start;
        margin-left: 40px !important;
        background: #fff !important;
        color: #000 !important;
        border: none !important;
        width: fit-content;
    }

    /* --- 4. CURATED BROWSE PAGE --- */
    .product-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important; /* 4 items per row */
        gap: 24px !important;
        max-width: 1200px !important;
        padding: 40px !important;
    }

    .prod-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    }

    /* --- 5. PDP & COUPON DRAWERS (Floating Modals) --- */
    
    /* Common "Floating" Style */
    .pdp-drawer, .coupon-drawer {
        position: fixed !important;
        left: 50% !important;
        top: 50% !important;
        bottom: auto !important;
        border-radius: 24px !important;
        box-shadow: 0 20px 80px rgba(0,0,0,0.3) !important;
        /* Animation: Slide up and fade in */
        transform: translate(-50%, -40%) !important; 
        opacity: 0;
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    /* Active State for Center Float */
    .pdp-drawer.active, .coupon-drawer.active {
        transform: translate(-50%, -50%) !important;
        opacity: 1;
    }

    /* Specific: PDP Drawer (Wide Landscape Layout) */
    .pdp-drawer {
        width: 900px !important;
        height: 600px !important;
        flex-direction: row !important;
        overflow: hidden;
    }
    
    .pdp-scroll-content {
        display: flex !important;
        flex-direction: row !important;
        width: 100%;
        height: 100%;
        overflow: hidden !important;
    }

    .pdp-image-container {
        width: 50% !important;
        height: 100% !important;
    }

    .pdp-details {
        width: 50% !important;
        padding: 40px !important;
        overflow-y: auto;
        padding-bottom: 100px !important; /* Space for button */
    }

    .pdp-action-bar {
        position: absolute;
        bottom: 0; right: 0; width: 50%;
        padding: 24px 40px !important;
        background: linear-gradient(to top, #fff 80%, rgba(255,255,255,0)) !important;
        border-top: none !important;
    }

    /* Specific: Coupon Drawer (Vertical Modal) */
    .coupon-drawer {
        width: 420px !important;
        height: auto !important;
        max-height: 80vh !important;
        display: flex;
        flex-direction: column;
    }

    /* --- 6. RESUME BAR (Centered Floating Pill) --- */
    .resume-bar {
        width: 420px !important;
        bottom: 40px !important;
        border-radius: 999px !important;
        /* Start hidden below */
        transform: translate(-50%, 150%) !important;
    }
    .resume-bar.show {
        transform: translate(-50%, 0) !important;
    }

    /* --- 7. CART PAGE TWEAKS --- */
    .cart-page {
        max-width: 800px !important;
        margin: 40px auto !important;
        border-radius: 24px;
        box-shadow: 0 4px 24px rgba(0,0,0,0.04);
        padding: 40px !important;
    }
    
    .checkout-pill {
        /* On desktop, this button is moved via desktop.js, 
           but if JS fails, ensure it floats centered */
        position: fixed;
        width: 300px !important;
    }

    /* --- 8. BUILDER / CANVAS --- */
    /* Ensure the builder canvas doesn't look tiny on a huge screen */
    .builder-surface {
        transform: scale(1.1);
        margin-top: 60px !important;
        margin-bottom: 40px !important;
    }
}
/* =========================================
   QR CODE MODAL (For Desktop WhatsApp)
   Required by Desktop.js
   ========================================= */
.qr-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.qr-card {
    background: #fff;
    padding: 40px;
    border-radius: 24px;
    text-align: center;
    width: 380px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.qr-title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 800;
}

.qr-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
    line-height: 1.5;
}

.qr-image {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    border: 1px solid #eee;
    padding: 10px;
}

.qr-close-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f0f0f0;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #555;
    transition: background 0.2s;
}

.qr-close-icon:hover {
    background: #e0e0e0;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
