/* ============================================================
   КЛИМАТ ПРО — design system
   Premium, restrained, cool-blue. Modern grotesque (Onest).
   Theming via [data-theme], [data-density], [data-cardstyle], [data-dark].
   ============================================================ */

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

:root {
  /* --- brand: cool blue (default) --- */
  --brand-900: #062A38;
  --brand-800: #0A4E63;
  --brand-700: #0A6E8C;
  --brand-600: #0E7C9D;
  --brand-500: #1391B6;
  --brand-300: #7FD4E8;
  --brand-100: #DCF1F7;
  --brand-50:  #EFF8FB;

  --accent: var(--brand-600);
  --accent-strong: var(--brand-700);
  --accent-soft: var(--brand-100);
  --accent-tint: var(--brand-50);
  --on-accent: #ffffff;

  /* warm seasonal accent (used sparingly) */
  --warm: #E8732C;
  --warm-soft: #FCEDE2;

  /* energy / eco */
  --eco: #1F8A5B;
  --eco-soft: #E4F3EC;

  /* sale / hot */
  --sale: #D6453B;
  --sale-soft: #FBE9E7;

  /* --- neutrals (cool slate) --- */
  --ink:      #0E1A24;
  --ink-2:    #2B3B47;
  --muted:    #5C6B76;
  --muted-2:  #8A98A2;
  --line:     #E3E9ED;
  --line-2:   #EEF2F5;
  --surface:  #FFFFFF;
  --surface-2:#F5F8FA;
  --surface-3:#ECF1F4;
  --bg:       #F5F8FA;

  /* --- type --- */
  --font: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --fs-root: 16px;

  /* --- radius --- */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* --- shadow --- */
  --sh-sm: 0 1px 2px rgba(14,26,36,.06), 0 1px 3px rgba(14,26,36,.05);
  --sh-md: 0 4px 16px rgba(14,26,36,.07), 0 1px 4px rgba(14,26,36,.05);
  --sh-lg: 0 18px 48px rgba(10,78,99,.14), 0 4px 14px rgba(14,26,36,.06);
  --sh-brand: 0 14px 34px rgba(14,124,157,.28);

  /* --- layout --- */
  --maxw: 1280px;
  --gutter: 28px;
  --header-h: 76px;

  /* density-driven */
  --pad-card: 18px;
  --gap-grid: 22px;
  --grid-min: 250px;
}

/* ===================== THEMES ===================== */
[data-theme="navy"] {
  --brand-900:#0B1B2E; --brand-800:#13314F; --brand-700:#16324F; --brand-600:#1E466E;
  --brand-500:#2C5E91; --brand-300:#9CC0E0; --brand-100:#DCE8F3; --brand-50:#EEF4FA;
  --accent:#16324F; --accent-strong:#0B1B2E; --accent-soft:#DCE8F3; --accent-tint:#EEF4FA;
  --warm:#E8732C; --warm-soft:#FCEDE2;
}
[data-theme="eco"] {
  --brand-900:#0B2A1C; --brand-800:#13503A; --brand-700:#176A48; --brand-600:#1F8A5B;
  --brand-500:#2BA46E; --brand-300:#9FDBBE; --brand-100:#DFF1E8; --brand-50:#EFF8F3;
  --accent:#1F8A5B; --accent-strong:#176A48; --accent-soft:#DFF1E8; --accent-tint:#EFF8F3;
  --warm:#E8732C; --warm-soft:#FCEDE2;
}
[data-theme="dark"] {
  /* a punchy "tech" blue on light bg */
  --brand-900:#0A1A33; --brand-800:#11305F; --brand-700:#1A47A0; --brand-600:#2A6FDB;
  --brand-500:#3F86F2; --brand-300:#A8C8F7; --brand-100:#DEEAFB; --brand-50:#EFF5FE;
  --accent:#2A6FDB; --accent-strong:#1A47A0; --accent-soft:#DEEAFB; --accent-tint:#EFF5FE;
}

/* ===================== DARK MODE ===================== */
[data-dark="true"] {
  --ink:#EAF1F5; --ink-2:#C4D2DB; --muted:#9DACB6; --muted-2:#7A8893;
  --line:#243743; --line-2:#1C2C36;
  --surface:#152430; --surface-2:#0F1C26; --surface-3:#1C2C36; --bg:#0B161E;
  --on-accent:#ffffff;
  --accent-soft: color-mix(in oklab, var(--accent) 26%, #0B161E);
  --accent-tint: color-mix(in oklab, var(--accent) 14%, #0B161E);
  --sh-sm: 0 1px 2px rgba(0,0,0,.4);
  --sh-md: 0 6px 20px rgba(0,0,0,.45);
  --sh-lg: 0 20px 50px rgba(0,0,0,.55);
}

/* ===================== DENSITY ===================== */
[data-density="compact"] { --pad-card:14px; --gap-grid:16px; --grid-min:215px; --gutter:22px; }
[data-density="comfy"]   { --pad-card:24px; --gap-grid:30px; --grid-min:290px; --gutter:34px; }

/* ===================== RESET / BASE ===================== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html, body { max-width: 100%; overflow-x: hidden; }
html { font-size: var(--fs-root); }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .3s ease, color .3s ease;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font-family: inherit; }
::selection { background: var(--brand-300); color: var(--brand-900); }

/* accessible keyboard focus — visible ring only for keyboard users */
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
button:focus-visible, a:focus-visible, .btn:focus-visible, .btn-icon:focus-visible,
.hdr-action:focus-visible, .acc-navitem:focus-visible, .tab:focus-visible, .chip:focus-visible {
  outline: 2.5px solid var(--accent); outline-offset: 3px;
}
.input:focus-visible, .select:focus-visible { outline: none; }

/* respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

h1,h2,h3,h4 { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.08; color: var(--ink); }
p { margin: 0; }

/* ===================== TYPE SCALE ===================== */
.display { font-size: clamp(34px, 5vw, 60px); font-weight: 800; letter-spacing: -.035em; }
.h1 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; letter-spacing: -.03em; }
.h2 { font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; }
.h3 { font-size: 20px; font-weight: 700; }
.lead { font-size: clamp(16px, 1.4vw, 19px); color: var(--muted); line-height: 1.55; }
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tnum { font-variant-numeric: tabular-nums; }

/* ===================== LAYOUT ===================== */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(46px, 6vw, 84px); }

/* mobile: tighter gutters/gaps so content reads larger and stays on the grid */
@media (max-width: 560px) {
  :root, [data-density="comfy"], [data-density="compact"] { --gutter: 20px; --gap-grid: 14px; }
  .section { padding-block: clamp(34px, 9vw, 52px); }
  .section-head { margin-bottom: 20px; }
  /* mobile typography floor — nothing readable below 13px (full set at end of file) */
}
.section-head { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom: 30px; flex-wrap: wrap; }
.stack { display:flex; flex-direction:column; }
.row { display:flex; align-items:center; }

/* ===================== BUTTONS ===================== */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:9px;
  border:none; border-radius: var(--r-pill); cursor:pointer;
  font-weight:600; font-size:15px; line-height:1; padding:14px 22px;
  transition: transform .12s ease, background .18s ease, box-shadow .18s ease, color .18s ease, border-color .18s ease;
  white-space:nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--sh-brand); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: transparent; color: var(--ink); border:1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }
.btn-soft { background: var(--accent-soft); color: var(--accent-strong); }
.btn-soft:hover { background: var(--accent); color: var(--on-accent); }
.btn-warm { background: var(--warm); color:#fff; }
.btn-warm:hover { filter: brightness(.94); }
.btn-lg { padding:17px 30px; font-size:16.5px; }
.btn-sm { padding:10px 16px; font-size:13.5px; }
.btn-block { width:100%; }
.btn-icon {
  width:44px; height:44px; padding:0; border-radius:50%;
  display:inline-flex; align-items:center; justify-content:center;
  background: var(--surface); border:1.5px solid var(--line); color: var(--ink-2);
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }

/* ===================== CHIP / BADGE ===================== */
.chip {
  display:inline-flex; align-items:center; gap:7px;
  padding:8px 14px; border-radius: var(--r-pill);
  background: var(--surface); border:1.5px solid var(--line);
  font-size:13.5px; font-weight:500; color: var(--ink-2);
  transition: all .15s ease; cursor:pointer; white-space:nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip[aria-pressed="true"], .chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.badge {
  display:inline-flex; align-items:center; gap:5px;
  padding:5px 10px; border-radius: var(--r-xs);
  font-size:11.5px; font-weight:700; letter-spacing:.02em; line-height:1;
}
.badge-hit { background: var(--warm-soft); color: var(--warm); }
.badge-sale { background: var(--sale-soft); color: var(--sale); }
.badge-new { background: var(--accent-soft); color: var(--accent-strong); }
.badge-eco { background: var(--eco-soft); color: var(--eco); }
.badge-source { background: var(--surface-3); color: var(--ink-2); }

.rolebadge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 700; line-height: 1; }
.role-set { background: var(--accent); color: #fff; }
.role-outdoor { background: var(--accent-soft); color: var(--accent-strong); }
.role-indoor { background: var(--surface-3); color: var(--ink-2); }
.role-acc { background: var(--warm-soft); color: var(--warm); }
.rating-empty { font-weight: 500; white-space: nowrap; }

/* ===================== CARD ===================== */
.card {
  background: var(--surface); border:1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}

/* ===================== INPUTS ===================== */
.field { display:flex; flex-direction:column; gap:7px; }
.field > label { font-size:13.5px; font-weight:600; color: var(--ink-2); }
.input, .select {
  width:100%; padding:13px 15px; border-radius: var(--r-sm);
  border:1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font-size:15px; transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus { outline:none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); }
.input::placeholder { color: var(--muted-2); }

/* ===================== IMAGE SLOT (placeholder) ===================== */
/* live (user-fillable) slot — brand-tinted, ring removed for a clean look */
.imgslot-live { background: linear-gradient(135deg, var(--accent-tint), var(--surface-2)); }
.imgslot-live::after { display: none; }
image-slot { color: var(--muted); }
image-slot::part(frame) { background: transparent; }
image-slot::part(ring) { display: none; }
.imgslot {
  position:relative; border-radius: var(--r-md); overflow:hidden;
  background:
    linear-gradient(135deg, var(--surface-3), var(--surface-2));
  display:flex; align-items:center; justify-content:center;
  color: var(--muted-2);
}
.imgslot::after {
  content:""; position:absolute; inset:0;
  background-image: radial-gradient(circle at 1px 1px, rgba(14,26,36,.05) 1px, transparent 0);
  background-size: 16px 16px; opacity:.6;
}
.imgslot .ic { width:42%; max-width:120px; opacity:.5; position:relative; z-index:1; }
.imgslot .lbl { position:absolute; bottom:10px; left:0; right:0; text-align:center; font-size:11px; letter-spacing:.08em; text-transform:uppercase; z-index:1; }
.imgslot-photo { background:#fff; }
.imgslot-photo img { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; padding:8%; z-index:2; }
.imgslot-photo .lbl { display:none; }

/* ===================== UTIL ===================== */
.grid-products { display:grid; grid-template-columns: repeat(auto-fill, minmax(var(--grid-min), 1fr)); gap: var(--gap-grid); }
.divider { height:1px; background: var(--line); border:0; }
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
.scrollx { display:flex; gap:14px; overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
.scrollx::-webkit-scrollbar { display:none; }
.rating { display:inline-flex; align-items:center; gap:4px; font-size:13px; color: var(--ink-2); font-weight:600; }
.star { color:#F5A623; }

/* fade/slide in */
@keyframes fadeUp { from { transform: translateY(12px);} to { transform: none;} }
.fade-up { animation: fadeUp .5s cubic-bezier(.22,.61,.36,1) both; }

/* skeleton loading */
@keyframes skelPulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.skel { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; border-radius: 7px; animation: skelShimmer 1.3s ease-in-out infinite; }
@keyframes skelShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-media { width: 100%; aspect-ratio: 4 / 3; border-radius: 0; }
.skel-line { height: 13px; }
.skel-card { pointer-events: none; }
.skel-card .pcard-body { gap: 10px; }

/* ===================== SCROLLBAR ===================== */
.thin-scroll::-webkit-scrollbar { width:8px; height:8px; }
.thin-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius:8px; }
.thin-scroll::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }
