/* =========================================================
   Lunasons — design system
   Fonts: Sora (display/headings) + Inter (body/UI)
   ========================================================= */
:root {
    /* Surfaces */
    --bg: #0a0a14;
    --bg-alt: #0d0d1a;
    --panel: #14141f;
    --panel-2: #191927;
    --panel-alt: #1d1d2e;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);

    /* Text */
    --text: #f4f2ff;
    --muted: #9b96b8;
    --muted-2: #716c8f;

    /* Brand */
    --accent: #b794ff;
    --accent-2: #ff8fc9;
    --accent-3: #7ee7d6;
    --accent-grad: linear-gradient(135deg, #b794ff 0%, #ff8fc9 100%);
    --accent-dark: #8b6fd1;

    /* Status */
    --error: #ff6b6b;
    --success: #5fe6a0;
    --warning: #ffc860;

    /* Shape */
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --radius-pill: 999px;

    /* Elevation */
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
    --shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 0 1px rgba(183, 148, 255, 0.25), 0 12px 32px -10px rgba(183, 148, 255, 0.35);

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html {
    /* Bumps every rem-based size (nearly all type in this file) up a notch from the 16px default. */
    font-size: 112.5%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* Decorative background lives on its own fixed, GPU-composited layer instead of
   `background-attachment: fixed` on <body>. The old approach makes most browsers
   repaint the whole gradient on every scroll frame; this paints once and the
   compositor just slides it around for free, which is the single biggest win
   for scroll smoothness on this page. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(1100px 600px at 12% -10%, rgba(183, 148, 255, 0.10), transparent 60%),
        radial-gradient(900px 500px at 100% 0%, rgba(255, 143, 201, 0.08), transparent 55%);
    /* No will-change here: this never animates, and position:fixed already gets its
       own compositor layer on its own. A permanent will-change on a static,
       full-viewport element just pins an extra layer in GPU memory forever for
       no benefit — will-change is meant for "about to animate," not "static." */
    pointer-events: none;
}

h1, h2, h3, h4, .logo, .stat-value, .price {
    font-family: 'Sora', 'Inter', system-ui, sans-serif;
}

a { color: var(--accent); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--accent-2); }

::selection { background: var(--accent); color: #1a1330; }

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
    /* Raised opacity so we can cut the blur radius way down without losing the glassy look —
       backdrop-filter has to resample everything scrolling underneath it on every frame
       regardless of layer promotion, so blur radius (and saturate) is the real cost knob. */
    background: rgba(13, 13, 26, 0.88);
    border-bottom: 1px solid var(--border);
    padding: 18px 0;
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    /* Promote the sticky+blur header to its own compositor layer so the browser
       doesn't have to recompute the blur against the whole page on every scroll tick. */
    transform: translateZ(0);
    will-change: transform;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.logo:hover { filter: brightness(1.15); }
.main-nav { display: flex; align-items: center; gap: 2px; }
.main-nav a {
    margin-left: 6px;
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
}
.main-nav a:hover { background: rgba(183, 148, 255, 0.12); color: var(--text); }
.cart-link { display: inline-flex; align-items: center; gap: 6px; }
.cart-count {
    background: var(--accent-grad);
    color: #1a1330;
    border-radius: var(--radius-pill);
    padding: 1px 9px;
    font-size: 0.75rem;
    font-weight: 800;
}

main.container { padding-top: 40px; padding-bottom: 80px; min-height: 60vh; }

.page-title { font-size: 2rem; font-weight: 800; margin-bottom: 28px; letter-spacing: -0.02em; }
.section-title {
    font-size: 1.35rem; font-weight: 700; margin: 48px 0 20px;
    padding-bottom: 12px; border-bottom: 1px solid var(--border);
    letter-spacing: -0.01em;
}
.breadcrumb { color: var(--muted); font-size: 0.88rem; margin-bottom: 24px; }
.breadcrumb a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(600px 300px at 15% 20%, rgba(183, 148, 255, 0.22), transparent 65%),
        radial-gradient(500px 260px at 90% 90%, rgba(255, 143, 201, 0.18), transparent 60%),
        linear-gradient(160deg, var(--panel-2), var(--panel));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 64px 44px;
    margin-bottom: 32px;
    box-shadow: var(--shadow);
}
.hero::after {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    pointer-events: none;
}
.hero-text { position: relative; }
.hero-text h1 {
    margin: 0 0 10px; font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 800;
    letter-spacing: -0.02em;
}
.hero-text p { margin: 0; color: var(--muted); font-size: 1.1rem; max-width: 46ch; }

/* ---------- Toolbar / filters ---------- */
.shop-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 22px; flex-wrap: wrap; }
.shop-toolbar input[type=search] {
    flex: 1; min-width: 220px; padding: 12px 18px; border-radius: var(--radius-pill);
    border: 1px solid var(--border); background: var(--panel-alt); color: var(--text);
    font-size: 0.95rem; font-family: inherit; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.shop-toolbar input[type=search]::placeholder { color: var(--muted-2); }
.shop-toolbar input[type=search]:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(183, 148, 255, 0.15);
}
.category-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.pill {
    padding: 8px 18px; border-radius: var(--radius-pill); border: 1px solid var(--border);
    color: var(--muted); font-size: 0.88rem; font-weight: 500; background: var(--panel-alt);
    transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease);
}
.pill:hover { border-color: var(--accent); color: var(--text); }
.pill.active {
    background: var(--accent-grad); color: #1a1330; border-color: transparent;
    font-weight: 700; box-shadow: var(--shadow-glow);
}

/* ---------- Product grid ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
    gap: 26px;
}
.product-card {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    color: var(--text);
    transition: transform .25s var(--ease), border-color .2s var(--ease);
    display: block;
    /* Skip layout/style/paint work for cards that are off-screen — huge win on long
       product grids, the browser only "does" the cards actually near the viewport.
       `auto` (vs. a bare length) tells the browser to remember each card's real
       measured height after it first renders, instead of always guessing 380px —
       that guess was off for a lot of cards, which forced a layout reflow + visible
       jump every time an off-screen card crossed into view during a fast scroll. */
    content-visibility: auto;
    contain-intrinsic-size: auto 380px;
    contain: layout style paint;
}
/* The hover glow lives on a pseudo-element that only ever animates opacity, which the
   compositor can do on its own thread. Animating box-shadow directly (the old way)
   forces a repaint of the whole card on every single hover-transition frame. */
.product-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: opacity .25s var(--ease);
    pointer-events: none;
}
.product-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-strong);
}
.product-card:hover::before {
    opacity: 1;
}
.product-card.is-out-of-stock { opacity: 0.6; }
.product-image { position: relative; aspect-ratio: 1/1; background: var(--panel-alt); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.product-card:hover .product-image img { transform: scale(1.08); }
.no-image { color: var(--muted-2); font-size: 0.85rem; }
.no-image.large {
    width: 100%; height: 400px; display: flex; align-items: center; justify-content: center;
    background: var(--panel-alt); border-radius: var(--radius-lg); border: 1px solid var(--border);
}
.product-info { padding: 18px; }
.product-category {
    display: inline-block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--accent-3); margin-bottom: 6px; font-weight: 700;
}
.product-info h2 { font-size: 1.02rem; font-weight: 600; margin: 0 0 8px; line-height: 1.35; }
.price { color: var(--text); font-weight: 700; font-size: 1.05rem; }
.price.large { font-size: 1.7rem; }
.price-was { color: var(--muted-2); font-weight: 400; text-decoration: line-through; font-size: 0.85rem; display: block; margin: 2px 0 0; white-space: nowrap; }
.stock-ok { color: var(--success); font-size: 0.9rem; font-weight: 600; }

/* Badges */
.badge {
    position: absolute;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.16);
    white-space: nowrap;
    width: max-content;
    z-index: 2;
    /* No backdrop-filter here on purpose — every product card renders one of these,
       and blurring per-badge across a whole grid is a major, easily-avoided GPU cost. */
}
.badge.inline { position: static; display: inline-block; margin: 8px 0 14px; box-shadow: none; border: none; }

/* Sale lives top-left. Stock/low-stock live bottom-left instead of stacking under
   the sale badge in the same corner — the old vertical stack (top: 48px) landed
   squarely on the middle of the product photo. Separate corners means a card can
   show both a sale badge and a stock badge at once without ever overlapping the
   product itself, and no vertical-offset math is needed at all. */
.badge-sale {
    top: 10px;
    left: 10px;
    background: var(--accent-2);
    color: #33081f;
}
.badge-stock {
    bottom: 10px;
    left: 10px;
    background: var(--error);
    color: #000;
}
.badge.badge-stock.inline { left: auto; }
.badge-low {
    bottom: 10px;
    left: 10px;
    background: var(--warning);
    color: #332406;
}

/* ---------- Product detail ---------- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 52px; align-items: start; }
.product-detail-image img {
    width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow); border: 1px solid var(--border);
}
.description { color: var(--muted); margin: 18px 0; line-height: 1.7; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 12px 26px;
    border-radius: var(--radius-pill);
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.92rem;
    font-family: inherit;
    transition: transform .15s var(--ease), box-shadow .2s var(--ease), opacity .15s var(--ease), background .15s var(--ease);
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--accent-grad); color: #1a1330; box-shadow: var(--shadow-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(183,148,255,0.35), 0 18px 34px -12px rgba(183,148,255,0.45); color: #1a1330; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-secondary { background: var(--panel-alt); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--accent); color: var(--text); background: rgba(183,148,255,0.08); }
.btn-link { background: none; border: none; color: var(--error); cursor: pointer; text-decoration: underline; font-size: 0.9rem; font-family: inherit; }
.btn-link:hover { color: #ff9494; }

.add-to-cart-form { display: flex; flex-direction: column; gap: 12px; max-width: 220px; }
.add-to-cart-form label { font-weight: 600; font-size: 0.9rem; color: var(--muted); }
.add-to-cart-form input[type=number] {
    padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--panel-alt); color: var(--text); font-family: inherit;
}

/* ---------- Related / featured ---------- */
.featured-section, .related-section { margin-top: 24px; }

/* ---------- Cart ---------- */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.cart-table th {
    padding: 12px 14px; text-align: left; font-size: 0.78rem; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--muted-2); font-weight: 700; border-bottom: 1px solid var(--border-strong);
}
.cart-table td { padding: 16px 14px; border-bottom: 1px solid var(--border); }
.qty-input {
    width: 64px; padding: 8px; background: var(--panel-alt); border: 1px solid var(--border);
    color: var(--text); border-radius: var(--radius-sm); font-family: inherit;
}
.cart-actions { margin-bottom: 24px; }
.cart-total { font-size: 1.3rem; font-weight: 700; margin-bottom: 24px; }
.checkout-btn { margin-top: 10px; }
.flash-notice {
    background: rgba(255, 200, 96, 0.1); border: 1px solid rgba(255, 200, 96, 0.4); color: var(--warning);
    padding: 12px 18px; border-radius: var(--radius); margin-bottom: 18px; font-size: 0.92rem;
}

/* ---------- Forms ---------- */
.checkout-form, .admin-form { display: flex; flex-direction: column; gap: 14px; max-width: 500px; }
.checkout-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkout-form .form-row > div { display: flex; flex-direction: column; gap: 6px; }
.checkout-form .form-row label { margin-top: 0; }
.phone-input-group { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--panel-alt); }
.phone-input-group:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(183, 148, 255, 0.15); }
.phone-prefix { display: flex; align-items: center; padding: 0 12px; background: var(--panel-2); color: var(--muted); font-weight: 700; border-right: 1px solid var(--border); user-select: none; }
.phone-input-group input { border: none !important; box-shadow: none !important; border-radius: 0 !important; flex: 1; }
.phone-input-group input:focus { box-shadow: none !important; }
.field-hint { margin: -6px 0 0; font-size: 0.78rem; color: var(--muted-2); }
.phone-input-group.is-invalid { border-color: var(--error); }
.checkout-form label, .admin-form label { font-weight: 600; font-size: 0.9rem; margin-top: 6px; color: var(--muted); }
.checkout-form input, .checkout-form select, .checkout-form textarea,
.admin-form input, .admin-form select, .admin-form textarea {
    padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--panel-alt); color: var(--text); font-family: inherit; font-size: 0.95rem;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.checkout-form input:focus, .checkout-form select:focus, .checkout-form textarea:focus,
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(183, 148, 255, 0.15);
}
.checkout-summary { margin: 18px 0; font-size: 1.15rem; font-weight: 700; }
.note { color: var(--muted-2); font-size: 0.85rem; margin-top: 24px; line-height: 1.6; }
.error-msg {
    color: var(--error); background: rgba(255, 107, 107, 0.08); border: 1px solid rgba(255, 107, 107, 0.3);
    padding: 10px 16px; border-radius: var(--radius-sm); font-size: 0.9rem;
}
.empty-state { color: var(--muted); font-size: 1rem; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row > div { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 6px; }
.checkbox-label { display: flex; align-items: center; gap: 10px; font-weight: 500 !important; color: var(--text) !important; }
.checkbox-label input { width: auto; accent-color: var(--accent); }
.track-form { max-width: 440px; margin-bottom: 28px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; padding: 0; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 8px; margin-top: 36px; flex-wrap: wrap; }
.page-link {
    padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-weight: 600; font-size: 0.9rem; transition: all .15s var(--ease);
}
.page-link:hover { border-color: var(--accent); color: var(--accent); }
.page-link.active { background: var(--accent-grad); color: #1a1330; font-weight: 800; border-color: transparent; }

/* ---------- Order tracking ---------- */
.order-tracking {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 30px; margin-top: 24px;
    box-shadow: var(--shadow);
}
.status-timeline { display: flex; list-style: none; padding: 0; margin: 24px 0; gap: 6px; }
.status-timeline li {
    flex: 1; text-align: center; padding: 12px 4px 0; border-top: 4px solid var(--border);
    color: var(--muted-2); font-size: 0.82rem; font-weight: 600; border-radius: 4px 4px 0 0;
}
.status-timeline li.done { border-top-color: var(--accent); color: var(--text); }
.badge-status { position: static; display: inline-block; box-shadow: none; }
.badge-status.status-pending { background: var(--warning); color: #332406; }
.badge-status.status-processing { background: var(--accent); color: #1a1330; }
.badge-status.status-shipped { background: var(--accent-2); color: #33081f; }
.badge-status.status-delivered { background: var(--success); color: #06331a; }
.badge-status.status-cancelled { background: var(--error); color: #330a0a; }

/* ---------- Admin ---------- */
.admin-header { display:flex; justify-content: space-between; align-items:center; margin-bottom: 28px; flex-wrap: wrap; gap: 14px; }
.admin-header h1 { font-size: 1.6rem; font-weight: 800; margin: 0; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; margin-bottom: 32px; }
.stat-card {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px;
    display: flex; flex-direction: column; gap: 6px; transition: border-color .15s var(--ease);
    contain: layout style paint;
}
.stat-card:hover { border-color: var(--border-strong); }
.stat-card.stat-warning { border-color: rgba(255, 200, 96, 0.5); }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--text); }
.stat-card.stat-warning .stat-value { color: var(--warning); }
.stat-label { color: var(--muted-2); font-size: 0.82rem; font-weight: 500; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
    padding: 10px 12px; text-align:left; font-size: 0.76rem; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--muted-2); font-weight: 700; border-bottom: 1px solid var(--border-strong);
}
.admin-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tbody tr { transition: background .12s var(--ease); }
.admin-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.admin-table img { width: 52px; height: 52px; object-fit: cover; border-radius: var(--radius-sm); }
.admin-actions a { margin-right: 14px; font-weight: 600; font-size: 0.9rem; }
.status-form { display: inline-block; }
.status-select {
    padding: 7px 10px; font-size: 0.85rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--panel-alt); color: var(--text); font-family: inherit;
}
.login-box {
    max-width: 380px; margin: 80px auto; background: linear-gradient(180deg, var(--panel-2), var(--panel));
    padding: 36px; border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.login-box h1 { font-size: 1.5rem; margin-top: 0; }
.flash-success {
    color: var(--success); background: rgba(95, 230, 160, 0.08); border: 1px solid rgba(95, 230, 160, 0.3);
    padding: 10px 16px; border-radius: var(--radius-sm); font-size: 0.9rem; display: inline-block;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--panel); border-top: 1px solid var(--border); margin-top: 70px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; padding: 48px 0 24px; }
.footer-col h3 { margin: 0 0 8px; font-size: 1.2rem; font-weight: 800; }
.footer-col h4 { margin: 0 0 12px; color: var(--muted-2); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col a { color: var(--muted); }
.footer-col a:hover { color: var(--accent); }
.footer-col p { color: var(--muted); margin: 0; max-width: 34ch; }
.footer-bottom { border-top: 1px solid var(--border); padding: 18px 0; color: var(--muted-2); font-size: 0.85rem; }

/* ---------- Scrollbar (webkit) ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--panel-alt); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-dark); }

/* ---------- Inline icons (replace emoji glyphs) ---------- */
.icon { width: 18px; height: 18px; flex-shrink: 0; display: inline-block; vertical-align: -4px; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 30px; height: 30px; }
.icon-accent { color: var(--accent); }

/* ---------- Logo image (optional, shown if logo.png exists in site root) ---------- */
.logo-img { height: 34px; width: auto; display: block; }

/* ---------- Mobile nav toggle ---------- */
.nav-toggle {
    display: none; flex-direction: column; justify-content: center; gap: 5px;
    width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--panel-alt); cursor: pointer; padding: 0;
}
.nav-toggle span { display: block; width: 18px; height: 2px; margin: 0 auto; background: var(--text); border-radius: 2px; transition: transform .2s var(--ease), opacity .2s var(--ease); }
.nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero actions ---------- */
.hero-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; position: relative; }

/* ---------- Wishlist ---------- */
.wishlist-form { position: absolute; top: 12px; right: 12px; z-index: 2; margin: 0; }
.product-card { position: relative; }
.product-card-link { display: block; color: var(--text); }
.wishlist-btn {
    width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border);
    background: rgba(10, 10, 20, 0.72); color: rgba(255,255,255,0.55);
    font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: transform .2s var(--ease), color .2s var(--ease), background .2s var(--ease);
}
.wishlist-btn:hover { transform: scale(1.12); color: var(--accent-2); }
.wishlist-btn.is-active { color: var(--accent-2); background: rgba(255, 143, 201, 0.15); animation: heartPop .35s var(--ease); }
.wishlist-btn-lg { width: 46px; height: 46px; font-size: 1.25rem; flex-shrink: 0; }
@keyframes heartPop { 0% { transform: scale(0.7); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.product-actions-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.wishlist-page-grid .product-card { animation: none; }
.empty-wishlist-icon { display: inline-flex; color: var(--muted-2); margin-bottom: 8px; }

/* ---------- Quantity stepper ---------- */
.qty-stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--panel-alt); }
.qty-stepper button {
    width: 36px; border: none; background: transparent; color: var(--text); font-size: 1.1rem;
    cursor: pointer; font-family: inherit; transition: background .15s var(--ease);
}
.qty-stepper button:hover { background: rgba(183, 148, 255, 0.14); color: var(--accent); }
.qty-stepper input { border: none !important; text-align: center; width: 48px; background: transparent !important; box-shadow: none !important; }
.qty-stepper input:focus { outline: none; }

/* ---------- Toasts ---------- */
.toast-container {
    position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px;
    max-width: min(360px, calc(100vw - 32px));
}
.toast {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius);
    background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--border-strong);
    box-shadow: var(--shadow); color: var(--text); font-size: 0.9rem; font-weight: 600;
    transform: translateX(120%) scale(0.95); opacity: 0; transition: transform .35s var(--ease), opacity .3s var(--ease);
    will-change: transform, opacity;
}
.toast.show { transform: translateX(0) scale(1); opacity: 1; }
.toast.hide { transform: translateX(30px) scale(0.97); opacity: 0; }
.toast-msg { flex: 1; }
.toast-close { background: none; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; line-height: 1; padding: 0; }
.toast-close:hover { color: var(--text); }
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--error); }
.toast-cart { border-left: 3px solid var(--accent); }
.toast-info { border-left: 3px solid var(--accent-3); }
.cart-count.pulse { animation: pulse .6s var(--ease); }
@keyframes pulse { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }

/* ---------- Back to top ---------- */
.back-to-top {
    position: fixed; bottom: 26px; right: 26px; width: 46px; height: 46px; border-radius: 50%;
    background: var(--accent-grad); color: #1a1330; border: none; font-size: 1.2rem; font-weight: 800;
    cursor: pointer; box-shadow: var(--shadow-glow); z-index: 90;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transform: translateY(12px);
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
    will-change: transform, opacity;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-3px); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- Newsletter (footer) ---------- */
.newsletter-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.newsletter-form input[type=email] {
    flex: 1; min-width: 160px; padding: 10px 14px; border-radius: var(--radius-pill); border: 1px solid var(--border);
    background: var(--panel-alt); color: var(--text); font-family: inherit; font-size: 0.88rem;
}
.newsletter-form input[type=email]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(183,148,255,0.15); }
.newsletter-form .btn { padding: 10px 20px; font-size: 0.85rem; }
.social-row { display: flex; gap: 10px; margin-top: 6px; }
.social-row a {
    width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); display: flex;
    align-items: center; justify-content: center; color: var(--muted); font-size: 0.95rem;
    transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.social-row a:hover { color: #1a1330; background: var(--accent-grad); border-color: transparent; transform: translateY(-3px); }

/* ---------- Info pages (About / FAQ / Contact / Shipping / Privacy) ---------- */
.info-page { max-width: 780px; }
.info-page p, .info-page li { color: var(--muted); line-height: 1.75; }
.info-page h2 { margin-top: 40px; font-size: 1.25rem; }
.info-hero { margin-bottom: 36px; }
.info-hero p { color: var(--muted); font-size: 1.05rem; max-width: 60ch; }
.value-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; margin: 28px 0; }
.value-card {
    background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 22px; transition: transform .2s var(--ease), border-color .2s var(--ease);
    contain: layout style paint;
}
.value-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.value-card .value-icon { margin-bottom: 10px; display: inline-flex; }
.value-card h3 { margin: 0 0 6px; font-size: 1rem; }
.value-card p { margin: 0; font-size: 0.9rem; }
.faq-item {
    border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden;
    background: var(--panel-alt);
}
.faq-item summary {
    padding: 16px 20px; cursor: pointer; font-weight: 700; list-style: none; display: flex;
    justify-content: space-between; align-items: center; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.3rem; color: var(--accent); transition: transform .2s var(--ease); }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 20px 18px; margin: 0; }
.contact-layout { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 44px; align-items: start; }
.contact-info-card {
    background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow);
}
.contact-info-card h3 { margin-top: 0; }
.contact-info-card .info-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; color: var(--muted); }
.contact-info-card .info-row strong { color: var(--text); display: block; }

/* ---------- Order detail items (checkout/order success) ---------- */
.order-items-list { width: 100%; margin: 18px 0; }
.mini-summary-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.92rem; color: var(--muted); }
.mini-summary-row strong { color: var(--text); }
.mini-summary-total { display: flex; justify-content: space-between; padding-top: 14px; font-size: 1.15rem; font-weight: 800; }
.success-icon {
    width: 64px; height: 64px; border-radius: 50%; background: var(--accent-grad); display: flex;
    align-items: center; justify-content: center; font-size: 1.8rem; color: #1a1330; margin-bottom: 18px;
    box-shadow: var(--shadow-glow); animation: heartPop .5s var(--ease);
}
.order-success { max-width: 560px; }

/* ---------- Admin: filters / quick actions ---------- */
.admin-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.admin-toolbar input, .admin-toolbar select {
    padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--panel-alt); color: var(--text); font-family: inherit; font-size: 0.88rem;
}
.admin-toolbar input[type=search] { min-width: 200px; flex: 1; }
.quick-stock { display: inline-flex; align-items: center; gap: 4px; }
.quick-stock button {
    width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); background: var(--panel-alt);
    color: var(--text); cursor: pointer; font-size: 0.85rem; line-height: 1; padding: 0;
}
.quick-stock button:hover { border-color: var(--accent); color: var(--accent); }
.quick-stock span { min-width: 22px; text-align: center; font-weight: 700; }
.star-toggle { background: none; border: none; cursor: pointer; color: var(--muted-2); transition: transform .15s var(--ease), color .15s var(--ease); padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.star-toggle.is-featured { color: var(--warning); }
.star-toggle:hover { transform: scale(1.2); }
.admin-export-row { display: flex; gap: 10px; flex-wrap: wrap; }
.badge-count {
    background: var(--error); color: #fff; border-radius: var(--radius-pill); font-size: 0.68rem;
    font-weight: 800; padding: 1px 7px; margin-left: 6px; vertical-align: top;
}
.mini-bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 110px; margin: 8px 0 4px; }
.mini-bar-chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.mini-bar-chart .bar {
    width: 100%; max-width: 30px; background: var(--accent-grad); border-radius: 6px 6px 2px 2px;
    min-height: 3px; transition: transform .2s var(--ease); box-shadow: var(--shadow-glow);
}
.mini-bar-chart .bar-col:hover .bar { transform: scaleY(1.04); }
.mini-bar-chart .bar-label { font-size: 0.68rem; color: var(--muted-2); }
.dash-columns { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; margin-bottom: 40px; align-items: start; }
.dash-panel {
    background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow);
}
.dash-panel h3 { margin-top: 0; font-size: 1rem; }
.top-products-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.top-products-list li { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; color: var(--muted); border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.top-products-list li:last-child { border-bottom: none; padding-bottom: 0; }
.top-products-list strong { color: var(--text); }
.rank-badge { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--panel-alt); border: 1px solid var(--border); font-size: 0.72rem; font-weight: 800; margin-right: 8px; }
.recent-orders-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.recent-orders-list li { display: flex; justify-content: space-between; align-items: center; font-size: 0.88rem; padding-bottom: 10px; border-bottom: 1px solid var(--border); color: var(--muted); }
.recent-orders-list li:last-child { border-bottom: none; }
.messages-list { display: flex; flex-direction: column; gap: 12px; }
.message-card {
    background: var(--panel-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px;
    display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    contain: layout style paint;
}
.message-card.is-unread { border-left: 3px solid var(--accent); }
.message-card h4 { margin: 0 0 4px; }
.message-card .msg-meta { color: var(--muted-2); font-size: 0.8rem; }
.message-card .msg-body { color: var(--muted); margin: 10px 0 0; max-width: 60ch; }
.message-actions { display: flex; gap: 8px; align-self: flex-start; }
.message-actions button, .message-actions a.btn { font-size: 0.78rem; padding: 7px 14px; }
.settings-section { margin-bottom: 8px; }
.settings-section h2 { font-size: 1.05rem; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin: 32px 0 16px; }
.settings-section:first-of-type h2 { margin-top: 0; }
.settings-section input[type=range] {
    accent-color: var(--accent);
    height: 6px;
    margin: 10px 0 4px;
    cursor: pointer;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    /* Tighter container padding + a smaller card min-width so two product cards
       fit side by side on phone-width screens, instead of dropping to one. */
    .container { padding: 0 14px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .product-info { padding: 12px; }
    .product-info h2 { font-size: 0.92rem; }
    .price { font-size: 0.98rem; }
    .product-detail { grid-template-columns: 1fr; gap: 28px; }
    .header-inner { flex-wrap: wrap; gap: 12px; }
    .nav-toggle { display: flex; }
    .main-nav {
        flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 4px;
        max-height: 0; overflow: hidden; opacity: 0; transition: max-height .3s var(--ease), opacity .25s var(--ease);
    }
    .main-nav.open { max-height: 320px; opacity: 1; margin-top: 8px; }
    .main-nav a { margin-left: 0; text-align: center; }
    .hero { padding: 40px 24px; }
    .hero-text h1 { font-size: 1.9rem; }
    .footer-inner { grid-template-columns: 1fr; }
    .admin-header { flex-direction: column; align-items: flex-start; }
    .status-timeline { flex-wrap: wrap; }
    .status-timeline li { flex: 1 1 40%; }
    .contact-layout { grid-template-columns: 1fr; }
    .dash-columns { grid-template-columns: 1fr; }
    .back-to-top { bottom: 18px; right: 18px; }
    .checkout-form .form-row { grid-template-columns: 1fr; }
}