/* ==========================================================================
   VELURA — Base: reset, типографіка, кнопки, форми, атоми
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

img, picture, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }

input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .5em;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: var(--ls-display); }
h2 { font-size: var(--fs-h2); line-height: var(--lh-tight); letter-spacing: var(--ls-display); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

a { color: inherit; text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--accent); }

ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
li { margin-bottom: .35em; }

hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-8) 0; }

strong, b { font-weight: 700; }
small { font-size: var(--fs-sm); }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* --------------------------------------------------------------------------
   Контейнер / секції
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }
.container--wide { max-width: 1560px; }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(40px, 3vw + 20px, 72px); }
.section--cream { background: var(--bg-cream); }
.section--sand { background: var(--bg-sand); }
.section--dark { background: var(--bg-dark); color: var(--ink-inv); }
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--ink-inv); }

/* --------------------------------------------------------------------------
   Заголовки секцій
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-3);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: .55;
}
.section--dark .eyebrow { color: #D8A87F; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-5);
  margin-bottom: clamp(24px, 2.4vw, 48px);
}
.section-head__text { max-width: 640px; }
.section-head__text p { color: var(--ink-2); font-size: var(--fs-lead); margin-top: -.2em; }
.section--dark .section-head__text p { color: rgba(251,248,243,.72); }
.section-head h2 { margin-bottom: .28em; }

/* --------------------------------------------------------------------------
   Кнопки
   -------------------------------------------------------------------------- */
.btn {
  --btn-h: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--btn-h);
  padding: 0 var(--sp-6);
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background var(--t) var(--ease), color var(--t) var(--ease),
              border-color var(--t) var(--ease), transform var(--t-fast) var(--ease),
              box-shadow var(--t) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled { opacity: .5; pointer-events: none; }

.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--sh-sm); }
.btn--primary:hover { background: var(--accent-2); color: #fff; box-shadow: var(--sh); }

.btn--dark { background: var(--ink); color: var(--ink-inv); }
.btn--dark:hover { background: var(--accent); color: #fff; }

.btn--outline { border-color: var(--line); color: var(--ink); background: transparent; }
.btn--outline:hover { border-color: var(--ink); color: var(--ink); background: var(--bg-cream); }

.btn--ghost { color: var(--ink); background: var(--bg-cream); }
.btn--ghost:hover { background: var(--bg-sand); color: var(--ink); }

.btn--light { background: var(--ink-inv); color: var(--ink); }
.btn--light:hover { background: #fff; color: var(--accent); }

.btn--outline-light { border-color: var(--line-dark); color: var(--ink-inv); }
.btn--outline-light:hover { border-color: var(--ink-inv); color: var(--ink-inv); background: rgba(251,248,243,.08); }

.btn--sm { --btn-h: 40px; padding: 0 var(--sp-4); font-size: var(--fs-xs); }
.btn--lg { --btn-h: 58px; padding: 0 var(--sp-8); font-size: var(--fs-base); }
.btn--block { display: flex; width: 100%; }
.btn--icon { padding: 0; width: var(--btn-h); }

.btn svg { width: 18px; height: 18px; flex: none; }

/* Текстове посилання зі стрілкою */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: gap var(--t) var(--ease), border-color var(--t) var(--ease);
}
.link-arrow:hover { gap: var(--sp-3); border-bottom-color: currentColor; color: var(--accent-2); }
.link-arrow svg { width: 16px; height: 16px; }

/* --------------------------------------------------------------------------
   Бейджі / чіпи
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-2xs);
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}
.badge--sale { background: var(--sale); color: #fff; }
.badge--hit { background: var(--ink); color: var(--ink-inv); }
.badge--new { background: var(--success); color: #fff; }
.badge--soft { background: var(--accent-soft); color: var(--accent-2); }
.badge--stock { background: var(--success-soft); color: var(--success); text-transform: none; letter-spacing: 0; font-weight: 700; }
.badge--out { background: #F1EFEC; color: var(--ink-3); text-transform: none; letter-spacing: 0; }
.badge--warn { background: var(--warn-soft); color: var(--warn); text-transform: none; letter-spacing: 0; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-2);
  background: var(--bg);
  cursor: pointer;
  transition: all var(--t) var(--ease);
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--ink-inv); }

/* --------------------------------------------------------------------------
   Рейтинг
   -------------------------------------------------------------------------- */
.rating { display: inline-flex; align-items: center; gap: 6px; line-height: 1; }
.rating__stars { display: inline-flex; gap: 1px; color: var(--star); }
.rating__stars svg { width: 13px; height: 13px; }
.rating__value { font-size: var(--fs-xs); font-weight: 700; color: var(--ink); }
.rating__count { font-size: var(--fs-xs); color: var(--ink-3); }

/* --------------------------------------------------------------------------
   Ціни
   -------------------------------------------------------------------------- */
.price { display: inline-flex; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; }
.price__now {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: var(--ls-tight);
  color: var(--ink);
}
.price__old {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-color: var(--sale);
  text-decoration-thickness: 1.5px;
}
.price__save { font-size: var(--fs-2xs); font-weight: 800; color: var(--sale); }

/* --------------------------------------------------------------------------
   Форми
   -------------------------------------------------------------------------- */
.field { margin-bottom: var(--sp-4); }
.field__label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--ink-2);
}
.field__label .req { color: var(--sale); }

.input, .select, .textarea {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
  font-size: var(--fs-base);
  color: var(--ink);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--sh-focus);
}
.input.is-error, .select.is-error { border-color: var(--sale); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.55; }

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237C736B' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 42px;
  cursor: pointer;
}

.field__error {
  display: none;
  margin-top: 5px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--sale);
}
.field.has-error .field__error { display: block; }

.field__hint { margin-top: 5px; font-size: var(--fs-xs); color: var(--ink-3); }

/* Чекбокс / радіо */
.check {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  line-height: 1.5;
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  flex: none;
  width: 22px; height: 22px;
  margin-top: 1px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--bg);
  display: grid;
  place-items: center;
  transition: all var(--t) var(--ease);
}
.check__box::after {
  content: "";
  width: 11px; height: 6px;
  border-left: 2.2px solid #fff;
  border-bottom: 2.2px solid #fff;
  transform: rotate(-45deg) scale(.4);
  opacity: 0;
  transition: all var(--t) var(--ease);
  margin-top: -2px;
}
.check input:checked + .check__box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .check__box::after { opacity: 1; transform: rotate(-45deg) scale(1); }
.check input:focus-visible + .check__box { box-shadow: var(--sh-focus); }
.check--radio .check__box { border-radius: 50%; }
.check--radio .check__box::after {
  width: 9px; height: 9px; border: 0; border-radius: 50%;
  background: #fff; transform: scale(.4); margin: 0;
}

/* Приховане, але доступне для скрінрідерів */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 0; top: -100px; z-index: var(--z-toast);
  padding: 12px 20px; background: var(--ink); color: var(--ink-inv);
  border-radius: 0 0 var(--r-sm) 0; font-weight: 700; font-size: var(--fs-sm);
  transition: top var(--t) var(--ease);
}
.skip-link:focus { top: 0; color: var(--ink-inv); }

/* --------------------------------------------------------------------------
   Утиліти
   -------------------------------------------------------------------------- */
.u-center { text-align: center; }
.u-mt-0 { margin-top: 0; }
.u-mb-0 { margin-bottom: 0; }
.u-muted { color: var(--ink-3); }
.u-nowrap { white-space: nowrap; }
.u-hide { display: none !important; }
@media (max-width: 767px) { .u-hide-mob { display: none !important; } }
@media (min-width: 768px) { .u-hide-desk { display: none !important; } }

.clamp-2 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  line-clamp: 2; overflow: hidden;
}
.clamp-3 {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  line-clamp: 3; overflow: hidden;
}

/* Плавна поява при скролі */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }

/* Медіа-обгортки зі співвідношенням сторін */
.ratio { position: relative; overflow: hidden; background: var(--bg-sand); }
.ratio > img, .ratio > svg, .ratio > video, .ratio > picture > img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.ratio--1x1 { aspect-ratio: 1 / 1; }
.ratio--4x5 { aspect-ratio: 4 / 5; }
.ratio--3x4 { aspect-ratio: 3 / 4; }
.ratio--4x3 { aspect-ratio: 4 / 3; }
.ratio--3x2 { aspect-ratio: 3 / 2; }
.ratio--16x9 { aspect-ratio: 16 / 9; }
