/* ============================================================
   БАЗОВІ СТИЛІ — reset, типографіка, mobile-first основа
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--c-bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--c-bg);
  color: var(--c-body);
  font-family: var(--f-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }

a { color: var(--c-ink); text-decoration: none; }
a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--c-rose);
  text-underline-offset: 4px;
}

h1, h2, h3, h4, p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--c-sage);
  outline-offset: 3px;
  border-radius: 2px;
}

[data-hide-scroll] { scrollbar-width: none; }
[data-hide-scroll]::-webkit-scrollbar { display: none; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--gap-page);
}

h1, .h1 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1.15;
  color: var(--c-ink);
}

h2, .h2 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(24px, 4.5vw, 34px);
  line-height: 1.18;
  color: var(--c-ink);
}

h3, .h3 {
  font-family: var(--f-accent);
  font-weight: 600;
  font-size: clamp(18px, 3vw, 22px);
  color: var(--c-ink);
}

.price {
  font-family: var(--f-ui);
  font-weight: 700;
}

.price--old {
  font-family: var(--f-body);
  font-weight: 500;
  color: var(--c-muted);
  text-decoration: line-through;
  font-size: .9em;
}

/* --- Кнопки --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--radius-sm);
  font-family: var(--f-ui);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition:
    background-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    filter var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease);
  text-decoration: none;
}
.btn:hover {
  text-decoration: none;
  filter: brightness(.88);
}
.btn:active:not(:disabled) {
  transform: scale(.98);
  filter: brightness(.82);
}

.btn--primary { background: var(--c-sage); color: #ffffff; }
.btn--primary:hover { background: var(--c-sagehover); color: #ffffff; }

.btn--outline { background: transparent; color: var(--c-ink); border: 1px solid var(--c-border); }
.btn--outline:hover { border-color: var(--c-sage); color: var(--c-sage); }

.btn--rose { background: var(--c-rose); color: #ffffff; }
.btn--rose:hover { background: var(--c-sagehover); color: #ffffff; }

.btn--glass {
  background: color-mix(in srgb, var(--c-surface) 28%, transparent);
  color: var(--c-ink);
  border: 1px solid color-mix(in srgb, var(--c-surface) 55%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  backdrop-filter: blur(14px) saturate(1.25);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--c-surface) 50%, transparent),
    0 4px 18px color-mix(in srgb, var(--c-ink) 10%, transparent);
}
.btn--glass:hover {
  background: color-mix(in srgb, var(--c-surface) 28%, transparent);
  color: var(--c-ink);
  border-color: color-mix(in srgb, var(--c-surface) 55%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--c-surface) 50%, transparent),
    0 4px 18px color-mix(in srgb, var(--c-ink) 10%, transparent);
}

.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.link-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-ink);
  border: 1px solid color-mix(in srgb, var(--c-surface) 55%, transparent);
  border-bottom-width: 1px;
  padding: 4px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--c-surface) 28%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  backdrop-filter: blur(14px) saturate(1.25);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--c-surface) 50%, transparent),
    0 4px 18px color-mix(in srgb, var(--c-ink) 10%, transparent);
  text-decoration: none;
  transition:
    background-color var(--t-fast) ease,
    box-shadow var(--t-fast) ease,
    border-color var(--t-fast) ease,
    filter var(--t-fast) ease;
}
.link-accent:hover {
  background: color-mix(in srgb, var(--c-surface) 40%, transparent);
  color: var(--c-ink);
  border-color: color-mix(in srgb, var(--c-surface) 65%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--c-surface) 55%, transparent),
    0 6px 20px color-mix(in srgb, var(--c-ink) 12%, transparent);
  text-decoration: none;
}

/* --- Форми --- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 500; color: var(--c-muted); letter-spacing: .02em; }
.field input, .field select, .field textarea {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  font-size: 15px;
}
.field textarea { min-height: 100px; padding: 12px 14px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--c-sage);
  outline: none;
}
.field--error input, .field--error select, .field--error textarea { border-color: var(--c-danger); }
.field__error { font-size: 12.5px; color: var(--c-danger); }
.field--checkbox { flex-direction: row; align-items: flex-start; gap: 10px; }
.field--checkbox input { width: 20px; height: 20px; min-height: unset; flex: 0 0 auto; margin-top: 2px; }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-radius: 3px;
  color: var(--c-surface);
}
.badge--hit,
.badge--new,
.badge--sale,
.badge--own {
  background: var(--c-sage);
  color: #ffffff;
}

@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.3); } 100% { transform: scale(1); } }
[data-bump="1"] { animation: bump .42s cubic-bezier(.34,1.56,.64,1); }

/* --- Scroll reveal (легка поява) --- */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition:
    opacity var(--t-slow) var(--ease),
    transform var(--t-slow) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* М’який zoom фото (лише desktop hover) */
[data-media-zoom] {
  overflow: hidden;
}
[data-media-zoom] img {
  transition: transform var(--t-slow) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  [data-media-zoom]:hover img {
    transform: scale(1.04);
  }
  .btn--primary:hover,
  .btn--rose:hover {
    transform: translateY(-1px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
/* Повне приборкання тривалості анімацій при prefers-reduced-motion
   винесене в motion.css, який підключається останнім у base.html,
   щоб перекривати попередні правила порядком каскаду без !important. */
