/* ============================================================================
   ShopKit — Shared component styles
   Uses CSS variables from theme.css. Always include theme.css first.
   ============================================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
    opacity: 0;
    transition: opacity .18s ease;
    animation: sk-fallback-reveal 0s 3s forwards;
}
body.sk-ready {
    opacity: 1;
    animation: none;
}
@keyframes sk-fallback-reveal { to { opacity: 1; } }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================================================
   ANNOUNCEMENT BAR
   ============================================================================ */
.announce {
    background: var(--primary);
    color: var(--primary-fg);
    text-align: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
}

/* ============================================================================
   HEADER
   ============================================================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    height: var(--header-h);
}
.brand {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
    text-decoration: none;
    flex-shrink: 0;
}
.brand-dot { color: var(--primary); }
.nav {
    display: flex;
    gap: 22px;
    flex: 1;
}
.nav a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 15px;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: all .15s var(--ease);
}
.nav a:hover, .nav a.active {
    color: var(--primary);
    border-color: var(--primary);
    text-decoration: none;
}
.header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}
.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: 0;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background .15s var(--ease);
}
.icon-btn:hover { background: var(--bg-overlay); }
.icon-btn .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: var(--accent);
    color: var(--accent-fg);
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}
.search-bar {
    flex: 1;
    max-width: 480px;
    position: relative;
}
.search-bar input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 18px 0 44px;
    background: var(--bg-soft);
    font-size: 14px;
    color: var(--text);
    transition: all .15s var(--ease);
}
.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.search-bar .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-soft);
    pointer-events: none;
}
.search-suggest {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}
.search-suggest.open { display: block; }
.search-suggest a {
    display: flex;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text);
    align-items: center;
    text-decoration: none;
}
.search-suggest a:hover { background: var(--bg-soft); }
.search-suggest img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }

/* Mobile nav toggle */
.mobile-toggle { display: none; }

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .15s var(--ease);
    text-decoration: none;
    white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
    background: var(--primary);
    color: var(--primary-fg);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); text-decoration: none; }
.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-outline:hover { background: var(--bg-soft); text-decoration: none; }
.btn-ghost {
    background: transparent;
    color: var(--text);
}
.btn-ghost:hover { background: var(--bg-overlay); }
.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover { background: #b91c1c; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ============================================================================
   FORMS
   ============================================================================ */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.form-group .hint {
    display: block;
    font-size: 12px;
    color: var(--text-soft);
    margin-top: 4px;
}
.input, .select, .textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    transition: all .15s var(--ease);
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.textarea { resize: vertical; min-height: 100px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }

/* ============================================================================
   PRODUCT CARDS
   ============================================================================ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}
.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all .25s var(--ease);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
    text-decoration: none;
}
.product-card .pc-image {
    aspect-ratio: 1 / 1;
    background: var(--bg-soft);
    overflow: hidden;
    position: relative;
}
.product-card .pc-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s var(--ease);
}
.product-card:hover .pc-image img { transform: scale(1.06); }
.product-card .pc-body { padding: 14px 16px 18px; }
.product-card .pc-cat {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-soft);
    margin-bottom: 4px;
    font-weight: 600;
}
.product-card .pc-name {
    font-weight: 600;
    color: var(--text);
    font-size: 15px;
    line-height: 1.35;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
}
.product-card .pc-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.pc-price .now {
    font-weight: 800;
    color: var(--text);
    font-size: 17px;
}
.pc-price .was {
    text-decoration: line-through;
    color: var(--text-soft);
    font-size: 13px;
}
.product-card .pc-add {
    margin-top: 10px;
    width: 100%;
}
.badge-pill {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: var(--bg-card);
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    box-shadow: var(--shadow-xs);
}
.badge-pill.sale { background: var(--accent); color: var(--accent-fg); }
.badge-pill.new  { background: var(--primary); color: var(--primary-fg); }
.badge-pill.low  { background: var(--warning); color: white; }
.badge-pill.oos  { background: var(--gray-700); color: white; }

/* ============================================================================
   CATEGORY CARDS
   ============================================================================ */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}
.cat-card {
    background: var(--bg-soft);
    border-radius: var(--radius-lg);
    padding: 28px 18px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    transition: all .2s var(--ease);
}
.cat-card:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    transform: translateY(-3px);
    text-decoration: none;
}
.cat-card .cat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.cat-card .cat-name { font-weight: 700; font-size: 15px; }
.cat-card .cat-count { font-size: 12px; color: var(--text-soft); margin-top: 2px; }

/* ============================================================================
   HERO
   ============================================================================ */
.hero {
    background: var(--hero-gradient);
    padding: 80px 0 90px;
    overflow: hidden;
    position: relative;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 40px;
    align-items: center;
}
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-xs);
}
.hero h1 {
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.05;
    margin: 0 0 18px;
    color: var(--text);
    font-weight: 800;
    letter-spacing: -1.5px;
}
.hero h1 .accent {
    background: var(--hero-accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero p {
    font-size: 17px;
    color: var(--text-muted);
    margin: 0 0 28px;
    max-width: 540px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-visual {
    aspect-ratio: 4 / 5;
    border-radius: var(--radius-xl);
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
}
.hero-visual img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================================
   SECTIONS
   ============================================================================ */
.section {
    padding: 64px 0;
}
.section-soft { background: var(--bg-soft); }
.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.section-head h2 {
    font-size: 28px;
    font-weight: 800;
    margin: 0;
    color: var(--text);
    letter-spacing: -.8px;
}
.section-head p {
    color: var(--text-muted);
    margin: 6px 0 0;
    font-size: 14px;
}
.section-head .more {
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
}

/* ============================================================================
   FEATURE STRIP
   ============================================================================ */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.feat {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 18px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}
.feat .ic {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.feat strong { display: block; font-size: 15px; }
.feat span { display: block; color: var(--text-soft); font-size: 13px; margin-top: 2px; }

/* ============================================================================
   FOOTER
   ============================================================================ */
.footer {
    background: var(--gray-900);
    color: #cbd5e1;
    padding: 60px 0 24px;
    margin-top: 80px;
}
.footer a { color: #cbd5e1; }
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer h4 {
    color: white;
    font-size: 14px;
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: .8px;
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer ul li { margin: 8px 0; font-size: 14px; }
.footer ul li a:hover { color: white; text-decoration: none; }
.footer-brand { font-size: 22px; font-weight: 800; color: white; margin-bottom: 12px; }
.footer-brand .brand-dot { color: var(--primary-light); }
.footer-tag { font-size: 14px; line-height: 1.6; }
.footer-socials { display: flex; gap: 10px; margin-top: 14px; }
.footer-socials a {
    width: 36px; height: 36px;
    background: rgba(255,255,255,.1);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.footer-socials a:hover { background: var(--primary); }
.newsletter-form {
    display: flex;
    gap: 0;
    margin-top: 12px;
    border-radius: var(--radius);
    overflow: hidden;
}
.newsletter-form input {
    flex: 1;
    padding: 11px 14px;
    border: 0;
    background: rgba(255,255,255,.1);
    color: white;
    font-size: 14px;
}
.newsletter-form input::placeholder { color: #94a3b8; }
.newsletter-form input:focus { outline: none; background: rgba(255,255,255,.15); }
.newsletter-form button {
    background: var(--primary);
    color: var(--primary-fg);
    border: 0;
    padding: 0 18px;
    font-weight: 600;
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: 24px;
    font-size: 13px;
    color: #94a3b8;
    text-align: center;
}
.payment-icons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.payment-icons span {
    background: rgba(255,255,255,.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

/* ============================================================================
   TOAST
   ============================================================================ */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--text);
    color: var(--bg);
    padding: 14px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all .25s var(--ease);
    max-width: 360px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: var(--success); color: white; }
.toast.error { background: var(--danger); color: white; }
.toast.warning { background: var(--warning); color: white; }

/* ============================================================================
   EMPTY STATES, LOADERS
   ============================================================================ */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty .empty-icon {
    width: 80px; height: 80px;
    background: var(--bg-soft);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    margin-bottom: 16px;
}
.empty h3 { color: var(--text); margin: 0 0 8px; }
.skeleton {
    background: linear-gradient(90deg, var(--bg-soft) 0%, var(--gray-100) 50%, var(--bg-soft) 100%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
    border-radius: var(--radius);
}
@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.spinner {
    width: 38px; height: 38px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================================
   MOBILE
   ============================================================================ */
@media (max-width: 900px) {
    .header-inner { gap: 12px; }
    .nav { display: none; }                 /* replaced by the shop drawer */
    .header-actions { margin-left: auto; }
    .mobile-toggle { display: inline-flex; }
    .search-bar { max-width: none; }
    .hero { padding: 50px 0 60px; }
    .hero-grid { grid-template-columns: 1fr; gap: 30px; }
    .hero-visual { aspect-ratio: 16 / 11; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
    .section { padding: 48px 0; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
    .product-card .pc-body { padding: 12px; }
    .pc-price .now { font-size: 15px; }
    .section-head h2 { font-size: 22px; }
}
@media (max-width: 560px) {
    .footer-grid { grid-template-columns: 1fr; }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .header .search-toggle-mobile { display: inline-flex !important; }
    .header .hide-sm { display: none; }     /* account / wishlist / dark mode live in the drawer */
    /* Search drops down below the header when the search button is tapped */
    .header .search-bar {
        display: none;
        position: absolute; top: 100%; left: 0; right: 0;
        max-width: none;
        padding: 10px 16px 12px;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
    }
    .header .search-bar.mobile-open { display: block; }
    .header .search-bar input { height: 46px; font-size: 16px; }   /* 16px stops iOS zooming in */
    .header .search-bar .search-icon { left: 32px; top: 33px; }
    .header .search-bar .search-suggest { top: 62px; left: 16px; right: 16px; max-height: 60vh; }
}
.search-toggle-mobile { display: none; }

/* ============================================================================
   SHOP DRAWER (mobile sidebar)
   ============================================================================ */
.drawer-back {
    position: fixed; inset: 0; z-index: 998;
    background: rgba(15, 23, 42, .5);
    opacity: 0; visibility: hidden;
    transition: opacity .2s ease, visibility .2s;
}
.drawer-back.open { opacity: 1; visibility: visible; }
.drawer {
    /* Opens from the right, the same side as the menu button */
    position: fixed; top: 0; right: 0; z-index: 999;
    height: 100vh; height: 100dvh;          /* dvh = the visible height on phones */
    width: min(86vw, 340px);
    background: var(--bg);
    color: var(--text);
    display: flex; flex-direction: column;
    transform: translateX(102%);
    visibility: hidden;
    transition: transform .25s cubic-bezier(.4, 0, .2, 1), visibility .25s;
    box-shadow: var(--shadow-lg);
}
.drawer.open { transform: none; visibility: visible; }
@media (max-width: 900px) { body.drawer-open { overflow: hidden; } }
.drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 12px 12px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.drawer-user {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px;
    background: var(--primary);
    color: var(--primary-fg);
    flex-shrink: 0;
}
.drawer-user .d-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 17px; flex-shrink: 0;
}
.drawer-user .d-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.drawer-user .d-who strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-user a { color: var(--primary-fg); text-decoration: underline; text-underline-offset: 2px; }
.drawer-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
.drawer-promo {
    display: flex; align-items: center; gap: 10px;
    margin: 14px 16px 2px; padding: 10px 12px;
    background: var(--primary-soft); color: var(--primary);
    border-radius: var(--radius); font-size: 13px;
}
.drawer-promo svg { flex-shrink: 0; }
.drawer-sec { padding: 14px 8px 6px; border-bottom: 1px solid var(--border); }
.drawer-sec:last-child { border-bottom: 0; }
.drawer-sec h5 {
    margin: 0 12px 6px; font-size: 11px; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase; color: var(--text-soft);
}
.drawer-sec a {
    display: flex; align-items: center; gap: 14px;
    min-height: 46px; padding: 0 12px;
    border-radius: var(--radius);
    color: var(--text); font-size: 15px; font-weight: 500; text-decoration: none;
}
.drawer-sec a:hover, .drawer-sec a:active { background: var(--bg-soft); text-decoration: none; }
.drawer-sec a.active { background: var(--primary-soft); color: var(--primary); }
.drawer .d-ic { width: 22px; display: inline-flex; justify-content: center; color: var(--text-soft); flex-shrink: 0; }
.drawer-sec a.active .d-ic { color: var(--primary); }
.drawer .d-lb { flex: 1; min-width: 0; }
.drawer .d-count {
    min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
    background: var(--accent); color: var(--accent-fg);
    font-size: 12px; font-weight: 700; align-items: center; justify-content: center;
}
.drawer-cats a { min-height: 42px; font-weight: 400; padding-left: 14px; }
.drawer .d-num { font-size: 12px; color: var(--text-soft); }
.drawer .d-muted { display: block; padding: 8px 14px; font-size: 13px; color: var(--text-soft); }
.drawer-foot {
    display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border); flex-shrink: 0;
}
.drawer-foot button {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg); color: var(--text); font-size: 14px; font-weight: 500;
}
.drawer-foot button .d-ic { width: auto; color: inherit; }


/* ============================================================================
   BROWSE MENU (desktop): the same menu as the phone drawer, shown as a wide
   panel that drops down from the header instead of sliding in from the side.
   ============================================================================ */
.browse-btn {
    display: none;
    align-items: center; gap: 8px;
    height: 40px; padding: 0 14px;
    border: 1px solid var(--border); border-radius: 999px;
    background: var(--bg-soft); color: var(--text);
    font-size: 14px; font-weight: 600;
    flex-shrink: 0;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.browse-btn:hover, .browse-btn[aria-expanded="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.browse-btn svg:first-child { width: 17px; height: 17px; }
.browse-btn svg:last-child { transition: transform .18s ease; }
.browse-btn[aria-expanded="true"] svg:last-child { transform: rotate(180deg); }

@media (min-width: 901px) {
    .browse-btn { display: inline-flex; }
    .header-inner { gap: 22px; }
    .drawer-back { background: rgba(15, 23, 42, .28); z-index: 40; }       /* below the header, so it stays usable */
    .drawer {
        top: var(--drawer-top, var(--header-h)); right: auto; left: 50%;
        height: auto; max-height: calc(100vh - var(--drawer-top, var(--header-h)) - 24px);
        width: min(1120px, calc(100vw - 40px));
        z-index: 45;
        display: grid; grid-template-columns: 250px 1fr; grid-template-rows: 1fr auto;
        border: 1px solid var(--border); border-top: 0;
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        overflow: hidden;
        opacity: 0;
        transform: translate(-50%, -10px);
        transition: opacity .16s ease, transform .16s ease, visibility .16s;
    }
    .drawer.open { opacity: 1; transform: translate(-50%, 0); }
    .drawer-head { display: none; }
    .drawer-user {
        grid-column: 1; grid-row: 1;
        flex-direction: column; align-items: flex-start; justify-content: flex-start;
        gap: 14px; padding: 26px 22px;
    }
    .drawer-user .d-avatar { width: 48px; height: 48px; font-size: 19px; }
    .drawer-user .d-who { font-size: 13.5px; gap: 6px; }
    .drawer-user .d-who strong { font-size: 19px; white-space: normal; }
    .drawer-foot {
        grid-column: 1; grid-row: 2;
        flex-direction: column; gap: 8px;
        padding: 14px 16px 16px;
        border-top: 0;
        background: var(--primary);
    }
    .drawer-foot button {
        flex: none; justify-content: flex-start; padding: 0 12px; height: 40px;
        background: rgba(255, 255, 255, .12); border-color: transparent; color: var(--primary-fg);
    }
    .drawer-foot button:hover { background: rgba(255, 255, 255, .22); }
    .drawer-body {
        grid-column: 2; grid-row: 1 / span 2;
        display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
        align-content: start;
        gap: 4px 6px;
        padding: 18px 16px 20px;
        overflow-y: auto;
    }
    .drawer-promo { grid-column: 1 / -1; margin: 0 8px 8px; }
    .drawer-sec { border-bottom: 0; padding: 6px 4px; }
    .drawer-sec + .drawer-sec { border-left: 1px solid var(--border); padding-left: 10px; }
    .drawer-sec a { min-height: 40px; font-size: 14.5px; gap: 12px; }
    .drawer-cats a { min-height: 38px; padding-left: 12px; }
}


/* ============================================================================
   PHONES: iOS Safari zooms the page when a focused field has text smaller
   than 16px. Keep every form control at 16px on small screens.
   ============================================================================ */
@media (max-width: 900px) {
    input, select, textarea, .input, .select, .textarea, .search-bar input { font-size: 16px !important; }
}

/* ============================================================================
   QUICK ADD (choose options from a product card) + cart badge bump
   ============================================================================ */
@keyframes sk-bump { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
[data-cart-badge].bump { animation: sk-bump .35s ease; }

.qa-back {
    position: fixed; inset: 0; z-index: 1200;
    background: rgba(15, 23, 42, .5);
    display: flex; align-items: center; justify-content: center; padding: 20px;
    opacity: 0; visibility: hidden; transition: opacity .16s ease, visibility .16s;
}
.qa-back.open { opacity: 1; visibility: visible; }
.qa-sheet {
    position: relative; width: 100%; max-width: 420px; max-height: 88vh; overflow-y: auto;
    background: var(--bg-card); color: var(--text);
    border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-lg);
    transform: translateY(14px); transition: transform .18s ease;
}
.qa-back.open .qa-sheet { transform: none; }
.qa-x {
    position: absolute; top: 10px; right: 10px; width: 34px; height: 34px;
    border: 0; border-radius: 50%; background: var(--bg-soft); color: var(--text);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.qa-top { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; padding-right: 36px; margin-bottom: 16px; }
.qa-top img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius); background: var(--bg-soft); }
.qa-name { font-weight: 700; font-size: 15px; line-height: 1.3; }
.qa-price { font-weight: 800; font-size: 18px; margin-top: 2px; }
.qa-stock { font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.qa-stock.in { color: var(--success); }
.qa-stock.low { color: var(--warning); }
.qa-stock.out { color: var(--danger); }
.qa-group { margin-bottom: 14px; }
.qa-label { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.qa-label b { color: var(--text); }
.qa-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.qa-opts button {
    min-width: 46px; min-height: 42px; padding: 0 14px;
    border: 1.5px solid var(--border-strong); border-radius: 10px;
    background: var(--bg); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer;
}
.qa-opts button.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.qa-opts button.soldout { opacity: .45; text-decoration: line-through; }
.qa-foot { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 18px; }
.qa-foot .btn { height: 48px; font-size: 15px; }
.qa-qty { display: inline-flex; align-items: center; border: 1.5px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.qa-qty button { width: 42px; height: 46px; border: 0; background: var(--bg); color: var(--text); font-size: 18px; cursor: pointer; }
.qa-qty span { min-width: 34px; text-align: center; font-weight: 700; }
.qa-more { display: block; text-align: center; margin-top: 12px; font-size: 13px; color: var(--text-muted); }
@media (max-width: 640px) {
    .qa-back { align-items: flex-end; padding: 0; }
    .qa-sheet {
        max-width: none; border-radius: 18px 18px 0 0;
        padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
        transform: translateY(100%);
    }
}

/* ============================================================================
   "ADDED TO YOUR CART" PANEL (what was added + View cart / Checkout)
   ============================================================================ */
.added {
    position: fixed; z-index: 1300; top: calc(var(--header-h) + 12px); right: 20px; width: 350px; max-width: calc(100vw - 24px);
    background: var(--bg-card); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); padding: 14px;
    opacity: 0; visibility: hidden; transform: translateY(-10px); transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.added.show { opacity: 1; visibility: visible; transform: none; }
.added-top { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.added-top img { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; background: var(--bg-soft); }
.added-ok { width: 44px; height: 44px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; }
.added-what { min-width: 0; }
.added-what b { display: block; font-size: 14.5px; color: var(--success); }
.added-what small { display: block; font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.added-x { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--bg-soft); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; }
.added-sum { display: flex; justify-content: space-between; gap: 10px; margin: 12px 0; padding: 10px 12px; border-radius: 10px; background: var(--bg-soft); font-size: 13.5px; }
.added-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.added-btns .btn { height: 46px; padding: 0 10px; font-size: 14.5px; }
.added-more { display: none; width: 100%; margin-top: 8px; padding: 8px; border: 0; background: none; color: var(--text-muted); font-size: 13.5px; cursor: pointer; }
@media (max-width: 640px) {
    .added {
        top: auto; bottom: 0; left: 0; right: 0; width: auto; max-width: none; border: 0; border-radius: 18px 18px 0 0;
        padding: 16px 16px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(15, 23, 42, .22);
        transform: translateY(100%); transition: transform .22s ease, visibility .22s; opacity: 1;
    }
    .added-more { display: block; }
    .added-btns .btn { height: 50px; font-size: 15.5px; }
}
