:root {
  --black: #111;
  --text: #222;
  --muted: #767676;
  --line: #ececec;
  --bg: #fff;
  --soft: #f6f6f6;
  --sale: #fa6338;
  --flash: #cc0c39;
  --ok: #0d7a3e;
  --shadow: 0 8px 24px rgba(0,0,0,.08);
  --max: 1240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
h1, h2, h3 { margin: 0 0 .4em; letter-spacing: -.02em; }

.wrap { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }
.page { min-height: 50vh; padding-bottom: 64px; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.full { width: 100%; }
.section { margin: 48px auto; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head h2 { font-size: 26px; }
.text-link { font-size: 13px; font-weight: 600; border-bottom: 1px solid #111; background: none; border-left: 0; border-right: 0; border-top: 0; cursor: pointer; padding: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px; border: 1px solid #111; font-weight: 700; cursor: pointer; }
.btn-dark, .btn-dark:disabled { background: #111; color: #fff; }
.btn-dark:disabled { opacity: .4; cursor: not-allowed; }
.btn-light { background: #fff; color: #111; }
.btn-ghost { background: #fff; }

.promo-bar {
  background: #111;
  color: #fff;
  font-size: 12px;
  letter-spacing: .04em;
  overflow: hidden;
  height: 36px;
  display: flex;
  align-items: center;
}
.promo-track { display: flex; gap: 64px; white-space: nowrap; animation: marquee 22s linear infinite; padding-left: 100%; }
.promo-track span { padding-right: 8px; }
@keyframes marquee { to { transform: translateX(-100%); } }

.site-header { position: sticky; top: 0; z-index: 40; background: #fff; border-bottom: 1px solid var(--line); }
.header-main {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
}
.brand-block { display: flex; align-items: center; gap: 8px; }
.logo {
  font-family: Syne, Inter, sans-serif;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: .04em;
  line-height: 1;
  text-transform: uppercase;
}
.menu-toggle { display: none; }
.search { display: flex; background: var(--soft); border-radius: 999px; overflow: hidden; }
.search.search-mobile { display: none; margin: 0 16px 12px; }
.search input { flex: 1; border: 0; background: transparent; padding: 12px 18px; outline: none; }
.search button { width: 48px; border: 0; background: #111; color: #fff; cursor: pointer; }
.header-tools { display: flex; gap: 8px; }
.tool { position: relative; display: flex; flex-direction: column; align-items: center; font-size: 11px; min-width: 52px; }
.count {
  position: absolute; top: -4px; right: 6px;
  background: #111; color: #fff; border-radius: 99px;
  min-width: 16px; height: 16px; font-size: 10px; font-style: normal;
  display: grid; place-items: center; padding: 0 4px;
}
.count.is-empty { display: none; }

.cat-nav { border-top: 1px solid var(--line); }
.cat-nav-inner {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  display: flex; gap: 22px; overflow-x: auto;
  scrollbar-width: none;
}
.cat-nav-inner::-webkit-scrollbar { display: none; }
.cat-nav a { padding: 12px 0; font-size: 13px; white-space: nowrap; border-bottom: 2px solid transparent; }
.cat-nav a:hover { border-color: #111; }
.sale-link { color: var(--flash) !important; font-weight: 700; }

.drawer { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50; }
.drawer-panel { width: min(340px, 86vw); height: 100%; background: #fff; padding: 20px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }

.hero { position: relative; height: min(62vh, 560px); overflow: hidden; background: #111; }
.hero-slide {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transition: opacity .6s ease; display: flex; align-items: end;
}
.hero-slide.is-active { opacity: 1; }
.hero-copy { color: #fff; padding: 48px; max-width: 640px; text-shadow: 0 2px 16px rgba(0,0,0,.45); }
.hero-copy h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.05; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 700; }
.hero-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.hero-dots button { width: 8px; height: 8px; border-radius: 99px; border: 0; background: #fff7; cursor: pointer; }
.hero-dots button.is-on { background: #fff; width: 22px; }

.cat-circles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.cat-circle { text-align: center; font-size: 13px; font-weight: 600; }
.cat-circle img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; margin-bottom: 8px; background: var(--soft); }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card { position: relative; }
.card-media { display: block; background: var(--soft); aspect-ratio: 1; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { padding: 10px 2px 4px; }
.card-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; min-height: 2.6em; }
.card-brand { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.price-row { display: flex; align-items: baseline; gap: 8px; }
.price-row strong { font-size: 16px; }
.price-row.lg strong { font-size: 28px; }
.price-row s { color: var(--muted); font-size: 13px; }
.save { color: var(--sale); font-size: 13px; font-weight: 700; }

.badge { position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 700; padding: 3px 6px; color: #fff; }
.badge-flash { background: var(--flash); }
.badge-off { background: var(--sale); }
.wish-form { position: absolute; top: 8px; right: 8px; }
.wish-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); }
.wish-btn.is-on { color: var(--flash); }

.countdown { font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: .08em; background: #111; color: #fff; padding: 8px 12px; }
.campaigns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 16px auto 40px; }
.campaign { position: relative; min-height: 220px; overflow: hidden; color: #fff; }
.campaign img { width: 100%; height: 100%; object-fit: cover; min-height: 220px; }
.campaign div { position: absolute; inset: auto 16px 16px; }
.campaign h3 { font-size: 22px; }

.crumbs { display: flex; gap: 8px; color: var(--muted); font-size: 13px; margin: 20px 0; }
.catalog-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 20px; }
.catalog-layout { display: grid; grid-template-columns: 240px 1fr; gap: 28px; }
.filters h3 { font-size: 14px; margin: 18px 0 8px; }
.filters .btn { margin-top: 16px; }
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin: 0;
  padding: 7px 0;
  cursor: pointer;
  width: 100%;
  white-space: nowrap;
}
.check input[type="radio"],
.check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin: 0;
  padding: 0;
  flex: 0 0 16px;
  accent-color: #111;
  border: 0;
}
.price-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.price-inputs input,
label input:not([type="radio"]):not([type="checkbox"]),
label select,
label textarea,
.promo-form input,
.qty-inline input,
.sort-form select {
  width: 100%;
  border: 1px solid #ddd;
  padding: 10px 12px;
  background: #fff;
}
.toolbar { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 28px; }
.pager a { min-width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #ddd; }
.pager a.is-on { background: #111; color: #fff; border-color: #111; }

.product-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; }
.gallery-main { position: relative; background: var(--soft); }
.gallery-main img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; }
.thumb { width: 72px; padding: 0; border: 1px solid #ddd; background: #fff; cursor: pointer; }
.thumb img { aspect-ratio: 1; object-fit: cover; }
.brand-line { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.stock.in { color: var(--ok); font-weight: 600; }
.stock.out { color: var(--flash); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches label { cursor: pointer; }
.swatches input { display: none; }
.swatches span { display: block; border: 1px solid #ccc; padding: 8px 12px; font-size: 13px; }
.swatches input:checked + span { border-color: #111; background: #111; color: #fff; }
fieldset { border: 0; padding: 0; margin: 16px 0; }
legend { font-weight: 700; margin-bottom: 8px; }
.qty-label { display: block; margin: 12px 0 18px; font-weight: 600; }
.qty-label input { width: 90px; margin-top: 6px; }
.perks { padding-left: 18px; color: var(--muted); font-size: 13px; }
.product-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin: 40px 0; }
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td { border-bottom: 1px solid var(--line); text-align: left; padding: 10px 0; }
.spec-table th { width: 40%; color: var(--muted); font-weight: 500; }

.cart-layout, .checkout-layout, .account-grid { display: grid; grid-template-columns: 1.4fr .8fr; gap: 28px; }
.cart-row, .mini-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-row img, .mini-row img { width: 96px; height: 96px; object-fit: cover; background: var(--soft); }
.summary, .form-card, .auth-card, .success-card { border: 1px solid var(--line); padding: 22px; }
.summary dl > div, .form-card dl > div { display: flex; justify-content: space-between; margin: 8px 0; }
.total { font-size: 18px; font-weight: 800; }
.promo-form { display: flex; gap: 8px; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label, .auth-card label, .form-card label { display: block; font-size: 13px; font-weight: 600; }
.span-2 { grid-column: span 2; }
.auth-page { display: grid; place-items: center; padding: 48px 0; }
.auth-card { width: min(440px, 100%); display: flex; flex-direction: column; gap: 12px; }
.success-page { display: grid; place-items: center; padding: 48px 0; }
.success-card { width: min(560px, 100%); text-align: center; }
.success-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }
.account-head { display: flex; justify-content: space-between; align-items: center; margin: 24px 0; }
.order-line { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.status { text-transform: capitalize; font-size: 13px; }

.empty { text-align: center; padding: 72px 16px; }
.toast-wrap { width: min(var(--max), calc(100% - 32px)); margin: 16px auto 0; }
.toast { padding: 12px 14px; margin-bottom: 8px; }
.toast-ok { background: #eefaf2; border: 1px solid #b7e4c7; }
.toast-err { background: #fff1f0; border: 1px solid #ffccc7; }

.site-footer { background: #fafafa; border-top: 1px solid var(--line); padding: 48px 0 24px; margin-top: 24px; }
.footer-grid { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.footer-grid h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.footer-grid a, .footer-note { display: block; color: #555; font-size: 13px; margin: 8px 0; }
.footer-search { display: flex; }
.footer-search input { flex: 1; border: 1px solid #ddd; padding: 10px; }
.footer-search button { background: #111; color: #fff; border: 0; padding: 0 16px; }
.footer-bottom { width: min(var(--max), calc(100% - 32px)); margin: 28px auto 0; display: flex; justify-content: space-between; gap: 16px; color: #888; font-size: 12px; flex-wrap: wrap; }

.admin-body { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-side { background: #111; color: #fff; padding: 24px 18px; display: flex; flex-direction: column; gap: 14px; }
.admin-side a, .admin-side button { color: #fff; background: none; border: 0; text-align: left; cursor: pointer; padding: 0; }
.admin-main { padding: 32px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0 32px; }
.stat { border: 1px solid var(--line); padding: 18px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { display: block; font-size: 28px; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--line); text-align: left; padding: 10px 8px; font-size: 14px; }
.admin-form { margin-bottom: 32px; }
.check-row { display: flex; gap: 16px; margin: 12px 0; }

@media (max-width: 980px) {
  .header-main { grid-template-columns: auto 1fr auto; }
  .menu-toggle { display: block; }
  .header-main .search { display: none; }
  .search.search-mobile { display: flex; }
  .tool span { display: none; }
  .cat-circles { grid-template-columns: repeat(4, 1fr); }
  .grid-4, .grid-3, .campaigns, .catalog-layout, .product-grid, .cart-layout, .checkout-layout, .account-grid, .product-extra, .footer-grid, .stat-grid, .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .span-2 { grid-column: span 2; }
}
@media (max-width: 640px) {
  .cat-circles, .grid-4, .grid-3, .campaigns, .catalog-layout, .product-grid, .cart-layout, .checkout-layout, .account-grid, .product-extra, .footer-grid, .stat-grid, .form-grid, .admin-body {
    grid-template-columns: 1fr;
  }
  .hero { height: 420px; }
  .hero-copy { padding: 24px; }
  .order-line { grid-template-columns: 1fr auto; }
}
