/* ============================================================
   WAXTRON MEDICALS — AMAZON-STYLE HEADER
   amazon-header.css
   ============================================================ */

/* ── CSS Variables ── */
:root {
    --amz-dark:       #131921;
    --amz-dark-hover: #1e2a38;
    --amz-navy:       #232F3E;
    --amz-navy-hover: #37475A;
    --amz-orange:     #FF9900;
    --amz-orange-dk:  #e68a00;
    --amz-teal:       #00A8CC;
    --amz-green:      #007600;
    --amz-light-text: #cccccc;
    --amz-border:     rgba(255,255,255,0.13);
    --amz-dropdown-shadow: 0 4px 24px rgba(0,0,0,0.18);
    --amz-radius: 4px;
}

/* ── Reset header context ── */
.amz-header *, .amz-header *::before, .amz-header *::after { box-sizing: border-box; }

/* ══════════════════════════════════════
   HEADER SHELL
══════════════════════════════════════ */
.amz-header {
    position: sticky;
    top: 0;
    z-index: 9000;
    background: var(--amz-dark);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    user-select: none;
}

/* ══════════════════════════════════════
   ROW 1 — MAIN BAR
══════════════════════════════════════ */
.amz-header-main { background: var(--amz-dark); }

.amz-header-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 60px;
}

/* hover ring shared by interactive header blocks */
.amz-header-inner > *:not(.amz-search):not(.amz-logo) {
    border: 2px solid transparent;
    border-radius: var(--amz-radius);
    transition: border-color 0.12s;
}
.amz-header-inner > *:not(.amz-search):not(.amz-logo):hover,
.amz-header-inner > *:not(.amz-search):not(.amz-logo):focus-within {
    border-color: white;
}

/* ── Logo ── */
.amz-logo {
    display: flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    padding: 6px 8px;
    flex-shrink: 0;
    margin-right: 4px;
}
.amz-logo-mark {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #0057A8, #00A878);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 800; font-size: 18px;
    letter-spacing: -1px; flex-shrink: 0;
}
.amz-logo-text { display: flex; flex-direction: column; line-height: 1; }
.amz-logo-name { font-size: 15px; font-weight: 800; color: white; letter-spacing: -0.5px; }
.amz-logo-sub  { font-size: 9px;  text-transform: uppercase; color: var(--amz-orange); letter-spacing: 2px; }

/* ── Deliver To (Location) ── */
.amz-location {
    display: flex; align-items: center; gap: 5px;
    padding: 6px 8px; cursor: pointer; flex-shrink: 0;
    min-width: 110px;
}
.amz-location-icon { color: white; font-size: 16px; line-height: 1; }
.amz-location-text { display: flex; flex-direction: column; line-height: 1.2; }
.amz-location-top  { font-size: 10px; color: var(--amz-light-text); }
.amz-location-city { font-size: 13px; font-weight: 700; color: white; white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }

/* ── Search ── */
.amz-search {
    flex: 1;
    max-width: 860px;
    min-width: 0;
    position: relative;
    margin: 0 8px;
    border-radius: var(--amz-radius);
    overflow: visible;
}
.amz-search-inner {
    display: flex;
    height: 40px;
    border-radius: var(--amz-radius);
    overflow: hidden;
    border: 3px solid var(--amz-orange);
}
.amz-search-cat {
    background: #f3f3f3;
    border: none;
    border-right: 1px solid #cdcdcd;
    padding: 0 8px;
    font-size: 12px;
    color: #333;
    cursor: pointer;
    outline: none;
    width: 140px;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
}
.amz-search-input {
    flex: 1;
    border: none;
    padding: 0 14px;
    font-size: 15px;
    outline: none;
    background: white;
    color: #0f1111;
    min-width: 0;
}
.amz-search-input::placeholder { color: #999; font-size: 14px; }
.amz-search-btn {
    background: var(--amz-orange);
    border: none;
    padding: 0 16px;
    cursor: pointer;
    font-size: 18px;
    color: var(--amz-dark);
    transition: background 0.15s;
    flex-shrink: 0;
}
.amz-search-btn:hover { background: var(--amz-orange-dk); }

/* Search suggestions dropdown */
.amz-search-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: white;
    border-radius: var(--amz-radius);
    box-shadow: var(--amz-dropdown-shadow);
    border: 1px solid #ddd;
    z-index: 9100;
    display: none;
    overflow: hidden;
}
.amz-search-suggestions.open { display: block; }
.amz-suggestion-item {
    padding: 10px 16px;
    font-size: 14px;
    color: #0f1111;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}
.amz-suggestion-item:hover { background: #f3f3f3; }
.amz-suggestion-item i { color: #999; font-size: 13px; width: 16px; }
.amz-suggestion-cat { font-size: 11px; color: #999; margin-left: auto; }

/* ── Header link shared style ── */
.amz-hd-link {
    display: flex; flex-direction: column;
    padding: 6px 8px; cursor: pointer; text-decoration: none;
    flex-shrink: 0;
}
.amz-hd-top { font-size: 11px; color: var(--amz-light-text); line-height: 1.2; }
.amz-hd-bot { font-size: 14px; font-weight: 700; color: white;  line-height: 1.3; white-space: nowrap; }

/* ── Account Dropdown trigger ── */
.amz-account {
    display: flex; flex-direction: column;
    padding: 6px 8px; cursor: pointer;
    flex-shrink: 0; position: relative;
}
.amz-account-text { display: flex; flex-direction: column; }

/* ── WhatsApp header link ── */
.amz-wa-link { align-items: center; }
.amz-wa-icon { font-size: 22px; color: #25D366; line-height: 1; }

/* ── Cart button ── */
.amz-cart-btn {
    display: flex; align-items: flex-end; gap: 4px;
    text-decoration: none; padding: 6px 8px;
    flex-shrink: 0;
}
.amz-cart-icon { position: relative; display: flex; align-items: center; }
.amz-cart-icon i { font-size: 28px; color: white; }
.amz-cart-count {
    position: absolute;
    top: -8px; right: -8px;
    background: var(--amz-orange);
    color: var(--amz-dark);
    font-size: 12px; font-weight: 800;
    min-width: 20px; height: 20px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
    transition: transform 0.2s;
}
.amz-cart-label { font-size: 13px; font-weight: 700; color: white; white-space: nowrap; line-height: 1; }

/* ── Mobile hamburger ── */
.amz-mobile-toggle {
    display: none;
    background: none; border: none;
    color: white; font-size: 22px;
    cursor: pointer; padding: 8px;
    border: 2px solid transparent;
    border-radius: var(--amz-radius);
    margin-left: auto;
}
.amz-mobile-toggle:hover { border-color: white; }

/* ══════════════════════════════════════
   DROPDOWN BASE
══════════════════════════════════════ */
.amz-dropdown-trigger { position: relative; }

.amz-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 240px;
    background: white;
    border-radius: 6px;
    box-shadow: var(--amz-dropdown-shadow);
    border: 1px solid #e8e8e8;
    z-index: 9200;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}
/* arrow notch */
.amz-dropdown::before {
    content: '';
    position: absolute;
    top: -7px; left: 24px;
    width: 14px; height: 14px;
    background: white;
    border-left: 1px solid #e8e8e8;
    border-top: 1px solid #e8e8e8;
    transform: rotate(45deg);
    border-radius: 2px;
}
.amz-dropdown-trigger:hover .amz-dropdown,
.amz-dropdown-trigger.open   .amz-dropdown {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}
.amz-dropdown-divider { border: none; border-top: 1px solid #eee; margin: 6px 0; }

/* ══════════════════════════════════════
   ACCOUNT DROPDOWN
══════════════════════════════════════ */
.amz-account-panel {
    right: 0; left: auto;
    min-width: 340px;
}
.amz-account-panel::before { left: auto; right: 24px; }

.amz-account-sign { padding: 16px; text-align: center; }
.amz-signin-btn {
    display: inline-block;
    background: var(--amz-orange);
    color: var(--amz-dark);
    padding: 8px 40px;
    border-radius: 20px;
    font-weight: 700; font-size: 14px;
    text-decoration: none;
    border: 1px solid var(--amz-orange-dk);
    transition: background 0.15s;
}
.amz-signin-btn:hover { background: var(--amz-orange-dk); color: var(--amz-dark); }

.amz-dropdown-cols { display: grid; grid-template-columns: 1fr 1fr; padding: 6px 0; }
.amz-dropdown-col { padding: 8px 0; }
.amz-dropdown-col h4 {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    color: #888; padding: 4px 16px 6px; margin: 0;
}
.amz-dropdown-col a {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 16px; font-size: 13px; color: #0f1111;
    text-decoration: none; transition: background 0.12s;
}
.amz-dropdown-col a:hover { background: #f3f3f3; color: #c7511f; }
.amz-dropdown-col a i { width: 15px; color: #666; font-size: 13px; }

/* ══════════════════════════════════════
   ALL CATEGORIES DROPDOWN
══════════════════════════════════════ */
.amz-all-cats-panel {
    width: 280px;
    left: 0;
    top: calc(100% + 6px);
    padding: 0;
    overflow: hidden;
    max-height: 480px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.amz-all-cats-panel::before { display: none; }

.amz-all-cats-header {
    background: var(--amz-navy);
    color: white;
    padding: 12px 16px;
    display: flex; align-items: center; gap: 10px;
    font-size: 14px; font-weight: 700;
    border-bottom: 2px solid var(--amz-orange);
    position: sticky; top: 0;
}
.amz-all-cats-list { padding: 4px 0; }
.amz-cat-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; font-size: 13px; color: #0f1111;
    text-decoration: none; cursor: pointer;
    transition: background 0.12s;
    border-bottom: 1px solid #f5f5f5;
}
.amz-cat-row:last-child { border-bottom: none; }
.amz-cat-row:hover { background: #f3f3f3; color: #c7511f; }
.amz-cat-row i:first-child { width: 18px; color: #0057A8; font-size: 14px; text-align: center; }
.amz-cat-row span { flex: 1; font-weight: 500; }
.amz-cat-arrow { font-size: 10px; color: #ccc; }
.amz-cat-row:hover .amz-cat-arrow { color: #c7511f; }

/* ══════════════════════════════════════
   ROW 2 — NAV BAR
══════════════════════════════════════ */
.amz-navbar { background: var(--amz-navy); }
.amz-navbar-inner {
    max-width: 1600px; margin: 0 auto;
    padding: 0 12px;
    display: flex; align-items: center; gap: 0;
    height: 38px; overflow: visible;
}

/* All Categories button */
.amz-nav-all { position: relative; flex-shrink: 0; }
.amz-nav-all-btn {
    background: none; border: none;
    color: white; font-size: 13px; font-weight: 700;
    padding: 0 14px; height: 38px; cursor: pointer;
    display: flex; align-items: center; gap: 7px;
    white-space: nowrap;
    border: 2px solid transparent; border-radius: var(--amz-radius);
    transition: border-color 0.12s;
}
.amz-nav-all-btn:hover,
.amz-nav-all:hover .amz-nav-all-btn,
.amz-nav-all.open .amz-nav-all-btn { border-color: white; }

/* Nav links */
.amz-nav-links { display: flex; align-items: center; flex: 1; overflow: hidden; }
.amz-nav-link {
    color: white; font-size: 13px; font-weight: 500;
    padding: 0 12px; height: 38px;
    display: flex; align-items: center; white-space: nowrap;
    text-decoration: none;
    border: 2px solid transparent; border-radius: var(--amz-radius);
    transition: border-color 0.12s;
}
.amz-nav-link:hover,
.amz-nav-link.active { border-color: white; color: white; }
.amz-nav-highlight {
    color: var(--amz-orange) !important;
    font-weight: 700;
}
.amz-nav-highlight:hover { border-color: var(--amz-orange) !important; }

/* Location pill on navbar */
.amz-nav-location-pill {
    margin-left: auto; flex-shrink: 0;
    display: flex; align-items: center; gap: 6px;
    color: var(--amz-light-text); font-size: 12px;
    padding: 0 10px; cursor: pointer;
    white-space: nowrap;
    border: 2px solid transparent; border-radius: var(--amz-radius);
    transition: border-color 0.12s;
}
.amz-nav-location-pill:hover { border-color: white; color: white; }
.amz-nav-location-pill i { color: var(--amz-orange); }

/* ══════════════════════════════════════
   LOCATION POPUP
══════════════════════════════════════ */
.amz-popup-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9300;
    backdrop-filter: blur(2px);
}
.amz-popup-overlay.open { display: block; }

.amz-location-popup {
    display: none;
    position: fixed;
    top: 80px; left: 50%;
    transform: translateX(-50%);
    z-index: 9400;
    width: 100%; max-width: 400px;
    padding: 0 16px;
}
.amz-location-popup.open { display: block; animation: popupIn 0.25s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes popupIn { from { opacity:0; transform:translateX(-50%) translateY(-16px) scale(0.95); } to { opacity:1; transform:translateX(-50%) translateY(0) scale(1); } }

.amz-location-popup-inner {
    background: white;
    border-radius: 8px;
    padding: 22px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.22);
    border: 1px solid #ddd;
}
.amz-location-popup-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 12px;
}
.amz-location-popup-header h3 { font-size: 16px; font-weight: 700; color: #0f1111; margin: 0; flex: 1; }
.amz-popup-close {
    background: none; border: none; font-size: 18px;
    color: #888; cursor: pointer; padding: 4px;
    border-radius: 50%; transition: background 0.15s;
}
.amz-popup-close:hover { background: #f3f3f3; }

.amz-location-select {
    width: 100%; padding: 10px 12px;
    border: 1px solid #ccc; border-radius: var(--amz-radius);
    font-size: 14px; color: #0f1111; outline: none;
    background: white;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
.amz-location-select:focus { border-color: var(--amz-orange); box-shadow: 0 0 0 3px rgba(255,153,0,0.2); }

.amz-apply-location-btn {
    background: var(--amz-orange); border: 1px solid var(--amz-orange-dk);
    color: var(--amz-dark); font-weight: 700; font-size: 14px;
    padding: 10px 18px; border-radius: var(--amz-radius);
    cursor: pointer; white-space: nowrap;
    transition: background 0.15s;
}
.amz-apply-location-btn:hover { background: var(--amz-orange-dk); }

.amz-detect-btn {
    width: 100%; padding: 10px; background: none;
    border: 1px solid #0057A8; border-radius: var(--amz-radius);
    color: #0057A8; font-size: 13px; font-weight: 600;
    cursor: pointer; display: flex; align-items: center;
    justify-content: center; gap: 8px; transition: all 0.15s;
}
.amz-detect-btn:hover { background: #eff6ff; }

/* ══════════════════════════════════════
   MOBILE DRAWER NAV
══════════════════════════════════════ */
.amz-mobile-nav {
    position: fixed;
    top: 0; left: 0;
    width: 88vw; max-width: 320px;
    height: 100vh;
    background: white;
    z-index: 9500;
    overflow-y: auto;
    transform: translateX(-110%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 32px rgba(0,0,0,0.22);
    display: flex; flex-direction: column;
}
.amz-mobile-nav.open { transform: translateX(0); }

.amz-mobile-nav-header {
    background: var(--amz-navy);
    padding: 16px;
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
    position: sticky; top: 0;
}
.amz-mobile-nav-body { flex: 1; overflow-y: auto; }

.amz-mobile-section-title {
    background: #f3f3f3;
    padding: 8px 16px;
    font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    color: #555; border-top: 1px solid #e8e8e8;
}
.amz-mobile-nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 16px; font-size: 14px; color: #0f1111;
    text-decoration: none; border-bottom: 1px solid #f0f0f0;
    background: white; width: 100%; cursor: pointer;
    transition: background 0.12s;
}
.amz-mobile-nav-link i { width: 18px; color: #0057A8; font-size: 14px; text-align: center; }
.amz-mobile-nav-link:hover { background: #f3f3f3; color: #c7511f; }
.amz-mobile-nav-link:hover i { color: #c7511f; }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 1100px) {
    .amz-search-cat { width: 110px; }
    .amz-location { display: none; }
    .amz-nav-link { padding: 0 9px; font-size: 12px; }
}

/* ═══════════════════════════════════════
   MOBILE — 820px and below
═══════════════════════════════════════ */
@media (max-width: 820px) {

    /* Header row 1 */
    .amz-header-main { background: var(--amz-dark); }
    .amz-header-inner {
        height: auto;
        min-height: 56px;
        padding: 8px 10px;
        gap: 8px;
        flex-wrap: nowrap;
    }

    /* Show hamburger */
    .amz-mobile-toggle { display: flex; order: -1; }

    /* Logo: mark only */
    .amz-logo { padding: 4px 6px; margin-right: 0; }
    .amz-logo-text { display: none; }
    .amz-logo-mark { width: 34px; height: 34px; font-size: 16px; }

    /* Search takes all remaining space */
    .amz-search {
        flex: 1;
        min-width: 0;
        margin: 0 4px;
        order: 1;
        display: none;
    }
    .amz-search-cat { display: none; }
    .amz-search-inner {
        height: 38px;
        border: 2px solid var(--amz-orange);
        border-radius: 4px;
    }
    .amz-search-input { font-size: 14px; padding: 0 10px; }
    .amz-search-btn   { padding: 0 14px; font-size: 16px; }

    /* Cart stays visible */
    .amz-cart-btn  { order: 2; flex-shrink: 0; padding: 4px 6px; }
    .amz-cart-label { display: none; }
    .amz-cart-icon i { font-size: 26px; }
    .amz-cart-count {
        min-width: 18px; height: 18px;
        font-size: 11px; top: -6px; right: -6px;
    }

    /* Hide desktop-only items */
    .amz-location    { display: none; }
    .amz-account     { display: none; }
    .amz-hd-link     { display: none; }
    .amz-wa-link     { display: none; }

    /* Hide nav bar - replaced by drawer */
    .amz-navbar { display: none; }

    /* Mobile search bar (injected by JS below header) */
    #mobileSearchBar {
        background: var(--amz-navy);
        padding: 8px 10px;
        display: block;
    }
    #mobileSearchBar form {
        display: flex;
        border: 2px solid var(--amz-orange);
        border-radius: 4px;
        overflow: hidden;
    }
    #mobileSearchBar input {
        flex: 1;
        padding: 9px 14px;
        border: none;
        outline: none;
        font-size: 15px;
        background: white;
        color: #0f1111;
    }
    #mobileSearchBar button {
        background: var(--amz-orange);
        color: var(--amz-dark);
        border: none;
        padding: 0 16px;
        font-size: 16px;
        cursor: pointer;
    }

    /* Overlay */
    .nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.55);
        z-index: 9480;
        backdrop-filter: blur(2px);
    }
    .nav-overlay.open { display: block; }

    /* Search suggestions full width on mobile */
    .amz-search-suggestions {
        position: fixed;
        top: auto;
        left: 10px; right: 10px;
        z-index: 9100;
    }

    /* Location popup centered */
    .amz-location-popup {
        top: 60px;
        padding: 0 12px;
    }
}

/* ═══════════════════════════════════════
   MOBILE — 480px and below (small phones)
═══════════════════════════════════════ */
@media (max-width: 480px) {
    .amz-header-inner { padding: 6px 8px; gap: 6px; }
    .amz-logo-mark    { width: 30px; height: 30px; font-size: 14px; }
    .amz-mobile-toggle { font-size: 18px; padding: 6px; }
    .amz-search-input  { font-size: 13px; padding: 0 8px; }
    .amz-search-btn    { padding: 0 12px; font-size: 15px; }
    .amz-cart-icon i   { font-size: 24px; }
    .amz-mobile-nav    { width: 88vw; max-width: 300px; }
    .amz-location-popup-inner { padding: 16px; }
}



# Add mobile account CSS — hidden on desktop, shown on mobile
mobile_account_css = """
/* ── Mobile Account Button (hidden desktop, shown mobile) ── */
.amz-mobile-account {
    display: none; /* hidden on desktop */
}

@media (max-width: 820px) {
    .amz-mobile-account {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-direction: column;
        text-decoration: none;
        color: white;
        padding: 4px 6px;
        border-radius: 6px;
        flex-shrink: 0;
        transition: background 0.15s;
        order: 1; /* between cart and hamburger */
    }
    .amz-mobile-account:hover {
        background: rgba(255,255,255,0.12);
        color: #FF9900;
    }

    /* Logged-in: avatar circle with initial */
    .amz-mobile-account-avatar {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: linear-gradient(135deg, #FF9900, #e68a00);
        color: #131921;
        font-size: 13px;
        font-weight: 800;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid rgba(255,255,255,0.25);
        flex-shrink: 0;
    }

    /* Logged-out: user icon + "Sign In" label */
    .amz-mobile-account i {
        font-size: 18px;
        color: white;
    }
    .amz-mobile-account-label {
        font-size: 9px;
        color: rgba(255,255,255,0.75);
        letter-spacing: 0.3px;
        white-space: nowrap;
    }
}

@media (max-width: 360px) {
    /* On very small phones hide the label to save space */
    .amz-mobile-account-label { display: none; }
    .amz-mobile-account { padding: 4px; }
}