/* ============================================================
   Mystery Box Market — storefront styles (no frameworks)
   ============================================================ */
:root{
  --ink:#1b1530; --plum:#2e1065; --plum-2:#4c1d95; --violet:#7c3aed; --violet-soft:#ede9fe;
  --coral:#ff5a36; --coral-dark:#e2401c; --lime:#16a34a; --bg:#f6f4fb; --card:#fff;
  --muted:#6b6880; --line:#e6e2f0; --radius:14px; --shadow:0 2px 10px rgba(30,16,70,.07);
  --font:"Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0}
body{font-family:var(--font);color:var(--ink);background:var(--bg);font-size:15px;line-height:1.45}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
button,input,select,textarea{font:inherit}
.container{max-width:1320px;margin:0 auto;padding:0 18px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* ---------- header ---------- */
.topbar{background:var(--plum);color:#fff;position:sticky;top:0;z-index:50}
.topbar .row{display:flex;align-items:center;gap:18px;height:72px}
.logo{display:flex;align-items:center;gap:10px;font-weight:800;font-size:19px;white-space:nowrap;letter-spacing:-.2px}
.logo-mark{width:38px;height:38px;border-radius:10px;background:var(--coral);display:grid;place-items:center;font-size:22px;font-weight:900;color:#fff;transform:rotate(-6deg)}
.logo small{display:block;font-size:11px;font-weight:500;opacity:.75;letter-spacing:.2px}
.search{flex:1;display:flex;background:#fff;border-radius:999px;overflow:hidden;height:46px;max-width:780px}
.search input{flex:1;border:0;padding:0 20px;outline:none;font-size:15px;min-width:0;color:var(--ink)}
.search button{border:0;background:var(--coral);color:#fff;width:52px;margin:4px;border-radius:999px;cursor:pointer;display:grid;place-items:center}
.search button:hover{background:var(--coral-dark)}
.hdr-link{display:flex;align-items:center;gap:8px;padding:8px 12px;border-radius:999px;font-size:13px;line-height:1.15;white-space:nowrap}
.hdr-link:hover{background:rgba(255,255,255,.12)}
.hdr-link b{display:block;font-size:14px}
.cart-link{position:relative}
.cart-count{position:absolute;top:2px;left:26px;background:var(--coral);color:#fff;font-size:11px;font-weight:800;min-width:18px;height:18px;border-radius:9px;display:grid;place-items:center;padding:0 4px}
.depts{background:var(--plum-2);color:#fff}
.depts .row{display:flex;gap:4px;overflow-x:auto;scrollbar-width:none;height:44px;align-items:center}
.depts .row::-webkit-scrollbar{display:none}
.depts a{padding:6px 14px;border-radius:999px;font-size:14px;white-space:nowrap}
.depts a:hover,.depts a.on{background:rgba(255,255,255,.16)}
.depts a.hot{color:#ffd2c7;font-weight:700}
.notice-strip{background:#fff3ee;color:#7a2a12;font-size:13px;text-align:center;padding:7px 12px;border-bottom:1px solid #ffd9cc}

/* ---------- buttons / form ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:999px;padding:11px 22px;font-weight:700;cursor:pointer;background:var(--violet);color:#fff;transition:.15s}
.btn:hover{background:var(--plum-2)}
.btn.coral{background:var(--coral)} .btn.coral:hover{background:var(--coral-dark)}
.btn.ghost{background:#fff;color:var(--ink);border:1.5px solid var(--ink)} .btn.ghost:hover{background:var(--violet-soft)}
.btn.block{width:100%}
.btn.sm{padding:7px 14px;font-size:13px}
.btn:disabled{opacity:.5;cursor:not-allowed}
label{font-size:13px;font-weight:600;display:block;margin-bottom:5px}
.input,select.input,textarea.input{width:100%;border:1.5px solid var(--line);border-radius:10px;padding:11px 13px;background:#fff;outline:none}
.input:focus{border-color:var(--violet)}
.field{margin-bottom:14px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.grid3{display:grid;grid-template-columns:2fr 1fr 1fr;gap:12px}
.alert{padding:11px 14px;border-radius:10px;font-size:14px;margin-bottom:14px}
.alert.err{background:#fee2e2;color:#991b1b}
.alert.ok{background:#dcfce7;color:#166534}

/* ---------- home ---------- */
.hero{display:grid;grid-template-columns:2fr 1fr;gap:16px;margin:20px 0}
.hero-main{border-radius:var(--radius);overflow:hidden;position:relative;min-height:340px;background:linear-gradient(120deg,#2e1065 0%,#6d28d9 55%,#ff5a36 130%);color:#fff;padding:44px;display:flex;flex-direction:column;justify-content:center}
.hero-main h1{font-size:44px;line-height:1.05;margin:0 0 12px;max-width:560px;letter-spacing:-1px}
.hero-main p{font-size:18px;max-width:480px;opacity:.9;margin:0 0 22px}
.hero-main .boxes{position:absolute;right:30px;bottom:24px;font-size:120px;opacity:.95;filter:drop-shadow(0 10px 20px rgba(0,0,0,.3));animation:bob 3.2s ease-in-out infinite}
@keyframes bob{50%{transform:translateY(-12px) rotate(-3deg)}}
.hero-side{display:grid;gap:16px}
.promo{border-radius:var(--radius);padding:24px;display:flex;flex-direction:column;justify-content:space-between;min-height:162px;color:var(--ink)}
.promo h3{margin:0 0 6px;font-size:21px}
.promo p{margin:0 0 12px;font-size:14px;opacity:.8}
.promo.a{background:#ffe4d9}.promo.b{background:#dcfce7}
.promo a{font-weight:700;text-decoration:underline}
.section{margin:30px 0}
.section-hd{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:14px}
.section-hd h2{margin:0;font-size:23px;letter-spacing:-.3px}
.section-hd a{font-size:14px;text-decoration:underline}
.cats{display:grid;grid-template-columns:repeat(8,1fr);gap:12px}
.cat{text-align:center;font-size:13px;font-weight:600}
.cat .ic{aspect-ratio:1;border-radius:50%;background:#fff;box-shadow:var(--shadow);display:grid;place-items:center;font-size:38px;margin-bottom:8px;transition:.2s}
.cat:hover .ic{transform:translateY(-4px);background:var(--violet-soft)}
.scroller{display:grid;grid-auto-flow:column;grid-auto-columns:220px;gap:14px;overflow-x:auto;padding-bottom:8px;scroll-snap-type:x mandatory}
.scroller>*{scroll-snap-align:start}
.deals-band{background:#fff;border-radius:var(--radius);padding:22px;box-shadow:var(--shadow)}
.timer{background:var(--coral);color:#fff;border-radius:8px;padding:4px 10px;font-weight:800;font-size:14px;margin-left:10px;font-variant-numeric:tabular-nums}
.how{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}
.how div{background:#fff;border-radius:var(--radius);padding:22px;box-shadow:var(--shadow)}
.how b{display:block;font-size:30px;margin-bottom:8px}
.how h4{margin:0 0 6px}
.how p{margin:0;font-size:14px;color:var(--muted)}

/* ---------- product card ---------- */
.products{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:16px}
.card{background:var(--card);border-radius:var(--radius);padding:12px;display:flex;flex-direction:column;position:relative;box-shadow:var(--shadow);transition:.18s}
.card:hover{box-shadow:0 8px 26px rgba(30,16,70,.14);transform:translateY(-2px)}
.card .img{border-radius:10px;overflow:hidden;aspect-ratio:1;background:#f2eff8;margin-bottom:10px}
.card .img img{width:100%;height:100%;object-fit:cover}
.badge{position:absolute;top:18px;left:18px;font-size:11px;font-weight:800;padding:4px 8px;border-radius:6px;background:var(--coral);color:#fff;text-transform:uppercase;letter-spacing:.3px}
.badge.low{left:auto;right:18px;background:var(--ink)}
.price{font-size:20px;font-weight:800;color:var(--ink)}
.price.deal{color:var(--lime)}
.was{font-size:13px;color:var(--muted);text-decoration:line-through;margin-left:6px;font-weight:500}
.save{font-size:12px;font-weight:700;color:var(--lime);background:#dcfce7;padding:2px 7px;border-radius:5px;display:inline-block;margin-top:4px}
.card .name{font-size:14px;margin:6px 0 4px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:40px}
.cond{font-size:12px;color:var(--muted)}
.card .btn{margin-top:auto}
.card .actions{margin-top:10px}
.oos{color:#991b1b;font-weight:700;font-size:13px}

/* ---------- shop page ---------- */
.shop{display:grid;grid-template-columns:250px 1fr;gap:22px;margin:22px 0}
.filters{background:#fff;border-radius:var(--radius);padding:18px;box-shadow:var(--shadow);align-self:start;position:sticky;top:132px}
.filters h4{margin:16px 0 8px;font-size:14px}
.filters h4:first-child{margin-top:0}
.filters .opt{display:flex;align-items:center;gap:8px;font-size:14px;padding:4px 0;cursor:pointer;font-weight:400;margin:0}
.toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;gap:12px;flex-wrap:wrap}
.toolbar h1{font-size:24px;margin:0}
.toolbar select{width:auto}
.pager{display:flex;gap:6px;justify-content:center;margin:26px 0}
.pager button{border:1.5px solid var(--line);background:#fff;border-radius:8px;min-width:38px;height:38px;cursor:pointer;font-weight:600}
.pager button.on{background:var(--ink);color:#fff;border-color:var(--ink)}
.empty{text-align:center;padding:60px 20px;color:var(--muted);background:#fff;border-radius:var(--radius)}
.filter-toggle{display:none}

/* ---------- product page ---------- */
.crumbs{font-size:13px;color:var(--muted);margin:18px 0}
.crumbs a{text-decoration:underline}
.pdp{display:grid;grid-template-columns:1.1fr 1fr;gap:34px;background:#fff;border-radius:var(--radius);padding:26px;box-shadow:var(--shadow)}
.pdp .gallery img{border-radius:12px;width:100%;aspect-ratio:1;object-fit:cover;background:#f2eff8}
.pdp h1{font-size:26px;margin:4px 0 10px;line-height:1.2}
.pdp .price{font-size:32px}
.pill{display:inline-block;font-size:12px;font-weight:700;padding:4px 10px;border-radius:999px;background:var(--violet-soft);color:var(--plum-2)}
.buybox{border:1.5px solid var(--line);border-radius:12px;padding:18px;margin:18px 0}
.qty{display:inline-flex;align-items:center;border:1.5px solid var(--line);border-radius:999px;overflow:hidden}
.qty button{border:0;background:#fff;width:38px;height:38px;font-size:18px;cursor:pointer}
.qty input{width:44px;border:0;text-align:center;outline:none;font-weight:700}
.facts{list-style:none;padding:0;margin:14px 0 0;font-size:14px}
.facts li{padding:7px 0;border-bottom:1px solid var(--line);display:flex;gap:10px}
.cond-note{font-size:13px;background:#fff7ed;border-radius:10px;padding:12px;color:#7c2d12;margin-top:14px}

/* ---------- cart / checkout ---------- */
.page-title{font-size:26px;margin:22px 0 14px}
.two-col{display:grid;grid-template-columns:1fr 360px;gap:22px;align-items:start;margin-bottom:40px}
.panel{background:#fff;border-radius:var(--radius);padding:20px;box-shadow:var(--shadow)}
.panel h3{margin:0 0 14px}
.line{display:grid;grid-template-columns:84px 1fr auto;gap:14px;padding:14px 0;border-bottom:1px solid var(--line);align-items:center}
.line:last-child{border-bottom:0}
.line img{border-radius:10px;width:84px;height:84px;object-fit:cover}
.line .nm{font-weight:600;font-size:15px}
.link-btn{border:0;background:none;color:var(--muted);text-decoration:underline;cursor:pointer;font-size:13px;padding:0}
.sum-row{display:flex;justify-content:space-between;padding:6px 0;font-size:15px}
.sum-row.total{font-size:19px;font-weight:800;border-top:1px solid var(--line);margin-top:8px;padding-top:12px}
.ship-bar{background:var(--violet-soft);border-radius:10px;padding:10px 12px;font-size:13px;margin-bottom:12px}
.ship-bar .bar{height:6px;border-radius:3px;background:#fff;margin-top:6px;overflow:hidden}
.ship-bar .bar i{display:block;height:100%;background:var(--violet)}
.pay-opt{display:flex;gap:10px;align-items:flex-start;border:1.5px solid var(--line);border-radius:10px;padding:12px;margin-bottom:10px;cursor:pointer;font-weight:400}
.pay-opt:has(input:checked){border-color:var(--violet);background:#faf8ff}
.pay-opt small{display:block;color:var(--muted)}
.status{display:inline-block;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:700;text-transform:capitalize;background:#eee}
.status.pending{background:#fef3c7;color:#92400e}.status.processing{background:#dbeafe;color:#1e40af}
.status.shipped{background:#ede9fe;color:#5b21b6}.status.delivered{background:#dcfce7;color:#166534}.status.cancelled{background:#fee2e2;color:#991b1b}
.tabs{display:flex;gap:6px;margin-bottom:16px}
.tabs button{border:0;background:none;padding:8px 14px;border-radius:999px;font-weight:700;cursor:pointer;color:var(--muted)}
.tabs button.on{background:var(--ink);color:#fff}
.auth-box{max-width:430px;margin:40px auto}

/* ---------- toast / footer ---------- */
.toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%) translateY(120px);background:var(--ink);color:#fff;padding:13px 20px;border-radius:12px;font-weight:600;z-index:100;transition:.3s;display:flex;gap:14px;align-items:center;box-shadow:0 10px 30px rgba(0,0,0,.25)}
.toast.show{transform:translateX(-50%) translateY(0)}
.toast a{color:#ffd2c7;text-decoration:underline}
footer{background:var(--ink);color:#d7d3e6;margin-top:50px;padding:40px 0 24px;font-size:14px}
footer .cols{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:24px}
footer h4{color:#fff;margin:0 0 10px}
footer a{display:block;padding:3px 0;opacity:.85}
footer a:hover{opacity:1;text-decoration:underline}
.disclaimer{border-top:1px solid rgba(255,255,255,.12);margin-top:26px;padding-top:16px;font-size:12px;opacity:.7}
.skeleton{background:linear-gradient(90deg,#eee 25%,#f6f6f6 50%,#eee 75%);background-size:200% 100%;animation:sk 1.2s infinite;border-radius:var(--radius);min-height:300px}
@keyframes sk{to{background-position:-200% 0}}

/* ---------- responsive ---------- */
@media (max-width:1000px){
  .hero{grid-template-columns:1fr}.hero-side{grid-template-columns:1fr 1fr}
  .cats{grid-template-columns:repeat(4,1fr)}
  .how{grid-template-columns:1fr 1fr}
  .shop{grid-template-columns:1fr}
  .filters{display:none;position:static}.filters.open{display:block}
  .filter-toggle{display:inline-flex}
  .pdp,.two-col{grid-template-columns:1fr}
  footer .cols{grid-template-columns:1fr 1fr}
}
@media (max-width:720px){
  .topbar .row{flex-wrap:wrap;height:auto;padding:10px 14px;gap:10px}
  .search{order:3;flex-basis:100%;max-width:none}
  .hdr-link span{display:none}
  .hdr-link{padding:6px}
  .hdr-link .cart-total{display:none}
  .logo{font-size:16px;flex:1}
  .logo-mark{width:32px;height:32px;font-size:18px}
  .topbar .row{gap:4px}
  .logo small{display:none}
  .hero-main{padding:28px;min-height:300px}.hero-main h1{font-size:32px}.hero-main .boxes{font-size:70px}
  .hero-side{grid-template-columns:1fr}
  .products{grid-template-columns:repeat(2,1fr);gap:10px}
  .grid2,.grid3{grid-template-columns:1fr}
  .line{grid-template-columns:64px 1fr;}.line img{width:64px;height:64px}.line>div:last-child{grid-column:2}
  .filters{top:0}
}
