/* === SELF-HOSTED INTER FONT === */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url('/fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url('/fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* === RESET & BASE STYLES === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* ============ APOTHECARY BOTANICAL PALETTE ============ */
    /* Forest greens (primary) */
    --primary: #2e5944;
    --primary-dark: #234735;
    --primary-darker: #1b3527;
    --primary-light: #4a7a60;
    --primary-lighter: #a9c5b1;
    --primary-50: #ecf1e3;
    --primary-100: #dce6d3;
    /* Terracotta / clay (secondary accent) */
    --terracotta: #bc6433;
    --terracotta-dark: #a3552f;
    --terracotta-deep: #6e3a1e;
    --terracotta-50: #f6e9dc;
    --terracotta-100: #ecd5bf;
    --secondary-green: #bc6433;
    --success-green: #4a7c59;
    --warning-yellow: #bc6433;
    --error-red: #b3402e;
    --accent-navy: #24211a;

    /* Warm paper & linen */
    --white: #fdfbf3;            /* card paper */
    --paper: #fdfbf3;
    --linen: #f3ecda;            /* page background */
    --cream: #f8f3e6;
    --ink: #262219;

    /* Warm stone scale (legacy gray names) */
    --gray-50: #f7f2e2;
    --gray-100: #efe9d6;
    --gray-200: #e2dbc4;
    --gray-300: #cdc5ab;
    --gray-400: #a2997f;
    --gray-500: #786f59;
    --gray-600: #5e5641;
    --gray-700: #494331;
    --gray-800: #322d21;
    --gray-900: #262219;

    --border-subtle: rgba(70, 58, 35, 0.14);
    --border-default: rgba(70, 58, 35, 0.22);
    --surface-elevated: #fdfbf3;
    --surface-sunken: #f3ecda;

    /* Typography */
    --font-family: 'Karla', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
    --font-mono: 'Courier Prime', 'Courier New', Courier, monospace;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Warm soft shadows */
    --shadow-sm: 0 1px 2px 0 rgba(58, 46, 24, 0.05);
    --shadow-md: 0 2px 10px -2px rgba(58, 46, 24, 0.1);
    --shadow-lg: 0 6px 20px -6px rgba(58, 46, 24, 0.14);
    --shadow-xl: 0 12px 36px -10px rgba(58, 46, 24, 0.2);

    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;

    --transition-fast: 150ms ease-in-out;
    --transition-normal: 250ms ease-in-out;

    /* Z-index system */
    --z-ticker: 900;
    --z-header: 1000;
    --z-modal: 2000;
    --z-notification: 3000;
}

/* === SKIP LINK (A11y) === */
.skip-link {
    position: absolute;
    top: -48px;
    left: 8px;
    z-index: 3001;
    padding: 10px 18px;
    background: var(--primary, #2e5944);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 0 0 8px 8px;
    text-decoration: none;
    transition: top 0.15s ease-in-out;
}
.skip-link:focus {
    top: 0;
    outline: 2px solid #fff;
    outline-offset: -4px;
}

/* === FOCUS VISIBILITY (AA) === */
:focus { outline: none; }
:focus-visible {
    outline: 2px solid var(--terracotta-dark);
    outline-offset: 2px;
    border-radius: 2px;
}

html { font-size: 16px; }

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--gray-900);
    background-color: var(--linen);
    /* layered warm linen texture: faint grain + soft vignettes */
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(253, 251, 243, 0.9) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 90% 110%, rgba(46, 89, 68, 0.05) 0%, transparent 65%),
        repeating-linear-gradient(0deg, rgba(70, 58, 35, 0.016) 0px, rgba(70, 58, 35, 0.016) 1px, transparent 1px, transparent 3px);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
    -webkit-touch-callout: none;
}

/* === EDITORIAL SERIF DISPLAY HEADINGS === */
h1, h2,
.section-heading,
.section-header h2,
.trust-header h2,
.page-hero h1,
.modal-title,
.products-page-title,
.pl-hero h1,
.pd-product-name,
.rd-product-header h1,
.about-hero-text h1,
.contact-hero-text h1 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--gray-900);
}

/* === SMALL-CAPS APOTHECARY LABEL === */
.apoth-label {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--primary);
}

/* === ORNAMENTAL BOTANICAL RULE (sprig divider) === */
.botanical-rule {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.875rem;
    margin: 0.875rem auto 0;
    max-width: 280px;
}
.botanical-rule::before,
.botanical-rule::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gray-300));
}
.botanical-rule::after {
    background: linear-gradient(90deg, var(--gray-300), transparent);
}
.botanical-rule i,
.botanical-rule span {
    color: var(--terracotta);
    font-size: 0.7rem;
    line-height: 1;
}

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--space-4); }
@media (min-width: 640px) { .container { padding: 0 var(--space-6); } }
@media (min-width: 1024px) { .container { padding: 0 var(--space-8); } }

/* === BUTTONS === */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    padding: var(--space-3) var(--space-6); font-weight: 700; font-size: var(--font-size-sm);
    letter-spacing: 0.04em;
    border-radius: var(--radius-md); border: none; cursor: pointer;
    transition: all var(--transition-fast); text-decoration: none; white-space: nowrap; user-select: none;
    min-height: 44px;
}
.btn-primary {
    background: var(--primary); color: var(--paper);
    box-shadow: inset 0 0 0 1px rgba(27, 53, 39, 0.55), 0 2px 8px rgba(46, 89, 68, 0.22);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: inset 0 0 0 1px rgba(27, 53, 39, 0.55), 0 6px 16px rgba(46, 89, 68, 0.3); }
.btn-secondary { background: var(--paper); color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-secondary:hover { background: var(--cream); border-color: var(--primary); color: var(--primary-dark); transform: translateY(-1px); }
.btn-success { background: var(--success-green); color: var(--paper); }
.btn-success:hover { background: var(--terracotta); }
.btn-sm { padding: var(--space-2) var(--space-4); font-size: var(--font-size-xs); }
.btn-lg { padding: var(--space-4) var(--space-8); font-size: var(--font-size-lg); }

/* === UTILITY CLASSES === */
.text-center { text-align: center; }
.hidden { display: none; }
.text-sm { font-size: var(--font-size-sm); }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }

/* === UTILITY CLASSES: SECTION === */
.section-heading { color: #24211a; }
.section-icon { color: #2e5944; margin-right: 8px; }
.section-alt { background-color: var(--gray-50); }

/* === ANNOUNCEMENT BAR (above trust bar) === */
.announcement-bar {
    background: linear-gradient(135deg, #b3402e, #96352a);
    color: #fff;
    padding: 10px 0;
    position: relative;
    z-index: var(--z-ticker);
    font-size: 0.85rem;
    text-align: center;
}
.announcement-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    flex-wrap: wrap;
}
.announcement-icon {
    font-size: 1.1rem;
    line-height: 1;
}
.announcement-text {
    letter-spacing: 0.01em;
    line-height: 1.4;
}
.announcement-text strong {
    font-weight: 800;
}
@media (max-width: 767px) {
    .announcement-bar { font-size: 0.78rem; padding: 8px 0; }
    .announcement-icon { font-size: 0.95rem; }
}
@media (max-width: 479px) {
    .announcement-bar { font-size: 0.72rem; padding: 7px 0; }
    .announcement-inner { gap: 0.375rem; }
}

/* === TRUST BAR (announcement strip — apothecary ledger) === */
.trust-bar {
    background: linear-gradient(180deg, #1b3527 0%, #234735 100%);
    color: #ecf1e3;
    padding: 9px 0;
    position: relative;
    z-index: var(--z-ticker);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-bottom: 1px solid rgba(188, 100, 51, 0.5);
}
.trust-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.75rem;
    flex-wrap: wrap;
}
.trust-bar-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}
.trust-bar a.trust-bar-item:hover { color: #d9a87c; }
.trust-bar-item i {
    font-size: 0.7rem;
    color: #cf8050;
}
.cart-btn-text { display: none; }
@media (min-width: 480px) { .cart-btn-text { display: inline; } }

/* === HEADER — sticky, warm paper, blurred === */
.header {
    background: rgba(253, 251, 243, 0.86);
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
    backdrop-filter: blur(14px) saturate(1.1);
    padding: var(--space-3) 0;
    position: sticky; top: 0; z-index: var(--z-header);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 1px 0 rgba(253, 251, 243, 0.6) inset, 0 2px 14px rgba(58, 46, 24, 0.06);
}
.header-content { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.logo { display: flex; align-items: center; text-decoration: none; gap: var(--space-3); min-height: 44px; }
.logo-img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 1px solid var(--gray-300); box-shadow: 0 0 0 3px rgba(46, 89, 68, 0.1); }
.footer-logo-img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; margin-right: 8px; }
.logo-text {
    font-family: var(--font-display);
    font-size: 1.45rem; font-weight: 700; color: var(--primary-dark);
    line-height: 1.1; letter-spacing: 0.02em;
}
.logo-text small {
    display: block; font-family: var(--font-mono); font-size: 0.58rem; font-weight: 400;
    color: var(--gray-500); letter-spacing: 0.12em; text-transform: uppercase; margin-top: 1px;
    white-space: nowrap;
}
.header-actions { display: flex; align-items: center; gap: var(--space-3); }

.shipping-info {
    display: flex; align-items: center; gap: var(--space-2);
    padding: var(--space-2) var(--space-3); background: var(--primary-50);
    border: 1px solid var(--primary-100); border-radius: var(--radius-md);
    font-size: 0.75rem; color: var(--primary-dark);
}
.shipping-info i { color: var(--primary); font-size: 0.7rem; }

.cart-btn {
    display: flex; align-items: center; gap: var(--space-2);
    padding: var(--space-2) var(--space-4); background: var(--primary);
    color: var(--paper); border: none; border-radius: var(--radius-md);
    cursor: pointer; font-size: var(--font-size-sm); font-weight: 700;
    letter-spacing: 0.03em;
    box-shadow: inset 0 0 0 1px rgba(27, 53, 39, 0.55), 0 2px 6px rgba(46, 89, 68, 0.2);
    transition: all var(--transition-fast); position: relative;
    min-height: 44px;
}
.cart-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.cart-count {
    background: var(--terracotta); color: var(--paper); border-radius: 50%;
    width: 20px; height: 20px; display: flex; align-items: center;
    justify-content: center; font-size: 0.7rem; font-weight: 700;
    font-family: var(--font-mono);
}

/* === DESKTOP NAVIGATION === */
.nav-desktop { display: none; }
@media (min-width: 768px) { .nav-desktop { display: block; } }
.nav-links {
    list-style: none; display: flex; gap: var(--space-1); align-items: center;
}
.nav-link {
    padding: var(--space-2) 10px; color: var(--gray-600);
    text-decoration: none; font-size: 0.78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    border-radius: var(--radius-sm); transition: all var(--transition-fast);
    white-space: nowrap; position: relative;
}
.nav-link:hover { color: var(--primary); background: var(--primary-50); }
.nav-link.active { color: var(--primary-dark); font-weight: 800; }
.nav-link.active::after {
    content: ''; position: absolute; left: 10px; right: 10px; bottom: 1px;
    height: 2px; background: var(--terracotta); border-radius: 1px;
}
.nav-link-secondary { color: var(--gray-400); font-size: var(--font-size-xs); }
.nav-link-secondary:hover { color: var(--primary); background: var(--primary-50); }
.nav-link-secondary.active { color: var(--primary); }

/* Verified On dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
    display: none; position: absolute; top: 100%; right: 0;
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg); box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    list-style: none; padding: 6px 0; min-width: 200px; z-index: calc(var(--z-header) + 200);
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu li a {
    display: flex; align-items: center; gap: 8px; padding: 9px 16px;
    font-size: 0.82rem; color: var(--gray-600); text-decoration: none;
    transition: all 0.15s;
}
.nav-dropdown-menu li a:hover { background: var(--primary-50); color: var(--primary); }
.nav-dropdown-menu li a i { width: 16px; text-align: center; color: var(--primary); font-size: 0.78rem; }

.desktop-only { display: none; }
@media (min-width: 768px) { .desktop-only { display: flex; } }
.mobile-only { display: flex; }
@media (min-width: 768px) { .mobile-only { display: none; } }

/* === HAMBURGER MENU === */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: none;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
}
.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--gray-700);
    border-radius: 1px;
    transition: all 0.3s ease;
}
@media (max-width: 767px) {
    .hamburger-btn { display: flex; }
}

/* === MOBILE MENU === */
.mobile-menu-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: calc(var(--z-header) + 10);
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-overflow-scrolling: touch;
}
.mobile-menu-overlay.open { opacity: 1; visibility: visible; }
.mobile-menu {
    position: fixed;
    top: 0; right: 0;
    width: 300px;
    max-width: 85%;
    height: 100%;
    height: 100dvh;
    background: var(--white);
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--space-6) var(--space-4);
    z-index: calc(var(--z-header) + 11);
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: var(--space-4);
}
.mobile-menu-title { font-weight: 700; font-size: var(--font-size-lg); color: var(--gray-900); }
.mobile-menu-close {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: var(--gray-100); border: none; border-radius: 50%;
    cursor: pointer; font-size: 1rem; color: var(--gray-600);
}
.mobile-menu-close:hover { background: var(--gray-200); }
.mobile-menu-footer {
    margin-top: var(--space-6); padding-top: var(--space-4);
    border-top: 1px solid var(--gray-100);
    display: flex; flex-direction: column; gap: var(--space-3);
}
.mobile-menu-footer a {
    display: flex; align-items: center; gap: var(--space-2);
    color: var(--primary); text-decoration: none; font-size: var(--font-size-sm); font-weight: 500;
}
.mobile-menu-footer a:hover { text-decoration: underline; }
.mobile-nav-links {
    list-style: none;
}
.mobile-nav-links li { border-bottom: 1px solid var(--gray-100); }
.mobile-nav-links a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-2);
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}
.mobile-nav-links a:hover { color: var(--primary); }
.mobile-nav-links a.active { color: var(--primary); font-weight: 600; }
.mobile-nav-links a i { width: 20px; text-align: center; color: var(--primary); }

/* === CHINESE CULTURAL ACCENTS === */
.cn-accent { font-family: 'Noto Serif SC', 'Songti SC', 'SimSun', serif; }
.cn-divider {
    display: flex; align-items: center; justify-content: center; gap: 0.75rem;
    margin: 1.5rem 0; color: var(--gray-300);
}
.cn-divider::before, .cn-divider::after {
    content: ''; flex: 1; max-width: 80px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gray-300), transparent);
}
.cn-divider span { font-size: 0.75rem; color: var(--gray-400); letter-spacing: 0.1em; }
/* Stamped seal — terracotta apothecary mark */
.cn-seal {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border: 2px solid var(--terracotta); border-radius: 4px;
    color: var(--terracotta); font-size: 0.6rem; font-weight: 800;
    font-family: 'Noto Serif SC', serif; transform: rotate(-3deg);
    line-height: 1;
    box-shadow: 0 0 0 1px rgba(188, 100, 51, 0.18), inset 0 0 6px rgba(188, 100, 51, 0.12);
    background: rgba(188, 100, 51, 0.05);
}

/* === MODAL SYSTEM === */
.modal {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: var(--z-modal); overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--space-4); align-items: flex-start; justify-content: center;
    opacity: 0; transition: opacity 0.25s ease; backdrop-filter: blur(4px);
}
.modal.show { display: flex; opacity: 1; }
.modal-content {
    background: var(--white); border-radius: var(--radius-xl);
    width: 100%; max-width: 600px; max-height: 90vh; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: var(--shadow-xl); margin: auto;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}
.modal.show .modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--border-subtle);
    position: sticky; top: 0; z-index: 1;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    background: linear-gradient(180deg, var(--cream), var(--paper));
    box-shadow: 0 1px 0 rgba(188, 100, 51, 0.25);
}
.modal-title { font-size: 1.35rem; font-weight: 600; color: var(--primary-darker); }
.modal-close {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    background: var(--white); border: 1px solid var(--gray-200); border-radius: 50%;
    cursor: pointer; color: var(--gray-600); transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}
.modal-close:hover { background: var(--error-red); color: var(--white); border-color: var(--error-red); transform: rotate(90deg); }
.modal-body { padding: var(--space-4) var(--space-6); }

/* === NOTIFICATION TOAST === */
.notification-toast {
    position: fixed; top: 20px; right: 20px; z-index: var(--z-notification);
    transform: translateX(120%); transition: transform 0.3s ease;
}
.notification-toast.show { transform: translateX(0); }
.toast-content {
    display: flex; align-items: center; gap: var(--space-3);
    padding: var(--space-3) var(--space-4); background: var(--white);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
    border-left: 4px solid var(--success-green); min-width: 280px;
    max-width: 90vw;
}
.toast-content.error { border-left-color: var(--error-red); }
.toast-content.warning { border-left-color: var(--warning-yellow); }
.toast-content.info { border-left-color: var(--primary); }
.toast-icon { font-size: 1.2rem; }
.toast-message { font-weight: 600; font-size: var(--font-size-sm); }
.toast-subtitle { font-size: var(--font-size-xs); color: var(--gray-500); }
.toast-close { background: none; border: none; color: var(--gray-400); cursor: pointer; padding: 4px; }

/* === SEARCH DROPDOWN === */
.search-container { position: relative; flex-shrink: 0; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-400); font-size: var(--font-size-sm); }
.search-input {
    width: 220px; padding: var(--space-2) var(--space-3) var(--space-2) 36px;
    border: 1px solid var(--gray-300); border-radius: var(--radius-md);
    background: var(--paper); color: var(--gray-900);
    font-family: inherit;
    font-size: var(--font-size-sm); outline: none; transition: all var(--transition-fast);
    min-height: 44px;
}
.search-input:focus { border-color: var(--primary); width: 280px; box-shadow: 0 0 0 3px rgba(46, 89, 68, 0.12); }
.search-dropdown {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    z-index: 100; max-height: 400px; overflow-y: auto; margin-top: 4px;
}
.search-result-item {
    display: flex; align-items: center; padding: var(--space-3);
    border-bottom: 1px solid var(--gray-100); cursor: pointer;
    transition: background var(--transition-fast);
}
.search-result-item:hover { background: var(--primary-50); }
.search-result-info { flex: 1; }
.search-result-name { font-weight: 600; font-size: var(--font-size-sm); color: var(--gray-900); }
.search-result-details { font-size: var(--font-size-xs); color: var(--gray-500); }
.search-result-price { font-weight: 600; color: var(--primary); font-size: var(--font-size-sm); }

/* === PAGE HERO (About, Contact, 404) === */
.page-hero {
    background:
        radial-gradient(ellipse 70% 120% at 85% -20%, rgba(46, 89, 68, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse 50% 100% at 8% 110%, rgba(188, 100, 51, 0.07) 0%, transparent 55%),
        linear-gradient(180deg, var(--paper) 0%, var(--cream) 100%);
    padding: 3rem 0 2.5rem;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
}
.page-hero::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
    background: linear-gradient(90deg, transparent 15%, rgba(188, 100, 51, 0.45) 50%, transparent 85%);
    pointer-events: none;
}
.page-hero h1 {
    font-size: 2.6rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}
.page-hero p {
    font-size: 1.05rem;
    color: var(--gray-600);
}

/* === ABOUT & CONTACT MODALS === */
.about-content, .contact-content { line-height: 1.7; }
.about-section, .contact-section { margin-bottom: var(--space-6); }
.about-section h3, .contact-section h3 { font-size: var(--font-size-lg); font-weight: 600; margin-bottom: var(--space-3); color: var(--gray-900); }
.about-section p, .contact-section p { margin-bottom: var(--space-3); color: var(--gray-700); }
.about-section ul, .contact-section ul { padding-left: var(--space-6); margin-bottom: var(--space-3); }
.about-section li, .contact-section li { margin-bottom: var(--space-2); color: var(--gray-700); }
.contact-item { display: flex; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-3); }
.contact-item i { color: var(--primary); margin-top: 4px; }
.contact-item a { color: var(--primary); text-decoration: none; }
.contact-item a:hover { text-decoration: underline; }

/* === POLICY MODAL === */
.policy-section { margin-bottom: 1.5rem; }
.policy-section h3 {
    font-size: 1rem; font-weight: 600; color: var(--primary-dark);
    margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem;
}
.policy-section h3 i { color: var(--primary); }
.policy-section ul { list-style: none; padding: 0; }
.policy-section ul li {
    padding: 0.5rem 0 0.5rem 1.5rem; position: relative;
    font-size: 0.875rem; color: var(--gray-700); line-height: 1.5;
}
.policy-section ul li::before {
    content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
    position: absolute; left: 0; color: var(--success-green); font-size: 0.75rem; top: 0.625rem;
}
.policy-highlight {
    background: linear-gradient(135deg, var(--primary-50), #edf2e6);
    border: 1px solid var(--primary-100); border-radius: var(--radius-lg);
    padding: 1rem 1.25rem; margin: 1rem 0;
}
.policy-highlight p { font-size: 0.875rem; color: var(--primary-darker); font-weight: 500; }
.policy-guarantee {
    background: #edf2e6; border: 2px solid #bc6433; border-radius: var(--radius-lg);
    padding: 1.25rem; text-align: center; margin-top: 1.5rem;
}
.policy-guarantee i { font-size: 2rem; color: #bc6433; margin-bottom: 0.5rem; }
.policy-guarantee h4 { font-size: 1rem; color: #6e3a1e; margin-bottom: 0.25rem; }
.policy-guarantee p { font-size: 0.8125rem; color: #a3552f; }

/* === FOOTER — deep forest ledger === */
.footer {
    background:
        radial-gradient(ellipse 60% 90% at 90% 0%, rgba(188, 100, 51, 0.08) 0%, transparent 55%),
        linear-gradient(180deg, #1d3a2b 0%, #142519 100%);
    color: #b9c5b4; padding: 3.5rem 0 2rem;
    margin-top: var(--space-8); font-size: var(--font-size-sm);
    border-top: 3px double rgba(188, 100, 51, 0.55);
}
.footer a { color: var(--primary-lighter); text-decoration: none; min-height: 44px; display: flex; align-items: center; }
.footer a:hover { text-decoration: none; }
.footer-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem; margin-bottom: 2rem;
}
.footer-col h4 {
    color: #f3ecda; font-family: var(--font-mono); font-size: 0.78rem; font-weight: 700; margin-bottom: 1rem;
    text-transform: uppercase; letter-spacing: 0.18em; position: relative; padding-bottom: 0.625rem;
}
.footer-col h4::after {
    content: ''; position: absolute; bottom: 0; left: 0;
    width: 28px; height: 2px; background: var(--terracotta); border-radius: 1px;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul li a {
    color: #b9c5b4; font-size: 0.8125rem;
    transition: color 0.2s ease, padding-left 0.2s ease;
    position: relative; display: inline-block;
}
.footer-col ul li a::after {
    content: ''; position: absolute; bottom: -1px; left: 0;
    width: 0; height: 1px; background: #d9a87c; transition: width 0.25s ease;
}
.footer-col ul li a:hover { color: #ecd5bf; padding-left: 4px; text-decoration: none; }
.footer-col ul li a:hover::after { width: 100%; }
.footer-col p { font-size: 0.8125rem; line-height: 1.6; }
.footer-bottom {
    border-top: 1px solid rgba(185, 197, 180, 0.22); padding-top: 2rem;
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem;
}
.footer-bottom p { font-size: 0.75rem; color: #8da18a; }
.footer-logo {
    display: flex; align-items: center; gap: var(--space-2);
    font-family: var(--font-display);
    font-size: 1.35rem; font-weight: 700; color: #f3ecda;
    margin-bottom: 0.75rem; text-decoration: none;
}
.footer-logo small {
    display: block; font-family: var(--font-mono); font-size: 0.56rem; font-weight: 400;
    color: #8da18a; letter-spacing: 0.12em; text-transform: uppercase;
}
.footer-copyright {
    text-align: center; padding-top: 0.5rem; margin-top: 0.5rem;
    font-size: 0.7rem; color: #8da18a;
}
.footer-social { display: flex; gap: 0.75rem; }
.footer-social a {
    width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
    background: rgba(243, 236, 218, 0.08); border: 1px solid rgba(185, 197, 180, 0.25);
    border-radius: 50%; color: #b9c5b4;
    transition: all 0.25s ease;
}
.footer-social a:hover { background: var(--terracotta); border-color: var(--terracotta); color: #fdfbf3; transform: translateY(-3px); box-shadow: 0 4px 12px rgba(188, 100, 51, 0.4); }

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-24px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }

.reveal {
    opacity: 0; transform: translateY(24px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal.revealed { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

.loading { text-align: center; padding: var(--space-8); color: var(--gray-500); }
.loading-spinner {
    width: 40px; height: 40px; border: 3px solid var(--gray-200);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 0.8s linear infinite; margin: 0 auto var(--space-4);
}

/* === RESPONSIVE BASE === */
@media (max-width: 640px) {
    .header-content { flex-wrap: nowrap; }
    .modal-content { max-width: 100%; margin: var(--space-2); }
    .modal-body { padding: var(--space-3); }
    .modal-header { padding: var(--space-3) var(--space-4); }
    .page-hero h1 { word-wrap: break-word; overflow-wrap: break-word; }
}

@media (max-width: 767px) {
    .header .shipping-info { display: none; }
    .header .cart-btn.desktop-only { display: none !important; }

    body { font-size: 1rem; line-height: 1.65; -webkit-text-size-adjust: 100%; }

    .header { padding: var(--space-2) 0; }
    .header-content { gap: var(--space-2); }
    .logo-img { width: 30px; height: 30px; }
    .logo-text { font-size: 1.25rem; }
    .logo-text small { font-size: 0.5rem; letter-spacing: 0.08em; }

    .search-container { width: 100%; }
    .search-input { width: 100%; min-height: 44px; }
    .search-input:focus { width: 100%; }
    .search-dropdown { left: var(--space-2); right: var(--space-2); }

    /* Touch targets */
    .cart-btn { padding: 0.625rem 1rem; min-height: 44px; font-size: 0.875rem; }
    .btn { min-height: 44px; padding: 0.625rem 1.25rem; }
    .btn-sm { min-height: 40px; padding: 0.5rem 1rem; }
    .btn-lg { min-height: 52px; padding: 0.875rem 1.5rem; }
    .modal-close { width: 44px; height: 44px; font-size: 1.125rem; }

    /* Modal bottom sheet */
    .modal { padding: 0; align-items: flex-end; }
    .modal-content {
        max-width: 100%; width: 100%; max-height: 95vh; margin: 0;
        border-radius: 12px 12px 0 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
    }
    .modal-header {
        padding: var(--space-4); border-radius: 12px 12px 0 0;
        position: sticky; top: 0; z-index: 2;
    }
    .modal-body { padding: var(--space-4); overflow-y: auto; -webkit-overflow-scrolling: touch; }

    /* Notification toast full width */
    .notification-toast { right: var(--space-3); left: var(--space-3); top: auto; bottom: var(--space-3); }
    .toast-content { width: 100%; min-width: unset; max-width: unset; }

    /* Larger icons */
    i.fa, i.fas, i.far, i.fab { font-size: 1.125em; }

    /* Improve text contrast */
    .text-gray-500 { color: var(--gray-600); }

    /* Page hero */
    .page-hero { padding: 1.75rem 0 1.5rem; }
    .page-hero h1 { font-size: 1.5rem; }
    .page-hero p { font-size: 0.9rem; }

    /* Footer */
    .footer { padding: 2rem 0 2rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }
    .footer-col h4 { font-size: 0.875rem; margin-bottom: 0.875rem; }
    .footer-col ul li a { padding: 0.5rem 0; font-size: 0.875rem; display: block; min-height: 44px; line-height: 2.4; }
    .footer-col p { font-size: 0.875rem; line-height: 1.65; }
    .footer-bottom { flex-direction: column; text-align: center; gap: 0.75rem; }
    .footer-bottom p { font-size: 0.8125rem; }
    .footer-social { justify-content: center; }
    .footer-social a { width: 44px; height: 44px; font-size: 1.125rem; }
}

/* === EMAIL CAPTURE POPUP === */
.email-capture-code-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--primary-50);
    border: 2px dashed var(--primary);
    border-radius: var(--radius-lg);
    margin-top: var(--space-3);
}
.email-capture-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-size-xs);
    font-weight: 600;
    transition: background var(--transition-fast);
    min-height: 36px;
}
.email-capture-copy-btn:hover { background: var(--primary-dark); }

/* === TELEGRAM REPS MODAL === */
.tg-reps-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.tg-rep-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-fast);
    min-height: 44px;
}
.tg-rep-card:hover {
    background: #e8f4fd;
    border-color: #229ED9;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.tg-rep-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #229ED9, #1a8bc7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.tg-rep-info {
    flex: 1;
}
.tg-rep-name {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--gray-800);
}
.tg-rep-handle {
    font-size: var(--font-size-xs);
    color: #229ED9;
    font-weight: 500;
}
.tg-rep-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    background: #229ED9;
    color: white;
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    font-weight: 600;
    white-space: nowrap;
    min-height: 36px;
}
.tg-rep-card:hover .tg-rep-btn {
    background: #1a8bc7;
}

/* === WAREHOUSE BUTTON === */
.warehouse-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--primary-50);
    border: 1px solid var(--primary-100);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary-dark);
    transition: all 0.15s;
}
.warehouse-btn:hover {
    background: var(--primary-100);
    border-color: var(--primary);
}
@media (max-width: 768px) {
    .warehouse-btn .warehouse-btn-name { display: none; }
}

/* Performance */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 767px) {
    .modal-content { will-change: transform; }
    .notification-toast { will-change: transform; }
    .modal-close:hover { transform: none; }
    .footer-social a:hover { transform: none; }
}

@media (max-width: 767px) {
    .trust-bar { padding: 7px 0; }
    .trust-bar-inner { gap: 0.45rem 1.1rem; }
    .trust-bar-item { font-size: 0.58rem; letter-spacing: 0.08em; }
    .trust-bar-item:nth-child(n+4) { display: none; }
}
@media (max-width: 479px) {
    .trust-bar-item:nth-child(n+3) { display: none; }
}
@media (max-width: 479px) {
    .modal-header { padding: var(--space-3) var(--space-4); }
    .modal-title { font-size: var(--font-size-base); }
    .btn { width: 100%; }
    .btn-lg { padding: 0.75rem 1.25rem; font-size: var(--font-size-base); }
    .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (max-width: 359px) {
    .modal-header { padding: var(--space-3); }
    .modal-body { padding: var(--space-3); }
    .container { padding: 0 var(--space-3); }
    .logo-text { font-size: 0.95rem; }
    .logo-text small { font-size: 0.55rem; }
    .header { padding: var(--space-1) 0; }
}

/* ========================================================================
   MOBILE BOTTOM NAVIGATION BAR
   ======================================================================== */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 767px) {
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(253, 251, 243, 0.96);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--gray-200);
        box-shadow: 0 -2px 12px rgba(58, 46, 24, 0.08);
        z-index: 1500;
        padding: 4px 0;
        padding-bottom: max(4px, env(safe-area-inset-bottom));
    }

    .bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 6px 0;
        text-decoration: none;
        color: #9a9082;
        font-size: 0.65rem;
        font-weight: 500;
        transition: color 0.15s;
        position: relative;
        min-height: 44px;
        -webkit-tap-highlight-color: transparent;
    }

    .bottom-nav-item i {
        font-size: 1.1rem;
    }

    .bottom-nav-item.active {
        color: #2e5944;
        font-weight: 600;
    }

    .bottom-nav-item:active {
        color: #2e5944;
    }

    .bottom-nav-badge {
        position: absolute;
        top: 2px;
        right: 50%;
        transform: translateX(12px);
        background: #c14e3a;
        color: #fff;
        font-size: 0.6rem;
        font-weight: 700;
        min-width: 16px;
        height: 16px;
        border-radius: 100px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
    }

    .bottom-nav-badge:empty,
    .bottom-nav-badge[data-count="0"] {
        display: none;
    }

    /* Add bottom padding to body so content isn't hidden behind nav */
    body {
        padding-bottom: 64px;
    }

    /* Hide footer social on mobile — bottom nav replaces it */
    .footer { padding-bottom: 20px; }
}

/* === REPORT LIGHTBOX === */
.report-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.88);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    cursor: zoom-out;
}
.report-lightbox.active { display: flex; }
.report-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    border: none;
    transition: background 0.2s;
    z-index: 1;
}
.report-lightbox-close:hover { background: rgba(255,255,255,0.25); }
.report-lightbox-img {
    max-width: 90vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
    cursor: default;
}
.report-lightbox-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}
.report-lightbox-name {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}
.report-lightbox-verify {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: #3a7d68;
    color: #fff;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}
.report-lightbox-verify:hover { background: #31685a; }

/* ===== Mobile Optimisation (Jul 2026) ===== */
/* All rules below are scoped to mobile widths only — desktop unchanged. */

@media (max-width: 767px) {
    /* Prevent iOS Safari auto-zoom on focus: force >=16px on all text-entry
       controls. Several modals (email capture, affiliate, pay-page crypto
       guide) set 14px / 0.85rem inline, which triggers the zoom. */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="search"],
    input[type="password"],
    input[type="url"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Data tables (referral-stats / traffic-stats dashboards) get a
       horizontal scroll container instead of blowing out the viewport. */
    .rs-table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    /* Overflow safety: images can never force horizontal scroll.
       (Class/inline-sized images keep their own dimensions — higher
       specificity.) */
    img { max-width: 100%; height: auto; }

    /* Touch targets: bump remaining sub-44px controls. */
    .mobile-menu-close { width: 44px; height: 44px; font-size: 1.05rem; }
    .toast-close {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .email-capture-copy-btn { min-height: 44px; min-width: 44px; }
    .tg-rep-btn { min-height: 44px; }
    .warehouse-btn { min-height: 40px; }

    /* Long unbroken strings (crypto addresses, order IDs, emails) wrap
       instead of causing sideways scroll. */
    .crypto-address,
    .pay-crypto-addr {
        overflow-wrap: anywhere;
        word-break: break-all;
    }
    #confirmShippingAddress,
    .confirm-section,
    #affiliateLink,
    .toast-subtitle {
        overflow-wrap: anywhere;
    }

    /* Bottom-sheet modals: size against the dynamic viewport so the sticky
       modal header stays reachable while the browser URL bar is visible.
       (Checkout modal keeps its own full-screen rules in cart.css, which
       loads after this file.) */
    .modal-content { max-height: calc(100dvh - 24px); }

    /* Subtle branded tap feedback instead of the default grey flash. */
    a, button { -webkit-tap-highlight-color: rgba(46, 89, 68, 0.12); }
}

@media (max-width: 479px) {
    /* Warehouse selection grids: comfier rows on small phones. */
    #warehouseGrid > *, #firstVisitWarehouseGrid > * { min-height: 48px; }
}
