/* ==========================================================================
   uzrokas.lv · base.css
   Resets, design tokens, typography, utilities, buttons, forms
   ========================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ul, ol, fieldset {
  margin: 0;
  padding: 0;
}
ul[class], ol[class] { list-style: none; }

img, svg, video, canvas { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- Design tokens ---------- */
:root {
  /* Brand palette */
  --ink: #12121a;
  --ink-2: #1c1c26;
  --ink-3: #2a2a36;
  --paper: #ffffff;
  --bone: #f7f4ef;
  --bone-2: #efeae1;
  --sand: #e5dfd3;
  --line: #e3dfd7;
  --line-dark: rgba(255, 255, 255, .14);
  /* Both secondary text colours meet 4.5:1 even on the bone-2 surface. */
  --muted: #6b655c;
  --muted-2: #6f695f;

  --gold: #b08d57;
  --gold-soft: #d9c096;
  --gold-ink: #806033;
  --gold-deep: #6d512b;
  --wine: #8c2f39;
  --sage: #4f6b5c;

  /* Typography */
  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, "Times New Roman", serif;
  /* Inter first: the previous Jost face has a near-advance-width "t" crossbar
     whose terminal fuses with the macron of a neighbouring "a-macron" at
     15px/400, so the pair reads as "f". Inter keeps a visible gap. */
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --fs-xs: .72rem;
  --fs-sm: .8125rem;
  --fs-base: .9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.375rem;
  --fs-xl: clamp(1.6rem, 1.1rem + 1.9vw, 2.5rem);
  --fs-2xl: clamp(2rem, 1.2rem + 3.2vw, 3.5rem);
  --fs-3xl: clamp(2.5rem, 1.2rem + 5vw, 5rem);

  /* Spacing */
  --sp-1: .25rem;
  --sp-2: .5rem;
  --sp-3: .75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;

  /* Layout */
  --container: 1440px;
  --container-narrow: 1080px;
  --gutter: clamp(1rem, 3vw, 2.5rem);
  --header-h: 74px;
  --radius: 2px;
  --radius-lg: 4px;

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(18, 18, 26, .05), 0 4px 16px rgba(18, 18, 26, .04);
  --shadow-md: 0 12px 34px rgba(18, 18, 26, .1);
  --shadow-lg: 0 28px 70px rgba(18, 18, 26, .18);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur: .38s;

  --z-header: 60;
  --z-mega: 70;
  --z-overlay: 85;
  --z-drawer: 90;
  --z-toast: 120;
}

/* ---------- Typography ---------- */
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  font-weight: 400;
  letter-spacing: .01em;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.is-locked { overflow: hidden; }

main { flex: 1 0 auto; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: .005em;
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }

p { color: var(--muted); letter-spacing: .015em; }
strong { font-weight: 600; color: var(--ink); }
small { font-size: var(--fs-xs); }

::selection { background: var(--gold-soft); color: var(--ink); }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: clamp(3rem, 7vw, 6.5rem); }
.section--tight { padding-block: clamp(2rem, 4vw, 3.5rem); }
.section--bone { background: var(--bone); }
.section--ink { background: var(--ink); color: var(--bone); }
.section--ink p { color: rgba(247, 244, 239, .68); }

.stack-2 > * + * { margin-top: var(--sp-2); }
.stack-3 > * + * { margin-top: var(--sp-3); }
.stack-4 > * + * { margin-top: var(--sp-4); }
.stack-5 > * + * { margin-top: var(--sp-5); }

.grid { display: grid; gap: clamp(1rem, 2vw, 1.75rem); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
  .grid--4, .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
}

.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }
.hidden { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Section headings ---------- */
.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold-ink);
  font-weight: 500;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-5);
  margin-bottom: clamp(1.75rem, 3vw, 3rem);
  flex-wrap: wrap;
}

.section-head__text { max-width: 62ch; }
.section-head h2 { margin-top: var(--sp-2); }
.section-head p { margin-top: var(--sp-3); }

.title-rule {
  width: 56px;
  height: 1px;
  background: var(--gold);
  margin-top: var(--sp-4);
}

.section-head--center {
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.section-head--center .title-rule { margin-inline: auto; }

/* ---------- Text links ---------- */
.link-underline {
  position: relative;
  display: inline-block;
  padding-bottom: 3px;
  font-size: var(--fs-sm);
  letter-spacing: .16em;
  text-transform: uppercase;
}
.link-underline::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur) var(--ease);
}
.link-underline:hover::after { transform: scaleX(1); transform-origin: left; }

.link-gold { color: var(--gold-ink); }
.link-gold:hover { color: var(--ink); }

/* A compact "view all" link: the label and its arrow always stay on one row,
   even when the flex row they sit in gets squeezed by a long heading. */
.link-arrow {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: .5rem;
  font-size: var(--fs-sm);
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
}
.link-arrow svg { transition: transform var(--dur) var(--ease); }
.link-arrow:hover { color: var(--gold-ink); }
.link-arrow:hover svg { transform: translateX(5px); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
  --btn-bd: var(--ink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .95rem 1.9rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  font-size: var(--fs-xs);
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius);
  cursor: pointer;
  overflow: hidden;
  text-align: center;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease),
              border-color var(--dur) var(--ease), transform .2s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }

.btn--gold { --btn-bg: var(--gold-ink); --btn-bd: var(--gold-ink); --btn-fg: #fff; }
.btn--gold:hover { --btn-bg: var(--gold-deep); --btn-bd: var(--gold-deep); }

.btn--outline { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--ink); }
.btn--outline:hover { --btn-bg: var(--ink); --btn-fg: var(--paper); }

.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: transparent; padding-inline: .4rem; }
.btn--ghost:hover { color: var(--gold-ink); }

.btn--light { --btn-bg: var(--paper); --btn-fg: var(--ink); --btn-bd: var(--paper); }
.btn--light:hover { --btn-bg: transparent; --btn-fg: var(--paper); --btn-bd: var(--paper); }

.btn--outline-light { --btn-bg: transparent; --btn-fg: var(--bone); --btn-bd: rgba(247, 244, 239, .45); }
.btn--outline-light:hover { --btn-bg: var(--bone); --btn-fg: var(--ink); --btn-bd: var(--bone); }

.btn--block { width: 100%; }
.btn--sm { padding: .68rem 1.2rem; font-size: .65rem; }
.btn--lg { padding: 1.15rem 2.6rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.btn-row--center { justify-content: center; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .34rem .6rem;
  font-size: .62rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  line-height: 1;
}
.badge--sale { background: var(--wine); }
.badge--new { background: var(--sage); }
.badge--gold { background: var(--gold-ink); }
.badge--stock { background: var(--bone-2); color: var(--ink); }
.badge--out { background: var(--muted); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  font-size: var(--fs-xs);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-block: var(--sp-5);
}
.breadcrumbs a:hover { color: var(--gold-ink); }
.breadcrumbs li + li::before { content: "/"; margin-right: .5rem; opacity: .5; }
.breadcrumbs li { display: flex; align-items: center; }
.breadcrumbs [aria-current] { color: var(--ink); }

/* ---------- Forms ---------- */
.field { display: block; }
.field + .field { margin-top: var(--sp-4); }

.field__label {
  display: block;
  font-size: var(--fs-xs);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .45rem;
}
.field__label .req { color: var(--wine); }

.input, .select, .textarea {
  width: 100%;
  padding: .85rem 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--fs-base);
  color: var(--ink);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(176, 141, 87, .16);
}
.textarea { min-height: 150px; resize: vertical; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23746e65' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.field__hint { margin-top: .35rem; font-size: var(--fs-sm); color: var(--muted-2); }

.field__error {
  display: none;
  margin-top: .35rem;
  font-size: var(--fs-sm);
  color: var(--wine);
}
.field.is-invalid .input,
.field.is-invalid .select,
.field.is-invalid .textarea { border-color: var(--wine); }
.field.is-invalid .field__error { display: block; }

.checkbox {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  font-size: var(--fs-sm);
  color: var(--muted);
  cursor: pointer;
  line-height: 1.5;
}
.checkbox input {
  appearance: none;
  flex: 0 0 auto;
  width: 18px; height: 18px;
  margin-top: 2px;
  border: 1px solid var(--muted-2);
  border-radius: 2px;
  background: var(--paper);
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.checkbox input:checked {
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10'%3E%3Cpath d='M1 5l3.2 3.2L11 1.4' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") center/12px no-repeat;
  border-color: var(--ink);
}
.checkbox.is-invalid input { border-color: var(--wine); }
.checkbox.is-invalid { color: var(--wine); }

.form-note { font-size: var(--fs-sm); color: var(--muted-2); }

/* ---------- Keyframes ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(176, 141, 87, .5); }
  70% { box-shadow: 0 0 0 12px rgba(176, 141, 87, 0); }
  100% { box-shadow: 0 0 0 0 rgba(176, 141, 87, 0); }
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(22px); }
.reveal.is-visible { animation: fadeUp .85s var(--ease-out) forwards; }
.reveal--d1.is-visible { animation-delay: .09s; }
.reveal--d2.is-visible { animation-delay: .18s; }
.reveal--d3.is-visible { animation-delay: .27s; }
.reveal--d4.is-visible { animation-delay: .36s; }

/* ---------- Scrollbar ---------- */
.scroll-x {
  overflow-x: auto;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}
.scroll-x::-webkit-scrollbar { height: 6px; }
.scroll-x::-webkit-scrollbar-track { background: var(--bone-2); }
.scroll-x::-webkit-scrollbar-thumb { background: var(--sand); border-radius: 99px; }




/* Preserve the final button appearance while static product controls await handlers. */
[data-product-control-pending] { opacity: 1 !important; cursor: progress; }
