/* ============================================================
   SMOEM.KZ — Base / Reset / Typography / Utilities
   ============================================================ */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

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

body {
  overflow-x: clip;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

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

img { height: auto; }

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; background: none; border: none; }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
a:hover { color: var(--color-primary-hover); }

/* Inline text links: not only color (WCAG 1.4.1) */
.section p a:not(.btn):not(.product-card__overlay):not(.chip):not(.category-card),
.form-consent a,
.breadcrumbs__item a,
.footer__list a,
.footer__credit a,
.footer__about a,
.product-detail__desc a,
.product-detail__text a,
.poisk__hint a {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
.section p a:not(.btn):not(.product-card__overlay):hover,
.form-consent a:hover,
.breadcrumbs__item a:hover,
.footer__list a:hover,
.footer__credit a:hover {
  text-decoration-thickness: 2px;
}

ul, ol { list-style: none; padding: 0; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
  text-wrap: balance;
  overflow-wrap: break-word;
}

p { text-wrap: pretty; }

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

::selection {
  background: var(--c-brand-600);
  color: #fff;
}

/* ---------- Accessibility helpers ---------- */
.visually-hidden {
  position: absolute !important;
  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: var(--space-4);
  top: -100px;
  z-index: var(--z-toast);
  background: var(--color-ink, var(--c-ink-900));
  color: #fff;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--space-4); color: #fff; }

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: var(--container-wide); }
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * 0.6); }
.section--subtle { background: var(--color-bg-subtle); }
.section--dark {
  background: var(--color-surface-dark);
  color: var(--color-text-invert);
}
.section--dark h1,
.section--dark h2,
.section--dark h3 { color: #fff; }

/* Section heading block (reusable) */
.section-head {
  max-width: 720px;
  margin-bottom: var(--space-7);
}
.section-head--center {
  margin-inline: auto;
  text-align: center;
}
.section-head__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}
.section--dark .section-head__eyebrow { color: var(--c-accent-500); }
.section-head__title { font-size: var(--fs-h2); }
.section-head__text {
  margin-top: var(--space-4);
  font-size: var(--fs-lead);
  color: var(--color-text-soft);
}
.section--dark .section-head__text { color: rgba(255,255,255, 0.82); }

/* Text helpers */
.lead { font-size: var(--fs-lead); color: var(--color-text-soft); }
.text-soft { color: var(--color-text-soft); }
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }

.eyebrow {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--color-primary);
}

/* Grid helpers */
.grid { display: grid; gap: var(--space-6); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.auto-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fill, minmax(var(--min, 260px), 1fr));
}

.category-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* Reveal-on-scroll (progressive enhancement, JS adds .is-visible) */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* Icon sizing (SVG sprite <use>) */
.icon {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--fill { fill: currentColor; stroke: none; }
