/* ═══════════════════════════════════════════════════════════
MyStore — Shared Stylesheet
Includes: variables, reset, header, footer, mobile bottom nav
═══════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────── */
:root {
--bg: #fafaf8;
--surface: #ffffff;
--border: #e8e8e4;
--border2: #d4d4cc;
--text: #1a1a18;
--muted: #6b6b65;
--accent: #1c4ed8;
--accent-h: #1e40af;
--accent-lt: #eff6ff;
--success: #059669;
--danger: #dc2626;
--warn: #d97706;
--tag-bg: #f0f0ec;
--offer-bg: #fff7ed;
--offer-border: #fed7aa;
--offer-text: #c2410c;
--bp-bg: #f0fdf4;
--bp-border: #bbf7d0;
--bp-text: #166534;
--font: 'Sora', sans-serif;
--mono: 'DM Mono', monospace;
--radius: 12px;
--hdr-h: 64px;
--footer-h: 60px; /* mobile bottom nav height */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
background: var(--bg);
color: var(--text);
font-family: var(--font);
/* leave room for mobile bottom nav */
padding-bottom: 0;
}
@media (max-width: 768px) {
body { padding-bottom: var(--footer-h); }
}

/* ── Header ────────────────────────────────────────────── */
.site-header {
background: var(--surface);
border-bottom: 1px solid var(--border);
position: sticky; top: 0; z-index: 100;
box-shadow: 0 1px 6px rgba(0,0,0,.06);

}

.site-header.compact .header-logo {
height: 36px;
width: auto;
transition: height .25s ease;
}
.header-logo {
transition: height .25s ease;
}

.header-inner {
max-width: 1240px; margin: 0 auto;
padding: .9rem 1.5rem;
display: flex; align-items: center; gap: 1.25rem;
transition: padding .25s ease;
}

/* ← THIS IS THE MISSING RULE that was never added */
.site-header.compact .header-inner {
padding: .45rem 1.5rem;
}
.header-logo { height: 55px; width: 160px; display: block; flex-shrink: 0; }

/* Search bar */
.search-bar { flex: 1; position: relative; }
.search-bar input {
width: 100%;
padding: .6rem 1rem .6rem 2.5rem;
border: 1.5px solid var(--border2);
border-radius: 999px;
font-size: .9rem; font-family: var(--font);
background: var(--bg); color: var(--text);
transition: border-color .2s, box-shadow .2s;
}
.search-bar input:focus {
outline: none; border-color: var(--accent);
box-shadow: 0 0 0 3px rgba(28,78,216,.12);
}
.search-icon {
position: absolute; left: .85rem; top: 50%;
transform: translateY(-50%);
color: var(--muted); font-size: .9rem; pointer-events: none;
}
.header-actions { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }

/* Auth buttons */
.btn-nav {
display: flex; align-items: center; gap: .4rem;
padding: .45rem .9rem; border-radius: 999px;
font-size: .82rem; font-weight: 600;
text-decoration: none; white-space: nowrap;
transition: background .15s, opacity .15s;
border: 1.5px solid var(--border2); color: var(--text);
}
.btn-nav:hover { background: var(--tag-bg); }
.btn-nav.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-nav.primary:hover { background: var(--accent-h); opacity: 1; }
.btn-nav.ghost { border-color: transparent; color: var(--muted); font-size: .78rem; padding: .4rem .6rem; }
.btn-nav.ghost:hover { color: var(--danger); background: transparent; }

/* Avatar pill */
.avatar-pill {
display: flex; align-items: center; gap: .5rem;
padding: .35rem .75rem .35rem .35rem;
border-radius: 999px; border: 1.5px solid var(--border2);
text-decoration: none; color: var(--text); font-size: .82rem; font-weight: 600;
transition: background .15s;
}
.avatar-pill:hover { background: var(--tag-bg); }
.avatar-circle {
width: 28px; height: 28px; border-radius: 50%;
background: linear-gradient(135deg, var(--accent), #7c3aed);
color: #fff; display: flex; align-items: center; justify-content: center;
font-size: .7rem; font-weight: 800; flex-shrink: 0;
}

/* Cart button */
.cart-btn {
display: flex; align-items: center; gap: .4rem;
padding: .5rem 1.1rem; border-radius: 999px;
background: var(--accent); color: #fff;
border: none; font-family: var(--font); font-size: .85rem; font-weight: 600;
cursor: pointer; white-space: nowrap;
transition: background .15s, transform .1s;
}
.cart-btn:hover { background: var(--accent-h); transform: translateY(-1px); }
.cart-count {
background: #fff; color: var(--accent);
border-radius: 999px; min-width: 18px; height: 18px;
font-size: .7rem; font-weight: 700;
display: inline-flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ── Site Footer ────────────────────────────────────────── */
.site-footer {
background: var(--surface);
border-top: 1px solid var(--border);
padding: 2.5rem 1.5rem 1.5rem;
margin-top: auto;
}
.footer-inner {
max-width: 1240px; margin: 0 auto;
display: grid;
grid-template-columns: 1.4fr 1fr 1fr 1fr;
gap: 2rem;
}
.footer-brand .footer-logo { height: 88px; margin-bottom: .85rem; }
.footer-brand p {
font-size: .82rem; color: var(--muted); line-height: 1.7; max-width: 220px;
}
.footer-col h4 {
font-size: .72rem; font-weight: 700;
text-transform: uppercase; letter-spacing: 1px;
color: var(--text); margin-bottom: .85rem;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .45rem; }
.footer-col ul li a {
font-size: .83rem; color: var(--muted); text-decoration: none;
transition: color .15s;
}
.footer-col ul li a:hover { color: var(--accent); }
.footer-bottom {
max-width: 1240px; margin: 1.75rem auto 0;
padding-top: 1.1rem; border-top: 1px solid var(--border);
display: flex; align-items: center; justify-content: space-between;
flex-wrap: wrap; gap: .5rem;
}
.footer-bottom p { font-size: .75rem; color: var(--muted); }
.footer-bottom a { color: var(--muted); text-decoration: none; }
.footer-bottom a:hover { color: var(--accent); }

/* ── Mobile Bottom Navigation ───────────────────────────── */
.mobile-bottom-nav {
display: none; /* hidden on desktop */
position: fixed;
bottom: 0; left: 0; right: 0;
height: var(--footer-h);
background: var(--surface);
border-top: 1px solid var(--border);
box-shadow: 0 -2px 12px rgba(0,0,0,.08);
z-index: 120;
align-items: stretch;
}
.mob-nav-item {
flex: 1;
display: flex; flex-direction: column;
align-items: center; justify-content: center;
gap: .2rem;
text-decoration: none;
color: var(--muted);
font-size: .62rem; font-weight: 600;
padding: .4rem .2rem;
border: none; background: none; cursor: pointer;
font-family: var(--font);
transition: color .15s, background .15s;
position: relative;
}
.mob-nav-item:hover,
.mob-nav-item.active { color: var(--accent); }
.mob-nav-item.active::before {
content: '';
position: absolute; top: 0; left: 20%; right: 20%;
height: 2.5px; border-radius: 0 0 4px 4px;
background: var(--accent);
}
.mob-nav-icon { font-size: 1.25rem; line-height: 1; }
.mob-nav-badge {
position: absolute; top: .3rem; left: 50%;
transform: translateX(2px);
background: var(--danger); color: #fff;
border-radius: 999px; min-width: 16px; height: 16px;
font-size: .6rem; font-weight: 800;
display: flex; align-items: center; justify-content: center;
padding: 0 3px; line-height: 1;
}

@media (max-width: 768px) {
.mobile-bottom-nav { display: flex; }
/* Hide desktop cart btn & auth links on mobile — handled by bottom nav */
.header-actions .cart-btn { display: none; }
.header-actions .btn-nav.ghost { display: none; }
}

/* ── Toast ──────────────────────────────────────────────── */
.toast {
position: fixed; bottom: calc(var(--footer-h) + .75rem); left: 50%;
transform: translateX(-50%) translateY(80px);
background: #1a1a18; color: #fff;
padding: .6rem 1.25rem; border-radius: 999px;
font-size: .83rem; font-weight: 500;
z-index: 300; transition: transform .3s; white-space: nowrap;
max-width: calc(100vw - 2rem); text-overflow: ellipsis; overflow: hidden;
}
.toast.show { transform: translateX(-50%) translateY(0); }
@media (min-width: 769px) {
.toast { bottom: 1.5rem; }
}

/* ── Back to top ────────────────────────────────────────── */
.back-top {
position: fixed; bottom: calc(var(--footer-h) + .75rem); right: 1.5rem;
width: 40px; height: 40px; border-radius: 50%;
background: var(--accent); color: #fff;
border: none; font-size: 1.1rem; cursor: pointer;
display: flex; align-items: center; justify-content: center;
box-shadow: 0 3px 10px rgba(0,0,0,.15);
opacity: 0; transform: translateY(10px);
transition: opacity .25s, transform .25s; z-index: 150;
}
.back-top.visible { opacity: 1; transform: translateY(0); }
@media (min-width: 769px) {
.back-top { bottom: 1.5rem; }
}

/* ── Shared Responsive Utilities ────────────────────────── */
@media (max-width: 768px) {
.header-inner { gap: .75rem; }
.btn-nav span { display: none; }
.header-logo { height: 32px; }
}
@media (max-width: 480px) {
.header-logo { height: 28px; }
}