/* RGP Market — общие токены и компоненты витрины (по мотивам showone.ru: лайм-акцент,
   Manrope, светлая/тёмная тема). Используется на index.html, catalog.html, product.html. */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400..800&display=swap');

:root{
  --lime-100:#bae900; --lime-200:#89ac00; --lime-300:#769400; --lime-400:#4c5e00; --lime-500:#3c4a00;
  --peach-100:#fed790; --peach-200:#fedfa6; --peach-300:#fee7bc; --peach-400:#ffefd3;
  --cyan:#3fc7e2; --pink:#fa6c9a; --yellow:#e6ff82;
  --radius:14px; --radius-lg:22px; --sp:4px;

  --bg:#ffffff; --bg-2:#f1f1f1; --surface:#ffffff; --surface-2:#f6f7f2;
  --fg:#1f1f1f; --muted:#4a4a4a; --muted-2:#717171; --line:#e4e4e4;
  --lime-on-light:#3c4a00;
}
@media (prefers-color-scheme: dark){
  :root{
    --bg:#161718; --bg-2:#1f1f1f; --surface:#1f1f1f; --surface-2:#242524;
    --fg:#f1f1f1; --muted:#c7c7c7; --muted-2:#8b8b8b; --line:#323332;
    --lime-on-light:#0e1200;
  }
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0; background:var(--bg); color:var(--fg);
  font:16px/1.5 Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing:antialiased;
}
img,svg{max-width:100%}
a{color:inherit}
.wrap{max-width:1160px; margin:0 auto; padding-inline:20px}
.eyebrow{
  display:inline-flex; align-items:center; gap:8px; font-size:13px; font-weight:700;
  letter-spacing:.02em; text-transform:uppercase; color:var(--lime-on-light);
  background:var(--lime-100); border-radius:999px; padding:6px 14px;
}
h1,h2,h3{margin:0; font-weight:800; letter-spacing:-.01em}
h1{font-size:clamp(32px,5vw,52px); line-height:1.05}
h2{font-size:clamp(24px,3vw,34px); line-height:1.1}
h3{font-size:18px}
p{margin:0}
.muted{color:var(--muted)}
section{padding-block:64px}
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  height:52px; padding:0 26px; border-radius:999px; font-weight:700; font-size:15px;
  text-decoration:none; border:1.5px solid transparent; cursor:pointer; white-space:nowrap;
  transition:transform .12s ease, opacity .12s ease; font-family:inherit;
}
.btn:active{transform:scale(.97)}
.btn-primary{background:var(--lime-100); color:#1f1f1f}
.btn-primary:hover{background:var(--yellow)}
.btn-ghost{background:transparent; color:var(--fg); border-color:var(--line)}
.btn-ghost:hover{border-color:var(--lime-200)}
.btn-sm{height:40px; padding:0 18px; font-size:14px}
.btn:disabled{opacity:.5; cursor:default}

/* ---------- header ---------- */
header{
  position:sticky; top:0; z-index:20; backdrop-filter:blur(10px) saturate(1.1);
  background:color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom:1px solid var(--line);
}
.nav{display:flex; align-items:center; gap:28px; height:64px}
.logo{display:flex; align-items:center; gap:8px; font-weight:800; font-size:18px; text-decoration:none; margin-right:auto}
.logo .dot{width:26px; height:26px; border-radius:8px; background:var(--lime-100); display:grid; place-items:center; font-size:13px; font-weight:800; color:#1f1f1f}
.navlinks{display:flex; gap:22px; font-size:14px; font-weight:600}
.navlinks a{text-decoration:none; color:var(--muted)}
.navlinks a:hover, .navlinks a.active{color:var(--fg)}
.navcta{display:flex; align-items:center; gap:10px}
@media (max-width:820px){ .navlinks{display:none} }

/* ---------- section headers ---------- */
.sec-head{display:flex; justify-content:space-between; align-items:flex-end; gap:20px; margin-bottom:32px; flex-wrap:wrap}
.sec-head p{color:var(--muted); margin-top:8px; max-width:52ch}

/* ---------- chips ---------- */
.chips{display:flex; gap:10px; flex-wrap:wrap}
.chip{
  padding:10px 18px; border-radius:999px; background:var(--surface-2); font-size:14px;
  font-weight:600; border:1.5px solid transparent; cursor:pointer; font-family:inherit;
  color:inherit; text-decoration:none; display:inline-block;
}
.chip.active{background:var(--lime-100); color:#1f1f1f}
.badge-preview{
  display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:700;
  color:var(--muted-2); border:1px dashed var(--line); border-radius:999px; padding:5px 12px;
}

/* ---------- product grid / cards ---------- */
.grid{display:grid; grid-template-columns:repeat(4,1fr); gap:18px; margin-top:28px}
@media (max-width:980px){ .grid{grid-template-columns:repeat(2,1fr)} }
@media (max-width:560px){ .grid{grid-template-columns:1fr} }
.card{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius-lg); overflow:hidden; display:flex; flex-direction:column; text-decoration:none; color:inherit}
.card .thumb{aspect-ratio:1/1; background:linear-gradient(135deg,var(--surface-2),var(--bg-2)); display:grid; place-items:center; position:relative; overflow:hidden}
.card .thumb img{width:100%; height:100%; object-fit:cover}
.card .thumb .tag{position:absolute; top:10px; left:10px; background:var(--lime-100); color:#1f1f1f; font-size:11px; font-weight:800; padding:4px 9px; border-radius:999px}
.card .thumb .out{position:absolute; inset:0; background:color-mix(in srgb, var(--bg) 70%, transparent); display:grid; place-items:center; font-size:12px; font-weight:700; color:var(--muted-2)}
.card .thumb .emoji{font-size:34px; opacity:.6}
.card .body{padding:14px 16px 18px; display:flex; flex-direction:column; gap:6px; flex:1}
.card .cat{font-size:12px; color:var(--muted-2); font-weight:600}
.card h4{margin:0; font-size:15px; font-weight:700; line-height:1.3}
.card .price-row{display:flex; align-items:baseline; gap:8px; margin-top:auto}
.card .price{font-size:18px; font-weight:800}
.card .old{font-size:13px; color:var(--muted-2); text-decoration:line-through; font-weight:600}
.card .meta{font-size:12px; color:var(--muted-2); display:flex; align-items:center; gap:4px}
.empty-state{
  text-align:center; padding:60px 20px; border:1px dashed var(--line); border-radius:var(--radius-lg);
  color:var(--muted); margin-top:28px;
}
.empty-state h3{margin-bottom:10px}
.skeleton{background:linear-gradient(90deg,var(--surface-2) 25%,var(--bg-2) 37%,var(--surface-2) 63%); background-size:400% 100%; animation:sk 1.4s ease infinite}
@keyframes sk{0%{background-position:100% 50%}100%{background-position:0 50%}}

/* ---------- tiers (совместная закупка) ---------- */
.tiers{display:flex; gap:6px; margin-top:12px; flex-wrap:wrap}
.tier{flex:1; min-width:64px; text-align:center; padding:8px 4px; border-radius:10px; background:var(--bg-2); font-size:11px; font-weight:700}
.tier.active{background:var(--lime-100); color:#1f1f1f}
.tier span{display:block; font-weight:600; font-size:10px; opacity:.75; margin-top:2px}
.progress{height:6px; border-radius:999px; background:var(--bg-2); margin-top:10px; overflow:hidden}
.progress i{display:block; height:100%; background:linear-gradient(90deg,var(--lime-200),var(--lime-100))}

/* ---------- формы (логин, заявка продавца, чекаут) ---------- */
.form-card{
  max-width:440px; background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius-lg); padding:32px;
}
.field{display:flex; flex-direction:column; gap:6px; margin-top:16px}
.field:first-child{margin-top:0}
.field label{font-size:13px; font-weight:700; color:var(--muted)}
.field input, .field select, .field textarea{
  height:48px; border-radius:12px; border:1.5px solid var(--line); background:var(--surface-2);
  padding:0 16px; font:inherit; color:inherit; outline:none; width:100%;
}
.field textarea{height:auto; padding:12px 16px; resize:vertical; min-height:80px}
.field input:focus, .field select:focus, .field textarea:focus{border-color:var(--lime-200)}
.field .hint{font-size:12px; color:var(--muted-2)}
.field-check{display:flex; align-items:flex-start; gap:10px; margin-top:16px; font-size:13px; color:var(--muted)}
.field-check input{width:18px; height:18px; flex:none; margin-top:2px}
.form-actions{margin-top:24px}
.form-actions .btn{width:100%}

.alert{
  border-radius:12px; padding:12px 16px; font-size:14px; margin-top:16px; border:1px solid transparent;
}
.alert-error{background:color-mix(in srgb, var(--pink) 14%, var(--surface-2)); color:var(--fg); border-color:color-mix(in srgb, var(--pink) 40%, transparent)}
.alert-ok{background:color-mix(in srgb, var(--lime-100) 20%, var(--surface-2)); color:var(--fg); border-color:color-mix(in srgb, var(--lime-200) 50%, transparent)}
.alert-info{background:var(--surface-2); color:var(--muted); border-color:var(--line)}

/* ---------- корзина / список заказов ---------- */
.cart-row{
  display:flex; gap:16px; align-items:center; padding:18px 0; border-bottom:1px solid var(--line);
}
.cart-row:last-child{border-bottom:none}
.cart-row .thumb-sm{
  width:64px; height:64px; border-radius:12px; flex:none; object-fit:cover; background:var(--surface-2);
}
.cart-row .info{flex:1; min-width:0}
.cart-row .info h4{margin:0 0 4px; font-size:15px; font-weight:700}
.cart-row .info a{text-decoration:none; color:inherit}
.stepper{display:flex; align-items:center; gap:10px}
.stepper button{
  width:32px; height:32px; border-radius:9px; border:1.5px solid var(--line); background:var(--surface-2);
  font-size:16px; font-weight:700; cursor:pointer; color:inherit; font-family:inherit;
}
.stepper button:hover{border-color:var(--lime-200)}
.stepper span{min-width:22px; text-align:center; font-weight:700; font-variant-numeric:tabular-nums}
.cart-row .line-total{font-weight:800; min-width:90px; text-align:right; font-variant-numeric:tabular-nums}
.cart-summary{
  display:flex; justify-content:space-between; align-items:center; margin-top:24px;
  padding-top:20px; border-top:1.5px solid var(--line); gap:16px; flex-wrap:wrap;
}
.cart-summary .total b{font-size:22px}

.order-row{
  border:1px solid var(--line); border-radius:var(--radius-lg); padding:18px 22px; margin-top:14px;
}
.order-row .head{display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap}
.status-pill{
  font-size:12px; font-weight:700; padding:4px 12px; border-radius:999px; background:var(--surface-2);
  color:var(--muted);
}
.status-pill.good{background:color-mix(in srgb, var(--lime-100) 25%, var(--surface-2)); color:var(--lime-on-light)}
.status-pill.bad{background:color-mix(in srgb, var(--pink) 18%, var(--surface-2)); color:var(--fg)}

.toast-box{
  position:fixed; left:50%; bottom:28px; transform:translate(-50%,12px); opacity:0; pointer-events:none;
  background:var(--fg); color:var(--bg); font:600 13.5px Manrope,sans-serif; padding:11px 20px;
  border-radius:999px; box-shadow:0 10px 30px -10px rgba(0,0,0,.35); transition:opacity .18s ease, transform .18s ease;
  z-index:60; max-width:min(90vw,420px); text-align:center;
}
.toast-box.show{opacity:1; transform:translate(-50%,0)}
.toast-box.toast-error{background:var(--pink); color:#fff}

footer{border-top:1px solid var(--line); padding-block:36px; margin-top:24px}
.foot-row{display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap:wrap; font-size:13px; color:var(--muted-2)}
.foot-links{display:flex; gap:18px; flex-wrap:wrap}
.foot-links a{text-decoration:none; color:var(--muted-2)}
.foot-links a:hover{color:var(--fg)}
