/* =========================================================================
   CRYSTAL SHOWROOM - MOBILE EXCELLENCE STYLES
   =========================================================================
   This file overrides styles.css exclusively for mobile and tablet devices.
   Breakpoints:
   - Max 1024px: Tablet Portrait / Small Laptops
   - Max 768px: Mobile Phones & Phablets
   - Max 480px: Small Mobile Phones
========================================================================= */

/* General Box Model & HTML Defaults */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Hide mobile-only elements by default (shown inside mobile media query) */
.mobile-explore-section {
    display: none;
}


/* -------------------------------------------------------------
   TABLET & MOBILE (<= 1024px)
------------------------------------------------------------- */
@media (max-width: 1024px) {

    /* Show mobile search icon on smaller screens */
    .mobile-search-btn {
        display: flex !important;
    }

    /* Adjust grid columns generally */
    .popular-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* -------------------------------------------------------------
   MOBILE DEVICES (<= 768px)
------------------------------------------------------------- */
@media (max-width: 768px) {

    /* 1. TYPOGRAPHY & SPACING */
    :root {
        --spacing-md: 0.8rem;
        --spacing-lg: 1.5rem;
    }

    body {
        font-size: 13px;
        /* Much smaller body text */
        padding-top: 55px;
        /* Reduced header height */
    }

    .container {
        padding: 0 5px !important; /* Reduced mobile margins as requested */
    }

    h1 {
        font-size: 1.8rem !important;
    }

    h2 {
        font-size: 1.4rem !important;
    }

    /* 2. HEADER & NAVIGATION */
    header {
        padding: 5px 0;
    }

    .logo {
        font-size: 0.8rem !important; /* Noticeably smaller 'Crystal' logo text */
    }

    .logo i {
        font-size: 0.75rem !important; /* Noticeably smaller logo icon */
    }

    .logo-name span {
        font-size: 0.55rem !important;
        letter-spacing: 2.5px !important;
    }

    .icon-buttons button {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .cart-badge {
        font-size: 0.5rem !important;
        min-width: 14px !important;
        height: 14px !important;
        border-width: 1.5px !important;
        top: -1px !important;
        right: -1px !important;
        padding: 0 !important;
    }

    /* Mobile Search Overhaul */
    .mobile-search-btn {
        display: flex !important;
    }

    /* Ensure Cart icon is visible on mobile */
    button[aria-label="Cart"] {
        display: flex !important;
    }

    .search-bar {
        display: none !important;
    }

    .search-bar.active-mobile {
        display: flex !important;
        position: fixed;
        top: 55px;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        padding: 8px 5%;
        /* Add space on sides */
        z-index: 1000;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
        /* Fainter shadow */
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        /* Fainter border */
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        justify-content: center;
        /* Center the reduced width box */
        animation: slideDown 0.3s ease-out;
    }

    .search-bar.active-mobile input {
        width: 100% !important;
        /* Full width of its padded container (effectively 90% of screen) */
        background: transparent;
        /* Unified exact same color as container */
        border: 1px solid rgba(0, 0, 0, 0.08);
        /* Fainter border */
        border-radius: 20px;
        padding: 8px 35px 8px 15px;
        /* Right padding to make room for icon */
        font-size: 0.9rem;
    }

    .search-bar.active-mobile i {
        display: flex !important;
        position: absolute;
        right: calc(5% + 12px) !important;
        /* Position inside the 90% input box */
        top: 50%;
        transform: translateY(-50%);
        color: #6b5d50;
        z-index: 1001;
    }

    @keyframes slideDown {
        from {
            transform: translateY(-100%);
            opacity: 0;
        }

        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    @keyframes slideUp {
        from {
            transform: translateY(0);
            opacity: 1;
        }

        to {
            transform: translateY(-100%);
            opacity: 0;
        }
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .search-bar.closing-mobile {
        animation: slideUp 0.3s ease-in forwards !important;
    }

    /* 2.1 SEARCH RESULTS GRID (Vertical Single-col) */
    .search-results-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        /* Single column as requested */
        gap: 25px !important;
        padding: 15px 0 !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    .search-results-grid .product-card {
        width: 100% !important;
        flex: none !important;
        margin: 0 !important;
        background: #fff;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    }

    .search-results-grid .product-image {
        height: 300px !important;
        /* Restored previous size as requested */
        width: 100% !important;
    }

    .search-results-grid .product-name {
        font-size: 0.85rem !important;
    }

    .search-results-grid .product-price {
        font-size: 0.75rem !important;
    }

    /* 2.1 NAVIGATION & MENU (Hamburger) */
    .search-results-header {
        margin-top: 2px !important;
        /* Extremely minimal top margin */
        margin-bottom: 0.2rem !important;
        /* Extremely minimal bottom margin */
        padding-bottom: 0.2rem !important;
        /* Minimal padding */
        line-height: normal !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    }

    #search-results-container {
        padding-top: 0 !important;
        padding-bottom: 0.4rem !important;
    }

    .search-results-title,
    .search-similar-title {
        font-size: 0.75rem !important;
        /* Refined smaller size that remains readable */
    }

    #clear-search-btn.btn-return {
        font-family: var(--font-heading) !important;
        font-size: 0.72rem !important;
        /* Better for non-caps text */
        font-weight: 500 !important;
        padding: 4px 15px !important;
        /* Slightly wider for elegant oval */
        border-radius: 40px !important;
        /* Smooth oval shape */
        line-height: normal;
        min-width: 65px !important;
        width: auto !important;
        height: auto !important;
        text-transform: none !important;
        /* Not all caps anymore */
        letter-spacing: 0.2px;
        transform: scale(0.9);
        transform-origin: right center;
    }

    .nav-links {
        display: none;
    }

    button[aria-label="Menu"] {
        display: flex;
    }

    .nav-links.active {
        display: flex;
        position: fixed;
        top: 55px;
        left: 0;
        width: 100%;
        height: calc(100vh - 55px);
        background: rgba(252, 250, 247, 0.98);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 2rem;
        gap: 1.5rem;
        z-index: 999;
        border-top: 1px solid var(--border-light);
    }

    .nav-links.active a {
        font-size: 0.85rem;
        font-weight: 300; /* Thinner for a more premium look */
        letter-spacing: 3px; /* Sharper defined appearance */
        text-transform: uppercase;
        color: var(--primary-color);
        transition: color 0.3s ease;
    }

    /* 3. PREMIUM MOBILE HERO (Poster Style) */

    /* Remove body padding so the hero content goes behind the header */
    .index-page body,
    body.index-page {
        padding-top: 0 !important;
    }

    /* Transparent header â€” active class added by JS while hero is visible */
    .index-page header.header--transparent {
        background-color: transparent !important;
        border-bottom-color: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: none !important;
        transition: background-color 0.35s ease, border-color 0.35s ease !important;
    }

    /* Gold text/icons when header is transparent over the dark hero
       â€” but NOT inside the open nav menu (which has a white background) */
    .index-page header.header--transparent .logo,
    .index-page header.header--transparent .icon-buttons button,
    .index-page header.header--transparent .icon-buttons button i {
        color: #eec662 !important;
    }

    /* Smooth transition back to solid */
    .index-page header {
        transition: background-color 0.35s ease, border-color 0.35s ease;
    }

    .index-page .hero {
        background: url('../images/nigerian_luxury_interior_hero.png');
        background-size: cover;
        background-position: center;
        min-height: 85vh;
        /* Near full-screen impact */
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        border-bottom: none;
        padding-top: 55px;
        /* Make room for the transparent header */
    }

    /* Darker immersive overlay */
    .index-page .hero::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(to bottom,
                rgba(0, 0, 0, 0.3) 0%,
                rgba(0, 0, 0, 0.5) 40%,
                rgba(0, 0, 0, 0.8) 100%);
        z-index: 1;
    }

    .index-page .hero-container {
        flex-direction: column;
        justify-content: center;
        min-height: auto;
        padding: 0 20px;
        z-index: 2;
        width: 100%;
        text-align: center;
    }

    .index-page .hero-content {
        padding: 0;
        align-items: center;
        width: 100%;
    }

    .index-page .hero-content h1 {
        font-family: 'Playfair Display', serif !important;
        font-size: 2.4rem !important;
        color: #ffffff !important;
        line-height: 1.2;
        margin-bottom: 15px;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }

    .index-page .hero-content p {
        font-size: 0.9rem !important;
        color: rgba(255, 255, 255, 0.9) !important;
        max-width: 280px;
        margin: 0 auto 25px;
        line-height: 1.5;
    }

    .index-page .hero-btn {
        display: inline-block;
        padding: 12px 30px;
        background-color: var(--accent-gold);
        color: #fff;
        text-decoration: none;
        border-radius: 50px;
        font-weight: 600;
        letter-spacing: 1px;
        font-size: 0.9rem;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
        animation: fadeIn 0.8s ease-out 0.3s backwards;
    }

    .index-page .hero-image {
        display: none !important;
        /* Hide original stacked image */
    }

    /* 4. MOBILE EXPLORE GRID â€” Instagram-style unified feed */

    /* Hide old desktop sections on mobile */
    .index-page .desktop-only-section {
        display: none !important;
    }

    /* Show mobile explore section */
    .index-page .mobile-explore-section {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Section header: title + view all link */
    .index-page .mobile-explore-header {
        grid-column: 1 / -1;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 14px 14px 10px 14px !important;
        background-color: #fff !important;
        z-index: 10;
    }

    .index-page .mobile-explore-header span {
        font-family: 'Playfair Display', serif !important;
        font-size: 0.78rem !important;
        font-weight: 700 !important;
        color: var(--gold, #c5a059) !important;
        letter-spacing: -0.01em !important;
    }

    /* Darken Footer in mobile */
    footer {
        background-color: #ededed !important; /* Slightly darker than default #f9f9f9 */
    }

    .index-page .mobile-explore-header a {
        display: none !important; /* Hidden in header now */
    }

    .mobile-view-all-bottom {
        padding: 20px 14px !important;
        text-align: left !important;
    }

    .mobile-view-all-bottom a {
        font-family: 'Outfit', sans-serif !important;
        font-size: 0.82rem !important; /* Slightly larger for easier tap */
        font-weight: 500 !important;
        color: var(--gold, #c5a059) !important;
        text-decoration: none !important;
        letter-spacing: 0.02em !important;
        text-transform: none !important; /* No longer all caps */
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    /* Merge Newsletter and Footer */
    .newsletter {
        margin-bottom: 0 !important;
    }

    footer {
        background-color: #ededed !important;
        border-top: none !important; /* Remove separating line */
        padding-top: 20px !important; /* Bring footer closer to newsletter */
    }

    .mobile-view-all-bottom a i {
        font-size: 0.65rem !important;
        transition: transform 0.3s ease !important;
    }

    .mobile-view-all-bottom a:active i {
        transform: translateX(5px) !important;
    }

    /* The Grid: 3 equal columns, 2px gap */
    .index-page .mobile-explore-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        grid-auto-flow: dense !important;
        grid-auto-rows: auto !important;
        gap: 2px !important;
        padding: 0 !important;
        margin: 0 !important;
        background-color: #fff !important;
    }

    /* Each grid item: square by default */
    .index-page .meg-item {
        position: relative !important;
        overflow: hidden !important;
        display: block;
        background: #f0ece8;
        /* Height = 1/3 of viewport width (square) */
        aspect-ratio: 1 / 1 !important;
        /* Touch press feedback */
        transition: transform 0.18s ease, filter 0.18s ease !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    .index-page .meg-item:hover,
    .index-page .meg-item:active {
        transform: scale(0.96) !important;
        filter: brightness(1.08) !important;
    }

    /* Tall item: spans 2 rows (left-side featured) */
    .index-page .meg-item.meg-tall {
        grid-row: span 2 !important;
        aspect-ratio: auto !important;
    }

    /* When tall is on the RIGHT, use order trick */
    .index-page .meg-item.meg-right-tall {
        grid-column: 3 !important;
        grid-row: span 2 !important;
    }

    /* When tall is in the MIDDLE */
    .index-page .meg-item.meg-middle-tall {
        grid-column: 2 !important;
        grid-row: span 2 !important;
        aspect-ratio: auto !important;
    }

    .index-page .meg-item img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
        transition: transform 0.3s ease !important;
    }

    /* Subtle label pill at the bottom of each tile */
    .index-page .meg-label {
        position: absolute !important;
        bottom: 7px !important;
        left: 7px !important;
        background: rgba(255, 255, 255, 0.88) !important;
        color: #1a1108 !important;
        font-family: 'Outfit', sans-serif !important;
        font-size: 0.5rem !important;
        /* Smaller text as requested */
        font-weight: 700 !important;
        letter-spacing: 0.02em !important;
        text-transform: capitalize !important;
        padding: 3px 8px !important;
        border-radius: 20px !important;
        line-height: 1.3 !important;
        pointer-events: none !important;
        backdrop-filter: blur(4px) !important;
        -webkit-backdrop-filter: blur(4px) !important;
    }

    /* 5. NEWSLETTER — Smaller font sizes on mobile */
    .newsletter-content h2 {
        font-size: 1.3rem !important;
        line-height: 1.3 !important;
    }

    .newsletter-content p {
        font-size: 0.78rem !important;
        line-height: 1.6 !important;
        margin-bottom: 1.2rem !important;
    }

    .newsletter-form {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 280px !important;
        /* Reduced max-width for compact feel */
        margin: 0 auto !important;
    }

    .newsletter-form input,
    .newsletter-form input::placeholder {
        color: grey !important;
    }

    .newsletter-form input {
        font-size: 0.75rem !important;
        padding: 8px 14px !important;
        /* Reduced padding */
        width: 60% !important;
        flex: 1 1 auto !important;
    }

    .newsletter-form button {
        font-size: 0.72rem !important;
        padding: 8px 15px !important;
        /* Reduced padding */
        width: auto !important;
        flex: 0 0 auto !important;
    }

    /* Collections Page: Uniform Frames & Reduced Spacing */

    .collection-section {
        padding: 10px 0 !important;
        /* Reduced vertical space */
        border-bottom: none !important;
    }

    .page-hero h1 {
        font-size: 1.4rem !important; /* Noticeably smaller hero title */
    }

    .page-hero p {
        font-size: 0.78rem !important; /* Smaller hero description */
        line-height: 1.4 !important;
        max-width: 280px;
        margin: 0 auto !important;
    }

    .collection-title {
        margin-bottom: 20px !important;
        font-size: 0.95rem !important; /* Significantly reduced carousel title */
        letter-spacing: 0.5px !important;
    }

    .collection-title::after {
        height: 2px !important; /* Thinner underline */
        width: 35px !important; /* Shorter underline */
        bottom: -6px !important;
    }

    .collection-grid .product-image {
        aspect-ratio: 1 / 1.2 !important;
        /* STRICT Uniform Frame Size */
        height: auto !important;
        background: #f5f5f5 !important;
    }

    .collection-grid .product-card {
        background: transparent !important;
        box-shadow: none !important;
    }

    /* Mobile image tap animations (like desktop hover) */
    .product-image img,
    .category-card img,
    .about-item img {
        transition: transform 0.3s ease !important;
    }

    .product-card:active .product-image img,
    .category-card:active img,
    .about-item:active img {
        transform: scale(1.05) !important;
    }

    /* Instagram-Style Pill Labels (Homepage Only) */
    .index-page .product-label {
        position: absolute !important;
        bottom: 8px !important;
        left: 8px !important;
        right: auto !important;
        width: auto !important;
        background: rgba(255, 255, 255, 0.9) !important;
        padding: 4px 10px !important;
        border-radius: 20px !important;
        transform: none !important;
        text-align: left !important;
        border: none !important;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
        z-index: 5;
    }

    .index-page .product-label h3 {
        font-family: 'Outfit', sans-serif !important;
        font-size: 0.6rem !important;
        color: #000 !important;
        margin: 0 !important;
        font-weight: 600;
        text-transform: capitalize;
    }

    /* --- TRUE DESKTOP-STYLE PRODUCT LABELS (Centered Pill, Smaller) --- */
    .collection-grid .product-label,
    .modal-grid .product-label {
        position: absolute !important;
        bottom: 12px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 2px !important;
        padding: 5px 15px !important;
        background-color: var(--white) !important;
        border-radius: 30px !important;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
        opacity: 1 !important;
        /* Always visible on mobile */
        white-space: nowrap !important;
        max-width: 92% !important;
        z-index: 5;
        border: none !important;
    }

    .collection-grid .product-name,
    .modal-grid .product-name {
        font-family: var(--font-body) !important;
        font-size: 0.72rem !important;
        font-weight: 600 !important;
        color: var(--primary-color) !important;
        display: block !important;
    }

    .collection-grid .product-price,
    .modal-grid .product-price {
        font-family: var(--font-body) !important;
        font-size: 0.6rem !important;
        color: var(--light-text) !important;
        font-weight: 500 !important;
        display: block !important;
    }

    /* Product Action Icons (Top Right) */
    .product-actions {
        position: absolute;
        top: 8px;
        right: 8px;
        display: flex;
        gap: 6px;
        z-index: 5;
        opacity: 1 !important;
        /* Always visible on mobile per IG style */
    }

    .product-actions button {
        width: 26px !important;
        height: 26px !important;
        min-height: auto !important;
        background: rgba(255, 255, 255, 0.8) !important;
        border-radius: 50% !important;
        border: none !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: #000 !important;
        font-size: 0.7rem !important;
    }

    .section-title {
        font-family: 'Playfair Display', serif !important;
        font-size: 1.1rem !important;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin: 20px 0 10px !important;
        text-align: center !important;
        color: #000;
    }

    .view-all-container {
        margin: 15px 0 !important;
    }

    .btn-outline {
        border-radius: 20px !important;
        font-size: 0.7rem !important;
        padding: 5px 20px !important;
        background: #fff !important;
        border: 1px solid #ddd !important;
        color: #666 !important;
    }

    /* Override about us grid for the specific 1+4 look */
    .about-grid {
        grid-auto-rows: calc(33.33vw - 2px) !important;
    }

    .about-item.crafts,
    .about-item.stores {
        display: block !important;
        /* Ensure they show in 3-col */
    }

    /* Shrink product label opacity fix */
    .collection-grid .product-label,
    .modal-grid .product-label {
        opacity: 1 !important;
    }

    .index-page .product-label {
        background: transparent !important;
        background-image: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent) !important;
        bottom: 0;
        padding-bottom: 8px;
    }

    .index-page .product-label h3 {
        font-size: 0.72rem;
        /* Reduced font size as requested */
        /* Much smaller product title on index */
    }

    .index-page .product-label span {
        font-size: 0.6rem;
    }

    /* Hide the 'Hover overlays' like "click-to-view" since taps are natural */
    .hover-overlay,
    .click-to-view {
        display: none !important;
    }

    /* Product details display */
    .product-details-hover {
        position: absolute !important;
        opacity: 1 !important;
        transform: none !important;
        top: 8px !important;
        left: 8px !important;
        background: rgba(26, 26, 26, 0.85) !important;
        backdrop-filter: blur(4px) !important;
        -webkit-backdrop-filter: blur(4px) !important;
        padding: 8px 10px !important;
        border-radius: 6px !important;
        font-size: 0.72rem !important;
        line-height: 1.4 !important;
        text-align: left !important;
        color: var(--white) !important;
        max-width: calc(100% - 16px) !important;
    }

    .product-details-hover p {
        margin-bottom: 3px !important;
    }

    .product-card {
        height: auto;
    }

    /* 6. MODALS & OVERLAYS */
    .modal-title {
        font-size: 1.15rem !important;
    }

    .modal-content {
        width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        top: 0 !important;
        transform: none !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .modal-header {
        /* Extra-generous drop to ensure nothing covers the title on any phone */
        padding-top: calc(env(safe-area-inset-top, 20px) + 60px) !important;
        padding-bottom: 12px !important;
    }

    .modal-close {
        font-size: 1.5rem !important; /* Smaller close icon for mobile */
    }

    .modal-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        padding: 5px !important;
    }

    .modal-body {
        padding: 15px 5px !important;
    }

    .modal-item.product-card {
        height: 300px !important;
    }

    .modal-item .product-label {
        font-size: 0.65rem !important;
        padding: 4px 8px !important;
        bottom: 18px !important;
    }



    /* Global button refinement for mobile - More Aggressive */
    .btn-luxury,
    .btn-checkout,
    .proceed-payment-btn,
    .luxury-form .btn {
        width: 100% !important;
        font-size: 0.82rem !important; /* Aggressively smaller text */
        min-height: 38px !important; /* Much shorter height */
        padding: 8px 12px !important;
        margin-top: 12px !important;
        letter-spacing: 1px !important; /* Less expansive spacing */
    }

    #checkout-selection-modal .small-modal {
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        margin: 0 !important;
        padding: 20px 15px !important; /* Tighter padding */
        border-radius: 0 !important;
        background-color: #1a1a1a !important; /* Consistent dark background */
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }

    #checkout-selection-modal .modal-title {
        font-size: 1.15rem !important; /* Aggressively smaller title */
        margin-bottom: 15px !important;
    }

    #checkout-selection-modal .selection-caption {
        font-size: 0.88rem !important; /* Refined caption size */
        line-height: 1.5 !important;
        margin-bottom: 25px !important;
        color: rgba(255, 255, 255, 0.8) !important;
    }

    #checkout-selection-modal .selection-buttons {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 15px !important;
        width: 100% !important;
    }

    #checkout-selection-modal .selection-buttons .btn {
        width: 100% !important;
        max-width: 300px !important;
        font-size: 0.9rem !important;
        min-height: 45px !important;
        padding: 12px !important;
        margin: 0 auto !important;
    }

    /* GLOBAL CHECKOUT BAR (Proceed to Checkout) */
    #global-checkout-bar {
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        padding: 3px 12px !important;
        border-radius: 0 !important;
        width: 100% !important;
    }

    /* Hide bar when the checkout options modal is open */
    #global-checkout-bar.hidden-by-modal {
        display: none !important;
    }

    /* PAYMENT LOADER (Mobile Optimization) */
    #payment-loader {
        padding: 20px !important;
        text-align: center !important;
    }

    #payment-loader .spinner {
        width: 40px !important;
        height: 40px !important;
        margin-bottom: 15px !important;
    }

    #payment-loader .loader-text {
        font-size: 0.8rem !important;
        letter-spacing: 1.5px !important;
        line-height: 1.6 !important;
        width: 90% !important;
        margin: 0 auto !important;
        color: #ffffff !important;
        /* Ensure visibility against dark cover */
    }

    /* 10. CHECKOUT / CART PAGE */
    .checkout-hero {
        padding: 30px 0 5px !important;
    }

    .checkout-hero h1 {
        font-size: 1.5rem !important;
        margin-bottom: 4px !important;
    }

    #cart-item-count {
        font-size: 0.75rem !important;
    }

    .checkout-container {
        padding: 20px 0 !important;
    }

    /* Cart item card â€” compact */
    .cart-item {
        grid-template-columns: 65px 1fr !important;
        gap: 10px !important;
        padding: 12px !important;
        margin-bottom: 10px !important;
    }

    .cart-item-image {
        width: 65px !important;
        height: 65px !important;
    }

    .cart-item-name {
        font-size: 0.8rem !important;
    }

    .cart-item-price {
        font-size: 0.75rem !important;
    }

    .cart-item-controls {
        grid-column: 1 / -1 !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .quantity-controls {
        padding: 2px 8px !important;
        gap: 8px !important;
    }

    .quantity-btn {
        width: 15px !important;
        height: 12px !important;
        font-size: 0.55rem !important;
    }

    .quantity-display {
        font-size: 0.7rem !important;
    }

    .item-subtotal {
        font-size: 0.85rem !important;
    }

    .remove-item {
        font-size: 0.6rem !important;
        margin-top: 15px !important;
    }

    /* Order summary panel */
    .order-summary {
        padding: 16px !important;
    }

    .order-summary h2,
    .cart-items-section h2 {
        font-size: 1rem !important;
        margin-bottom: 12px !important;
    }

    .summary-row {
        font-size: 0.8rem !important;
        margin-bottom: 8px !important;
    }

    .summary-row.total {
        font-size: 1rem !important;
        padding-top: 12px !important;
        margin-top: 12px !important;
    }

    .proceed-payment-btn {
        font-size: 0.8rem !important;
        padding: 10px !important;
        margin-top: 14px !important;
    }

    /* Continue Shopping & Clear Cart Button Mobile Refinements */
    .continue-shopping-btn,
    .clear-cart-btn {
        font-size: 0.7rem !important;
        padding: 10px 15px !important; /* Matches height of proceed button */
        letter-spacing: 0.5px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: auto !important;
    }

    /* Empty cart state */
    .empty-cart {
        padding: 40px 15px !important;
    }

    .empty-cart i {
        font-size: 3rem !important;
    }

    .empty-cart h2 {
        font-size: 1.2rem !important;
    }

    .empty-cart p {
        font-size: 0.8rem !important;
    }

    /* Order Confirmation / Success View */
    #checkout-success-view {
        padding-bottom: 40px !important;
    }

    #checkout-success-view>div {
        padding-top: 0 !important;
    }

    #checkout-success-view i.fa-circle-check {
        font-size: 3rem !important;
        margin-bottom: 10px !important;
    }

    #checkout-success-view h2 {
        font-size: 1.5rem !important;
        margin-bottom: 15px !important;
    }

    #checkout-success-view p {
        font-size: 0.85rem !important;
        line-height: 1.6 !important;
        margin-bottom: 25px !important;
        padding: 0 10px !important;
    }

    .tracking-id-display {
        font-size: 1.2rem !important;
        padding: 15px 35px !important;
        letter-spacing: 1px !important;
    }

    #checkout-success-view button[onclick="copyTrackingId()"] {
        padding: 5px !important;
        font-size: 0.6rem !important;
        right: 8px !important;
        border-radius: 4px !important;
    }

    #checkout-success-view .continue-shopping-btn {
        margin-top: 20px !important;
    }

    #global-cancel-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.8rem !important;
    }

    #global-checkout-btn {
        font-size: 0.7rem !important;
        padding: 5px 11px !important;
        min-height: 30px !important;
    }

    .cart-sidebar {
        width: 100% !important;
        right: -100% !important;
    }

    .cart-sidebar.open {
        right: 0 !important;
    }

    /* 7. CHECKOUT & FORMS & TOUCH TARGETS */
    input,
    select,
    textarea {
        font-size: 14px !important;
        padding: 8px 10px !important;
    }

    button,
    .btn {
        min-height: 38px !important;
        /* Smaller buttons */
        padding: 6px 14px !important;
        font-size: 0.85rem !important;
    }

    .checkout-grid {
        grid-template-columns: 1fr !important;
    }

    /* 8. ORDER TRACKING UI */
    .order-hero {
        padding: 30px 0 !important;
        min-height: auto !important;
    }

    .order-hero h1 {
        font-size: 1.6rem !important;
        margin-bottom: 15px !important;
    }

    .order-search-container {
        width: 80% !important;
        max-width: 250px !important;
        /* Forces the box to be much narrower */
        margin: 0 auto !important;
    }

    .order-search-form {
        flex-direction: column !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        gap: 10px !important;
    }

    .order-search-form input {
        border-radius: 50px !important;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05) !important;
        text-align: center !important;
        padding: 10px 20px !important;
        font-size: 0.9rem !important;
        height: 44px !important;
    }

    .order-search-form button {
        border-radius: 50px !important;
        width: 100% !important;
        padding: 10px !important;
        font-size: 0.9rem !important;
        min-height: 44px !important;
        background-color: var(--primary-color) !important;
        color: white !important;
        font-weight: 600 !important;
    }

    #order-result-container {
        padding: 20px 0 !important;
    }

    .order-detail-header {
        padding: 10px 15px !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        gap: 0 !important;
    }

    .order-detail-header>div:first-child {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
    }

    .order-detail-header>div:last-child {
        flex-direction: row !important;
        align-items: center !important;
        gap: 5px !important;
    }

    .order-detail-header h2 {
        font-size: 0.65rem !important;
        margin: 0 0 2px 0 !important;
        text-transform: uppercase !important;
    }

    /* Hide the payment type badge (the second span) on mobile */
    .order-detail-header>div:first-child .status-badge:nth-of-type(2) {
        display: none !important;
    }

    /* Status badge (first span) below tracking ID */
    .order-detail-header>div:first-child .status-badge:nth-of-type(1) {
        margin-left: 0 !important;
        font-size: 0.4rem !important;
        padding: 2px 4px !important;
    }

    .close-order-btn,
    #print-order-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.8rem !important;
        margin-left: 2px !important;
        background: none !important;
        border: none !important;
    }

    .status-badge {
        font-size: 0.45rem !important;
        padding: 2px 4px !important;
    }

    .order-detail-body {
        padding: 10px !important;
    }

    .info-grid {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
        margin-bottom: 8px !important;
        padding-bottom: 8px !important;
    }

    .info-group h4 {
        margin-bottom: 2px !important;
        font-size: 0.65rem !important;
        letter-spacing: 0px !important;
    }

    .info-group p,
    .info-group .status-badge {
        font-size: 0.75rem !important;
    }

    .info-group p i {
        font-size: 0.75rem !important;
        margin-right: 4px !important;
    }

    .tracking-items-list h3 {
        font-size: 0.6rem !important;
        margin-bottom: 8px !important;
    }

    .tracking-item-row {
        padding: 5px 0 !important;
    }

    .tracking-item-img {
        width: 35px !important;
        height: 35px !important;
        margin-right: 8px !important;
        border-radius: 4px !important;
    }

    .tracking-item-name {
        font-size: 0.7rem !important;
    }

    .tracking-item-price {
        font-size: 0.7rem !important;
    }

    .tracking-total {
        font-size: 1rem !important;
        margin-top: 10px !important;
    }

    .tracking-total span {
        font-size: 0.8rem !important;
        margin-right: 8px !important;
    }

    .order-enquiry-footer {
        margin-top: 15px !important;
        padding-top: 10px !important;
    }

    .order-enquiry-footer p {
        font-size: 0.65rem !important;
    }

    /* 9. GLOBAL FOOTER SIZING */
    footer {
        padding: 20px 0 0 0 !important;
        margin-top: 30px !important;
    }

    .footer-container {
        gap: 45px !important;
        margin: 0 !important;
        padding: 30px 15px 0 !important;
    }

    .footer-brand {
        flex: none !important;
        flex-basis: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 2px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .footer-brand .logo {
        justify-content: flex-start !important;
        /* Match header behavior (left aligned) */
        margin-bottom: 25px !important;
        width: fit-content;
    }

    .social-links {
        gap: 2px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .social-links p {
        font-size: 0.75rem !important;
        margin: 0 !important;
    }

    .social-icons {
        gap: 15px !important;
        margin: 0 !important;
        padding: 0 !important;
        justify-content: center;
    }

    .social-icons a {
        font-size: 0.9rem !important;
    }

    .footer-links {
        flex: none !important;
        flex-basis: auto !important;
        gap: 5px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .footer-column {
        flex: none !important;
        flex-basis: auto !important;
        gap: 2px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .footer-column h4 {
        font-size: 0.85rem !important;
        margin-top: 0 !important;
        margin-bottom: 5px !important;
    }

    .footer-column ul {
        gap: 2px !important;
    }

    .footer-column ul li a {
        font-size: 0.75rem !important;
    }

    .copyright {
        padding: 10px 0 !important;
        margin-top: 15px !important;
        border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
    }

    .copyright p {
        font-size: 0.65rem !important;
    }

    /* --- SYMMETRICAL MODAL FORM (Broad Mobile Coverage: 0-768px) --- */
    #customer-info-modal .luxury-form,
    #customer-info-modal .form-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 24px !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #customer-info-modal .form-group {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #customer-info-modal .form-group label {
        display: none !important;
    }

    #customer-info-modal .luxury-form input,
    #customer-info-modal .luxury-form textarea {
        font-size: 14px !important;
        padding: 12px 20px !important;
        height: auto !important;
        min-height: 52px !important;
        border-radius: 30px !important;
        width: 90% !important;
        min-width: 90% !important;
        max-width: 90% !important;
        margin: 0 auto !important;
        display: block !important;
        box-sizing: border-box !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        background: rgba(255, 255, 255, 0.05) !important;
        color: white !important;
    }

    #customer-info-modal .luxury-form textarea {
        min-height: 85px !important;
        resize: none !important;
        line-height: 1.5 !important;
        overflow: hidden !important;
    }

    /* Target each field explicitly for pixel-perfect width matching */
    #cust-name, #cust-email, #cust-phone, #cust-whatsapp, #cust-address, .luxury-form textarea {
        display: block !important;
        width: 90% !important;
        min-width: 90% !important;
        max-width: 90% !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }

    /* Standardized Button Width for Mobile */
    body .modal-content .btn-luxury,
    body .modal-content .proceed-payment-btn,
    body .modal-content .btn-checkout,
    body .modal-content .full-width {
        font-size: 12px !important;
        min-height: 48px !important;
        padding: 10px 20px !important;
        margin-top: 15px !important;
        letter-spacing: 1px !important;
        width: 90% !important;
        max-width: 280px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        display: block !important;
        border-radius: 30px !important;
    }

    /* --- GLOBAL MODAL REFINEMENTS (Exclude Selection Modal) --- */
    body .modal-overlay:not(#checkout-selection-modal) .modal-content.info-modal,
    body .modal-overlay:not(#checkout-selection-modal) .modal-content.small-modal {
        padding: 5px 12px 15px !important;
        background: transparent !important;
        width: 95% !important;
        max-width: 350px !important;
        height: auto !important;
        min-height: auto !important;
        max-height: 90vh !important;
        border-radius: 0 !important;
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* Transform selection modal into a bottom sheet drawer for all mobile views */
    #checkout-selection-modal.modal-overlay {
        display: flex !important;
        align-items: flex-end !important;
        justify-content: center !important;
        height: 100% !important;
        background-color: rgba(0, 0, 0, 0.6) !important;
    }

    #checkout-selection-modal .modal-content.small-modal {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important; /* Ensure it's not 100vh */
        min-height: auto !important;
        border-radius: 25px 25px 0 0 !important;
        background: rgba(28, 25, 23, 0.98) !important;
        backdrop-filter: blur(25px) !important;
        -webkit-backdrop-filter: blur(25px) !important;
        padding: 25px 20px 50px !important;
        border-top: 1px solid rgba(212, 175, 55, 0.4) !important;
        box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.5) !important;
        margin: 0 !important;
        z-index: 100001 !important;
    }

    #checkout-selection-modal .modal-title {
        text-align: center !important;
        color: #D4AF37 !important;
    }

    #checkout-selection-modal .selection-caption {
        margin-bottom: 25px !important;
        opacity: 0.9 !important;
        text-align: center !important;
    }
}

/* -------------------------------------------------------------
   SMALL MOBILE PHONES (<= 480px)
------------------------------------------------------------- */
@media (max-width: 480px) {

    .modal-grid {
        grid-template-columns: 1fr !important;
    }

    .collection-grid {
        gap: 8px !important; /* Reduced vertical space between items as requested */
    }

    .collection-grid>* {
        flex: 0 0 48% !important; /* Slightly increased from 42% for a better fit */
        /* Fits 2+ items comfortably on mobile */
    }

    /* --- SMALL MOBILE REFINEMENTS --- */

    body .modal-header {
        /* Extra-generous drop for small phones to clear notches/status bars */
        padding-top: calc(env(safe-area-inset-top, 20px) + 60px) !important;
        padding-bottom: 12px !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        position: relative !important;
    }

    body .modal-title {
        font-size: 15px !important; /* Highly refined title */
        margin-bottom: 10px !important;
        line-height: 1.1 !important;
        text-align: left !important; /* Properly left aligned as requested */
        padding-right: 35px !important; /* Leave room for the 'X' button */
    }

    body .modal-close {
        position: absolute !important;
        font-size: 22px !important;
        /* Balanced vertical alignment with the dropped header title */
        top: calc(env(safe-area-inset-top, 20px) + 40px) !important;
        right: 15px !important;
        z-index: 10;
    }

    body .selection-caption {
        font-size: 13px !important;
        margin-bottom: 20px !important;
        line-height: 1.4 !important;
        text-align: center !important;
        color: rgba(255, 255, 255, 0.8) !important;
    }
}