:root {
    --color-blush: #FFE5EC;
    --color-white: #FFFFFF;
    --color-offwhite: #FFF5F8;
    --color-gold: #FF3366;
    /* Mapped to Primary Pink */
    --color-gold-dark: #D41443;
    --color-charcoal: #1F1F1F;
    --color-hover-pink: #FFD6E0;
    --color-border: #FFD1DC;
}

/* CRITICAL: Prevent horizontal overflow on mobile */
html {
    overflow-x: hidden !important;
    width: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--color-charcoal);
    background-color: var(--color-offwhite);
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Playfair Display', serif;
}

::selection {
    background: var(--color-gold);
    color: white;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-gold);
}

/* ===================================
   Product Name & Price Font Override
   Helvetica Neue across ALL pages
   =================================== */

/* --- Product NAMES --- */
/* index.php slider cards */
.product-name,
h3.font-medium.text-gray-900,
.font-medium.text-gray-900.text-sm {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
}

/* shop.php product cards */
h3.font-serif.font-bold,
h3.font-serif.font-bold a {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
}

/* product.php detail page title */
h1.font-serif.font-bold.text-gray-900 {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
}

/* cart.php product names */
h4.font-bold.text-luxury-charcoal,
h4.font-bold.text-luxury-charcoal a {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
}

/* --- Product PRICES --- */
.product-price,
.text-luxury-charcoal.font-bold,
/* product.php main price */
#displayPrice,
/* shop.php card prices */
span.text-luxury-charcoal.font-bold,
span.font-bold.text-primary,
/* cart.php row total */
td.font-bold.text-luxury-charcoal {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
}

/* ===================================
   MOBILE RESPONSIVE FIXES
   Properly scoped to product grids only
   =================================== */
@media (max-width: 767px) {

    /* ---- GLOBAL OVERFLOW CONTAINMENT ---- */
    /* Prevent mega menus & any wide elements from expanding viewport */
    nav,
    #main-nav {
        max-width: 100vw !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
    }

    section,
    main,
    footer,
    .container,
    .slider-container {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    /* Force desktop-only mega menu to not affect layout */
    .mega-menu-item .absolute {
        display: none !important;
    }

    /* ---- Hero Slider ---- */
    .slider-container>div .text-3xl {
        font-size: 1.5rem;
    }

    /* ---- Shop by Category Section ---- */
    section .grid.grid-cols-2.md\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    /* Category circle images – constrain on mobile */
    section .grid.grid-cols-2.md\:grid-cols-4 .max-w-\[200px\] {
        max-width: 130px;
    }

    section .grid.grid-cols-2.md\:grid-cols-4 h3 {
        font-size: 12px;
    }

    /* ---- Product Grids (index.php Best Sellers, New Arrivals, Recent, shop.php) ---- */
    .grid.grid-cols-2.md\:grid-cols-3,
    .grid.grid-cols-2.md\:grid-cols-3.lg\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Shop page product grid – force 2 columns */
    .grid.grid-cols-1.sm\:grid-cols-2.lg\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    /* Product Card Image – slightly shorter on mobile */
    .grid.grid-cols-2 .aspect-\[4\/5\],
    .grid.grid-cols-1.sm\:grid-cols-2 .aspect-\[4\/5\] {
        aspect-ratio: 4/5;
    }

    /* Product card text compact */
    .grid.grid-cols-2 h3.font-medium,
    .grid.grid-cols-1.sm\:grid-cols-2 h3.font-serif {
        font-size: 12px;
        margin-bottom: 2px;
        line-height: 1.3;
    }

    /* Fixed height overrides for shop page cards */
    .grid.grid-cols-1.sm\:grid-cols-2 .h-\[34px\],
    .grid.grid-cols-1.sm\:grid-cols-2 .h-\[56px\] {
        height: auto !important;
        max-height: none !important;
    }

    /* Reduce padding inside shop product cards */
    .grid.grid-cols-1.sm\:grid-cols-2 .p-4 {
        padding: 8px;
    }

    /* Shop page Add to Cart button on mobile */
    .grid.grid-cols-1.sm\:grid-cols-2 button.w-full {
        padding: 6px 4px;
        font-size: 10px;
    }

    /* Hide quick action hover buttons on mobile */
    .grid .absolute.bottom-4.right-4 {
        display: none;
    }

    /* ---- Features Section (4-column icons) ---- */
    section .grid.grid-cols-2.md\:grid-cols-4.gap-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    section .grid.grid-cols-2.md\:grid-cols-4.gap-4 .p-4 {
        padding: 12px 8px;
    }

    section .grid.grid-cols-2.md\:grid-cols-4.gap-4 i {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }

    section .grid.grid-cols-2.md\:grid-cols-4.gap-4 h4 {
        font-size: 11px;
    }

    /* ---- Footer ---- */
    footer .grid.grid-cols-1.md\:grid-cols-4 {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    /* ---- Top Bar ---- */
    .bg-luxury-offwhite.text-luxury-charcoal.border-b {
        font-size: 10px;
    }

    /* ---- Shop Page Sidebar (collapse on mobile) ---- */
    aside.w-full.md\:w-1\/4 {
        display: none;
    }

    /* Make main content full width on mobile when sidebar hidden */
    main.w-full.md\:w-3\/4 {
        width: 100%;
    }

    /* ---- Product Detail Page (product.php) Mobile ---- */
    .flex.flex-col.md\:flex-row {
        flex-direction: column;
    }

    .w-full.md\:w-1\/2 {
        width: 100%;
    }

    /* Product image container on mobile */
    .relative.w-full.h-\[250px\] {
        height: 280px;
    }
}

/* ===================================
   Mobile Header Alignment
   =================================== */
@media (max-width: 767px) {
    #main-nav {
        height: 56px !important;
    }

    #main-nav>.container {
        display: flex !important;
        align-items: center !important;
        height: 100%;
    }

    /* Logo sizing — premium compact */
    #main-nav a.text-xl {
        font-size: 15px !important;
        line-height: 1 !important;
        letter-spacing: -0.02em;
    }

    /* Icon row alignment */
    #main-nav .flex.items-center {
        display: flex !important;
        align-items: center !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}

/* ===================================
   Mobile Search Overlay — Premium Style
   =================================== */
#mobile-search-panel {
    border-radius: 0 0 16px 16px;
}

/* Search tag pills */
.mobile-search-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f8f8f8;
    color: #444;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    border: 1px solid #eee;
    transition: all 0.2s ease;
    text-decoration: none;
}

.mobile-search-tag:hover,
.mobile-search-tag:active {
    background: var(--color-gold);
    color: #fff;
    border-color: var(--color-gold);
}

.mobile-search-tag:active {
    transform: scale(0.96);
}

/* Trending list items */
.mobile-trending-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 4px;
    border-bottom: 1px solid #f4f4f4;
    text-decoration: none;
    transition: background 0.15s ease;
    border-radius: 8px;
}

.mobile-trending-item:hover,
.mobile-trending-item:active {
    background: #fafafa;
}

.mobile-trending-item:last-child {
    border-bottom: none;
}

/* ===================================
   Bottom Navigation Safe Area (iOS)
   =================================== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .pb-safe {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .safe-area-bottom {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

@supports (padding-top: env(safe-area-inset-top)) {
    .safe-area-top {
        padding-top: env(safe-area-inset-top);
    }
}

/* ===================================
   Smooth Animations
   =================================== */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fade-in-up 0.8s ease-out;
}

/* ===================================
   Desktop Search Bar Polish
   =================================== */
#desktop-search-input {
    transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

#desktop-search-input:focus {
    box-shadow: 0 0 0 3px rgba(255, 51, 102, 0.1);
}

/* ===================================
   Icon hover micro-animation
   =================================== */
#main-nav a,
#main-nav button {
    transition: color 0.2s ease, transform 0.15s ease;
}

#main-nav a:active,
#main-nav button:active {
    transform: scale(0.92);
}

/* ===================================
   Live Search Autocomplete Results
   =================================== */

/* Individual result item */
.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f5f5f5;
}

.search-result-item:hover,
.search-result-item:active {
    background: #fafafa;
}

.search-result-item:last-of-type {
    border-bottom: none;
}

/* Product thumbnail */
.search-result-img {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f8f8f8;
    border: 1px solid #eee;
}

.search-result-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product info */
.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f1f1f;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Inter', sans-serif;
}

/* Keyword highlight */
.search-result-name mark {
    background: rgba(255, 51, 102, 0.12);
    color: #FF3366;
    padding: 0 1px;
    border-radius: 2px;
    font-weight: 700;
}

/* Price & meta row */
.search-result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
}

.search-result-price {
    font-size: 13px;
    font-weight: 700;
    color: #FF3366;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.search-result-oldprice {
    font-size: 11px;
    color: #aaa;
    text-decoration: line-through;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.search-result-cat {
    font-size: 10px;
    color: #999;
    background: #f3f3f3;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.search-result-badge {
    display: inline-block;
    font-size: 9px;
    color: #fff;
    background: #FF3366;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    vertical-align: middle;
    margin-left: 4px;
}

.search-result-arrow {
    flex-shrink: 0;
}

/* View all results link */
.search-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 16px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    color: #FF3366;
    background: #fff5f8;
    border-top: 1px solid #ffe5ec;
    transition: background 0.15s ease;
}

.search-view-all:hover {
    background: #ffe5ec;
}

/* Mobile-specific result sizing */
@media (max-width: 767px) {
    .search-result-img {
        width: 44px;
        height: 44px;
        border-radius: 8px;
    }

    .search-result-item {
        padding: 10px 4px;
    }

    .search-result-name {
        font-size: 13px;
    }
}