:root {
  --bg: #0e0e0f;
  --bg2: #17171a;
  --bg3: #222226;
  --line: #2e2e33;
  --text: #ececec;
  --muted: #9a9aa2;
  --accent: #c8102e;
  --accent2: #e3263f;
  --ok: #2e9e5b;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, .logo { font-family: Oswald, Impact, sans-serif; letter-spacing: .02em; text-transform: uppercase; line-height: 1.15; }
h1 { font-size: clamp(28px, 5vw, 44px); margin: 0 0 20px; }
h2 { font-size: clamp(22px, 3.5vw, 30px); margin: 0 0 18px; }
h3 { font-size: 20px; margin: 0 0 10px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.section { padding: 32px 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; margin-top: 28px; }
[hidden] { display: none !important; }

/* buttons */
.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  background: var(--accent); color: #fff; font: 600 15px Inter, sans-serif;
  padding: 13px 26px; border-radius: var(--radius); transition: background .15s, transform .1s;
}
.btn:hover { background: var(--accent2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn--small { padding: 8px 14px; font-size: 14px; }
.btn--ghost { background: transparent; border: 1px solid var(--line); }
.btn--ghost:hover { background: var(--bg3); }
.btn--wide { width: 100%; }
.btn--danger { background: #5a1a22; }
.btn--danger:hover { background: var(--accent); }

/* header */
.header { position: sticky; top: 0; z-index: 20; background: rgba(14,14,15,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header__inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { font-size: 22px; text-decoration: none; white-space: nowrap; }
.nav { display: flex; gap: 22px; flex: 1; overflow-x: auto; }
.nav a { text-decoration: none; color: var(--muted); white-space: nowrap; font-weight: 500; }
.nav a:hover { color: var(--text); }
.cart-link { position: relative; display: flex; padding: 6px; text-decoration: none; }
.cart-count {
  position: absolute; top: -4px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--accent); border-radius: 10px; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.burger { display: none; background: none; border: 0; width: 36px; height: 36px; cursor: pointer; padding: 0; }
.burger span, .burger span::before, .burger span::after { display: block; width: 22px; height: 2px; background: var(--text); position: relative; margin: 0 auto; }
.burger span::before, .burger span::after { content: ""; position: absolute; left: 0; }
.burger span::before { top: -7px; } .burger span::after { top: 7px; }

/* hero */
.hero {
  padding: 90px 0 80px; text-align: center; border-bottom: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 0%, rgba(200,16,46,.28), transparent 65%), var(--bg);
}
.hero h1 { font-size: clamp(36px, 8vw, 76px); margin-bottom: 12px; }
.hero__sub { color: var(--muted); font-size: clamp(16px, 2.4vw, 20px); margin: 0 auto 30px; max-width: 640px; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.chip { padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 15px; }
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip--active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s; }
.card:hover { border-color: #444; }
.card__img { position: relative; aspect-ratio: 1; background: var(--bg3); display: block; overflow: hidden; }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card__img img { transform: scale(1.04); }
.noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font: 700 64px Oswald, sans-serif; color: #333; text-transform: uppercase; }
.badge { position: absolute; top: 10px; left: 10px; background: var(--accent); padding: 3px 9px; border-radius: 6px; font-size: 13px; font-weight: 600; }
.card__body { padding: 14px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card__title { text-decoration: none; font-weight: 500; flex: 1; }
.card__title:hover { color: var(--accent2); }
.card__bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.price { font-weight: 600; font-size: 18px; }
.price s { color: var(--muted); font-weight: 400; font-size: .8em; margin-left: 4px; }
.price--big { font-size: 28px; margin: 0 0 22px; }

/* product page */
.crumbs { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.crumbs a { color: var(--muted); }
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.product__img { background: var(--bg2); border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; }
.product__img img { width: 100%; height: 100%; object-fit: cover; }
.buy { display: flex; gap: 12px; margin-bottom: 26px; flex-wrap: wrap; }
.desc { white-space: pre-line; margin-bottom: 20px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.qty button { background: var(--bg2); color: var(--text); border: 0; width: 44px; height: 46px; font-size: 20px; cursor: pointer; }
.qty button:hover { background: var(--bg3); }
.qty input { width: 52px; height: 46px; text-align: center; background: transparent; color: var(--text); border: 0; font-size: 16px; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty--small button { width: 32px; height: 34px; font-size: 17px; }
.qty--small span { min-width: 30px; text-align: center; }

/* about */
.about { display: grid; grid-template-columns: 3fr 2fr; gap: 40px; }
.about p { white-space: pre-line; }
.about__box { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.socials { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.socials a { color: var(--muted); }
.socials a:hover { color: var(--text); }

/* cart */
.checkout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
.cart-items { display: flex; flex-direction: column; gap: 12px; }
.cart-item { display: grid; grid-template-columns: 72px 1fr auto 100px 32px; align-items: center; gap: 14px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.cart-item--out { opacity: .55; }
.cart-item__img { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; background: var(--bg3); }
.cart-item__img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__info a { text-decoration: none; font-weight: 500; }
.cart-item__sum { text-align: right; font-weight: 600; }
.cart-item__del { background: none; border: 0; color: var(--muted); font-size: 24px; cursor: pointer; }
.cart-item__del:hover { color: var(--accent2); }
.cart-total { text-align: right; font-size: 22px; margin-top: 20px; }
.empty { text-align: center; padding: 50px 0; }

/* forms */
.form { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.form input:not([type=radio]):not([type=checkbox]), .form textarea, .form select {
  background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 8px;
  padding: 11px 12px; font: 16px Inter, sans-serif; width: 100%;
}
.form input:focus, .form textarea:focus, .form select:focus { outline: none; border-color: var(--accent); }
.form .radio { border: 0; padding: 0; margin: 0; display: flex; gap: 20px; flex-wrap: wrap; }
.form .radio label, .form .check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 15px; }
input[type=radio], input[type=checkbox] { accent-color: var(--accent); width: 18px; height: 18px; }
.form__error { background: rgba(200,16,46,.15); border: 1px solid var(--accent); color: #ffb3bd; padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 32px 0; margin-top: 40px; background: var(--bg2); }
.footer__inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer p { margin: 8px 0 0; }
.footer__phone { font-size: 20px; font-weight: 600; text-decoration: none; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ok); color: #fff; padding: 12px 22px; border-radius: var(--radius); font-weight: 500; z-index: 50; box-shadow: 0 6px 24px rgba(0,0,0,.4); }

@media (max-width: 860px) {
  .burger { display: block; order: 3; }
  .header__inner { gap: 12px; }
  .logo { flex: 1; font-size: 20px; overflow: hidden; text-overflow: ellipsis; }
  .cart-link { order: 2; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--bg2); border-bottom: 1px solid var(--line); }
  .nav a { padding: 14px 16px; border-top: 1px solid var(--line); }
  .menu-open .nav { display: flex; }
  .product, .about, .checkout { grid-template-columns: 1fr; gap: 24px; }
  .hero { padding: 60px 0 50px; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card__body { padding: 10px; }
  .card__bottom .btn--small { width: 100%; }
  .price { font-size: 16px; }
  .cart-item { grid-template-columns: 56px 1fr 28px; grid-template-areas: "img info del" "img qty sum"; row-gap: 8px; }
  .cart-item__img { width: 56px; height: 56px; grid-area: img; }
  .cart-item__info { grid-area: info; }
  .cart-item .qty { grid-area: qty; justify-self: start; }
  .cart-item__sum { grid-area: sum; grid-column: 2 / 4; }
  .cart-item__del { grid-area: del; }
}

/* ===== admin ===== */
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; align-items: center; }
.admin-nav a { padding: 8px 14px; border-radius: 8px; text-decoration: none; color: var(--muted); }
.admin-nav a.active, .admin-nav a:hover { background: var(--bg3); color: var(--text); }
.admin-nav form { margin-left: auto; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; background: var(--bg2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num { text-align: right; white-space: nowrap; }
.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--bg3); }
.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; background: var(--bg3); white-space: nowrap; }
.status--new { background: var(--accent); color: #fff; }
.status--confirmed { background: #8a5a00; color: #fff; }
.status--done { background: var(--ok); color: #fff; }
.status--cancelled { background: #444; color: #bbb; }
.row-actions { display: flex; gap: 8px; align-items: center; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.notice { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; background: rgba(46,158,91,.15); border: 1px solid var(--ok); }
.notice--err { background: rgba(200,16,46,.15); border-color: var(--accent); }
.login { max-width: 380px; margin: 60px auto; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
