@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f4f7fa; --surface: #ffffff; --surface-2: #eef3f7; --text: #0b1520; --muted: #5a6b7b;
  --line: #dfe6ec; --accent: #4fc3f7; --accent-ink: #0277bd; --on-accent: #06121c;
  --danger: #d93b3b; --ok: #1f9d55; --shadow: 0 10px 30px rgba(11, 21, 32, .08);
  --radius: 14px; --header-h: 68px; --maxw: 1440px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0a0f15; --surface: #111922; --surface-2: #17222e; --text: #e7f0f7; --muted: #8ea3b5;
  --line: #213040; --accent: #4fc3f7; --accent-ink: #4fc3f7; --on-accent: #06121c;
  --shadow: 0 12px 34px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 64px); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 15px/1.55 Manrope, system-ui, -apple-system, Segoe UI, sans-serif; -webkit-font-smoothing: antialiased; }
img, video { max-width: 100%; display: block; }
a { color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(16px, 3vw, 40px); }

/* ───── Buttons & inputs ───── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent;
  background: var(--accent); color: var(--on-accent); font-weight: 700; padding: 10px 18px; border-radius: 10px;
  cursor: pointer; text-decoration: none; transition: transform .15s, filter .15s, background .2s; white-space: nowrap; }
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.dark { background: var(--text); color: var(--bg); }
.btn.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer; position: relative; transition: background .2s; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
textarea.input { resize: vertical; min-height: 84px; }

/* ───── Header (always visible) ───── */
.header { position: fixed; inset: 0 0 auto 0; height: var(--header-h); z-index: 50;
  background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line); }
.header .wrap { height: 100%; display: flex; align-items: center; gap: 18px; max-width: none; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); flex-shrink: 0; }
.brand img { height: 42px; width: auto; }
.brand .name { font-weight: 800; font-size: 20px; letter-spacing: .02em; text-transform: uppercase; line-height: 1; }
.brand .name small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; color: var(--muted); margin-top: 4px; }
.logo-dark { display: none; } [data-theme="dark"] .logo-dark { display: block; } [data-theme="dark"] .logo-light { display: none; }
.header .search { flex: 1; max-width: 520px; margin-left: auto; position: relative; }
.header .search input { padding-left: 40px; border-radius: 12px; background: var(--surface-2); border-color: transparent; }
.header .search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--muted); }
.header-actions { display: flex; gap: 10px; align-items: center; margin-left: auto; }
.cart-btn { width: auto; padding: 0 14px; gap: 8px; display: flex; font-weight: 700; background: var(--text); color: var(--bg); border-color: var(--text); }
.cart-btn:hover { background: var(--text); filter: brightness(1.15); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--on-accent);
  font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.badge.bump { animation: bump .4s; }
@keyframes bump { 40% { transform: scale(1.35); } }
main { padding-top: var(--header-h); }

/* ───── Promotion banner ───── */
.promo { position: relative; height: clamp(420px, 72vh, 760px); overflow: hidden; background: #070c12; color: #fff; isolation: isolate; }
.slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .9s ease, visibility .9s; }
.slide.active { opacity: 1; visibility: visible; }
.slide .media { position: absolute; inset: 0; z-index: -1; }
.slide .media img, .slide .media video, .slide .media canvas { width: 100%; height: 100%; object-fit: cover; }
.slide.active .media img { animation: kenburns 9s ease-out forwards; }
@keyframes kenburns { from { transform: scale(1.12); } to { transform: scale(1); } }
.slide::after { content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(5,10,16,.86) 0%, rgba(5,10,16,.55) 45%, rgba(5,10,16,0) 80%); }
.slide .copy { position: absolute; left: 0; right: 0; bottom: 0; top: 0; display: flex; flex-direction: column; justify-content: center;
  max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 5vw, 72px); }
.slide .copy > * { max-width: 640px; opacity: 0; transform: translateY(24px); }
.slide.active .copy > * { animation: rise .8s cubic-bezier(.2,.7,.2,1) forwards; }
.slide.active .copy > *:nth-child(2) { animation-delay: .12s; } .slide.active .copy > *:nth-child(3) { animation-delay: .24s; }
.slide.active .copy > *:nth-child(4) { animation-delay: .36s; }
@keyframes rise { to { opacity: 1; transform: none; } }
.slide .kicker { display: inline-flex; align-self: flex-start; gap: 8px; align-items: center; font-size: 12px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent); border: 1px solid rgba(79,195,247,.4); padding: 6px 12px; border-radius: 99px; background: rgba(79,195,247,.08); }
.slide h1 { font-size: clamp(32px, 5vw, 64px); line-height: 1.05; margin: 18px 0 14px; font-weight: 800; letter-spacing: -.02em; }
.slide p { font-size: clamp(15px, 1.4vw, 19px); color: #c7d6e2; margin: 0 0 26px; }
.slide .btn { align-self: flex-start; padding: 13px 24px; font-size: 16px; }
.promo-nav { position: absolute; z-index: 5; bottom: 26px; left: 0; right: 0; max-width: var(--maxw); margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 72px); display: flex; align-items: center; gap: 10px; }
.dots { display: flex; gap: 8px; }
.dot { width: 44px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.25); border: 0; padding: 0; cursor: pointer; overflow: hidden; position: relative; }
.dot i { position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.dot.active i { animation: fill var(--dur, 7s) linear forwards; }
.promo.paused .dot.active i { animation-play-state: paused; }
@keyframes fill { to { transform: scaleX(1); } }
.promo-nav .arrows { margin-left: auto; display: flex; gap: 8px; }
.promo-nav .icon-btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #fff; backdrop-filter: blur(6px); }
.promo-nav .icon-btn:hover { background: rgba(255,255,255,.18); }
.promo .empty { display: grid; place-items: center; height: 100%; color: #8ea3b5; }

/* ───── Catalog ───── */
.catbar { position: sticky; top: var(--header-h); z-index: 30; background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.catbar .wrap { display: flex; gap: 10px; align-items: center; padding-top: 12px; padding-bottom: 12px; max-width: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 99px; cursor: pointer;
  font-weight: 600; font-size: 14px; display: flex; gap: 6px; align-items: center; transition: all .15s; }
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .n { font-size: 12px; opacity: .6; }
.catbar select { width: auto; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 34px 0 18px; }
.section-head h2 { margin: 0; font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -.01em; }
.section-head .muted { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; padding-bottom: 60px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s, box-shadow .2s, border-color .2s; animation: cardin .5s both; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
@keyframes cardin { from { opacity: 0; transform: translateY(14px); } }
.card .thumb { aspect-ratio: 4/3; background: var(--surface-2); cursor: pointer; overflow: hidden; position: relative; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .thumb img { transform: scale(1.05); }
.card .tag { position: absolute; top: 10px; left: 10px; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 99px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .cat { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.card h3 { margin: 0; font-size: 16px; line-height: 1.3; cursor: pointer; }
.card .desc { color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prices { display: flex; flex-direction: column; gap: 2px; margin-top: auto; padding-top: 8px; }
.price { font-size: 21px; font-weight: 800; }
.price small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.wprice { font-size: 13px; color: var(--accent-ink); font-weight: 700; }
.card .actions { display: flex; gap: 8px; margin-top: 12px; }
.card .actions .btn { flex: 1; }
.stock-out { color: var(--danger); font-size: 13px; font-weight: 600; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); grid-column: 1 / -1; }

/* qty stepper */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.qty button { width: 34px; height: 36px; border: 0; background: transparent; cursor: pointer; font-size: 18px; }
.qty button:hover { background: var(--surface-2); }
.qty input { width: 52px; height: 36px; text-align: center; border: 0; background: transparent; outline: none; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ───── Drawer (basket) & modal ───── */
.scrim { position: fixed; inset: 0; background: rgba(4,8,12,.5); z-index: 80; opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--surface); z-index: 90;
  transform: translateX(100%); transition: transform .32s cubic-bezier(.2,.7,.2,1); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.drawer.open { transform: none; }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer header h3 { margin: 0; font-size: 19px; }
.drawer .content { flex: 1; overflow-y: auto; padding: 8px 20px; }
.drawer footer { border-top: 1px solid var(--line); padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.line img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.line .t { font-weight: 700; font-size: 14px; line-height: 1.3; }
.line .u { font-size: 12.5px; color: var(--muted); margin: 3px 0 8px; }
.line .hint { font-size: 12px; color: var(--accent-ink); font-weight: 600; margin-top: 6px; }
.line .lt { font-weight: 800; text-align: right; }
.line .rm { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12px; padding: 4px 0; margin-top: 6px; }
.line .rm:hover { color: var(--danger); }
.wh-badge { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; padding: 2px 7px; border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-ink); text-transform: uppercase; margin-left: 4px; }
.total-row { display: flex; justify-content: space-between; font-size: 18px; font-weight: 800; }
.save-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--ok); font-weight: 700; }
.modal { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 20px; pointer-events: none; }
.modal .box { width: min(980px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: 18px;
  box-shadow: var(--shadow); border: 1px solid var(--line); pointer-events: auto; opacity: 0; transform: translateY(20px) scale(.98); transition: all .25s; }
.modal.open .box { opacity: 1; transform: none; }
.modal:not(.open) { visibility: hidden; }
.pd { display: grid; grid-template-columns: 1fr 1fr; }
.pd .img { background: var(--surface-2); min-height: 320px; }
.pd .img img { width: 100%; height: 100%; object-fit: cover; }
.pd .info { padding: 26px; display: flex; flex-direction: column; gap: 12px; position: relative; }
.pd h2 { margin: 0; font-size: 24px; line-height: 1.2; padding-right: 40px; }
.pd .close { position: absolute; top: 16px; right: 16px; }
.tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tier { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.tier.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.tier .l { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.tier .v { font-size: 20px; font-weight: 800; }
.specs { width: 100%; border-collapse: collapse; font-size: 14px; }
.specs th, .specs td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.specs th { color: var(--muted); font-weight: 600; width: 42%; }
.specs tr:nth-child(odd) { background: var(--surface-2); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; z-index: 200; background: var(--text); color: var(--bg);
  padding: 12px 18px; border-radius: 12px; font-weight: 600; transition: all .3s; pointer-events: none; box-shadow: var(--shadow); max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); color: #fff; }
.demo-banner { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: var(--text); text-align: center; font-size: 13px; padding: 7px 12px; }

/* ───── Footer ───── */
.footer { border-top: 1px solid var(--line); background: var(--surface); padding: 36px 0; margin-top: 20px; }
.footer .wrap { display: flex; gap: 30px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.footer img { height: 90px; width: auto; }
.footer .muted { color: var(--muted); font-size: 14px; }
.footer a { color: var(--muted); }

@media (max-width: 820px) {
  .header .search { display: none; }
  .brand .name small { display: none; }
  .brand .name { font-size: 16px; }
  .pd { grid-template-columns: 1fr; }
  .pd .img { min-height: 220px; max-height: 300px; }
  .cart-btn .lbl { display: none; }
  .mobile-search { display: block !important; }
}
@media (max-width: 520px) {
  .header .wrap { gap: 8px; padding: 0 12px; }
  .brand { gap: 7px; } .brand img { height: 30px; } .brand .name { font-size: 12.5px; letter-spacing: 0; }
  .header-actions { gap: 6px; } .icon-btn { width: 38px; height: 38px; }
  .cart-btn { width: auto; padding: 0 8px; gap: 5px; }
  .header-actions .lang-select { padding: 0 2px; }
  .catbar select { max-width: 120px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card .body { padding: 10px 12px 12px; } .card .desc { display: none; } .price { font-size: 17px; }
  .card .actions { flex-direction: column; } .card .tag { font-size: 10px; }
}
.mobile-search { display: none; padding: 10px 0 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* language switch */
.lang-select { height: 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text);
  font-weight: 700; padding: 0 10px; cursor: pointer; font-size: 14px; }
.lang-select:hover { background: var(--surface-2); }
@media (max-width: 520px) { .lang-select { height: 38px; padding: 0 4px; font-size: 13px; } }
