/* =============================================================================
   ALTAY — core: design tokens, page reboot, shared controls.
   Source of truth: designs/Altay/design_handoff_altay_jtl (docs/01-design-tokens.md,
   tokens/tokens.css). Every value below is the designer's.

   Tokens live on .jtlw (the <body>): the editor writes a merchant's colour at that
   scope, so palettes and themes are declared with :where() — same weight as .jtlw,
   earlier in the cascade — and a merchant's own colour still wins.

   Load order: altay_crit.css (inline) → base.css (Bootstrap/JTL) → altay-core.css →
   altay-shell.css → altay-card.css → page sheets. Altay Bento adds bento.css last.
   ========================================================================== */

/* ---- Direction A · Editorial. Three base colours per palette ---------------- */
.jtlw {
  --paper: #F3EFE6; --ink: #1A1814; --accent: #C2410C;
}
.jtlw:where(.al-pal-signalblau) { --paper: #F5F5F7; --ink: #1D1D1F; --accent: #007AFF; }
.jtlw:where(.al-pal-kobalt)     { --paper: #F1F1EE; --ink: #11141C; --accent: #2B44D1; }
.jtlw:where(.al-pal-pflaume)    { --paper: #F5EFEF; --ink: #1F1418; --accent: #8A2D55; }
.jtlw:where(.al-pal-ocker)      { --paper: #F4F0E4; --ink: #13223A; --accent: #A3600F; }

.jtlw {
  /* derived roles — a palette (or a merchant's colour) changes only the three above */
  --surface: color-mix(in oklab, var(--paper) 45%, white);
  --hover:   color-mix(in oklab, var(--ink) 5%,  var(--paper));
  --track:   color-mix(in oklab, var(--ink) 9%,  var(--paper));
  --line:    color-mix(in oklab, var(--ink) 12%, var(--paper));
  --line2:   color-mix(in oklab, var(--ink) 20%, var(--paper));
  --muted2:  color-mix(in oklab, var(--ink) 45%, var(--paper));
  --muted:   color-mix(in oklab, var(--ink) 62%, var(--paper));
  --ink2:    color-mix(in oklab, var(--ink) 78%, var(--paper));
  --accent-soft: color-mix(in oklab, var(--accent) 12%, white);
  --accent-ink: var(--accent);
  --on-accent: #FFFFFF;
  --scrim: rgba(26, 24, 20, .45);
  --success: #3B8A4A; --warn: #C98A1B; --danger: #B5443A;

  --font-display: "Gloock", Georgia, serif;
  --font-body: "Figtree", system-ui, sans-serif;
  --font-family-sans-serif: var(--font-body);   /* the Bootstrap base (base.css) draws text, tooltips and popovers in it */
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --display-weight: 400;
  --container: 1360px; --gutter: 32px;

  --r-xs: 6px; --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 24px; --r-2xl: 28px; --r-pill: 999px;
  --shadow-pop: 0 30px 60px -24px rgba(0,0,0,.3);
  --shadow-dialog: 0 40px 100px -30px rgba(0,0,0,.5);
  --shadow-lift: 0 24px 40px -24px rgba(26,24,20,.35);
  --ease-out: cubic-bezier(.2,.7,.2,1);
  --ease-spring: cubic-bezier(.3,1.6,.5,1);
  --ease-snap: cubic-bezier(.7,0,.2,1);

  /* names the editor and JTL widget skins know from the Prisma family */
  --red: var(--accent); --redSoft: var(--accent-soft); --onRed: var(--on-accent);
  --sand: var(--hover); --panel: var(--ink); --onPanel: var(--paper);
  --mono: var(--font-mono); --maxw: var(--container);
  --ok: var(--success); --star: var(--ink);
}

/* ---- Reboot ------------------------------------------------------------------
   base.css is Bootstrap 4 + JTL: it sets body 1rem/1.5, headings 500/1.2 with a
   .5rem bottom margin, p with a 1rem bottom margin. The designs were drawn on the
   browser's own defaults (line-height normal, UA margins), so the page goes back
   to those; each component then states its own values, as the designer did. */
html { -webkit-text-size-adjust: 100%; }
body.jtlw {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: left;
}
:where(.jtlw) *, :where(.jtlw) *::before, :where(.jtlw) *::after { box-sizing: border-box; }
:where(.jtlw) a { color: var(--ink); text-decoration: none; background-color: transparent; }
:where(.jtlw) a:hover { color: var(--accent-ink); text-decoration: none; }
:where(.jtlw) h1, :where(.jtlw) h2, :where(.jtlw) h3, :where(.jtlw) h4, :where(.jtlw) h5, :where(.jtlw) h6,
:where(.jtlw) .h1, :where(.jtlw) .h2, :where(.jtlw) .h3, :where(.jtlw) .h4, :where(.jtlw) .h5, :where(.jtlw) .h6 {
  margin: 0; font-family: inherit; font-weight: inherit; line-height: inherit; color: inherit; font-size: inherit;
}
:where(.jtlw) p { margin: 0; }
:where(.jtlw) ul, :where(.jtlw) ol { margin: 0; padding: 0; list-style: none; }
:where(.jtlw) b, :where(.jtlw) strong { font-weight: 700; }
:where(.jtlw) img, :where(.jtlw) svg { vertical-align: middle; }
:where(.jtlw) button, :where(.jtlw) input, :where(.jtlw) select, :where(.jtlw) textarea, :where(.jtlw) optgroup {
  font: inherit; color: inherit; margin: 0; line-height: normal;
}
:where(.jtlw) button { cursor: pointer; text-transform: none; }
:where(.jtlw) button:focus:not(:focus-visible) { outline: none; }
:where(.jtlw) :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:where(.jtlw) input[type=range] { accent-color: var(--accent); }
:where(.jtlw) [hidden] { display: none !important; }
:where(.jtlw) hr { margin: 0; border: 0; border-top: 1px solid var(--line); }
:where(.jtlw) label { margin: 0; }
:where(.jtlw) table { border-collapse: collapse; }
:where(.jtlw) ::selection { background: var(--accent); color: var(--on-accent); }

/* page column: the content of every page stands on this rail */
.al-wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

/* ---- Type roles (docs/01 · Typography A) ----------------------------------- */
.al-display { font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(64px, 9vw, 150px); line-height: .85; letter-spacing: -.025em; }
.al-h2 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(36px, 4vw, 56px); line-height: 1; letter-spacing: -.02em; }
.al-kicker { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.al-kicker--accent { color: var(--accent-ink); }
.al-muted { color: var(--muted); }

/* ---- Buttons (docs/02 · Buttons) ------------------------------------------- */
.al-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  font: 600 15px var(--font-body); white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background .2s, color .2s, border-color .2s;
}
.al-btn:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.al-btn--l { height: 56px; padding: 0 28px; font-size: 16px; }
.al-btn--s { height: 40px; padding: 0 18px; font-size: 14px; }
.al-btn--accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.al-btn--accent:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.al-btn--ghost { background: transparent; color: var(--ink); }
.al-btn--ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.al-btn--block { display: flex; width: 100%; }
.al-btn[disabled], .al-btn.is-disabled { opacity: .45; cursor: not-allowed; }
.al-btn.is-busy::before {
  content: ''; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor;
  border-top-color: transparent; animation: al-spin .8s linear infinite;
}
@keyframes al-spin { to { transform: rotate(360deg); } }

.al-iconbtn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink); cursor: pointer;
}
.al-iconbtn:hover { background: var(--hover); color: var(--ink); }

.al-link { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---- Chips ----------------------------------------------------------------- */
.al-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line2); background: transparent; color: var(--ink);
  font: 500 14px var(--font-body); white-space: nowrap; cursor: pointer;
}
.al-chip:hover { border-color: var(--ink); color: var(--ink); }
.al-chip.is-active, .al-chip[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.al-chip__n { opacity: .55; font-size: 12px; }

/* ---- Inputs ---------------------------------------------------------------- */
.al-input, .jtlw .form-control {
  height: 52px; width: 100%; padding: 0 16px; border-radius: 14px;
  border: 1px solid var(--line2); background: var(--surface); color: var(--ink);
  font: 400 15px var(--font-body); outline: none; box-shadow: none;
  transition: border-color .2s;
}
.jtlw textarea.form-control, textarea.al-input { height: auto; min-height: 120px; padding: 14px 16px; line-height: 1.5; }
.al-input:focus, .jtlw .form-control:focus { border-color: var(--ink); box-shadow: none; background: var(--surface); color: var(--ink); }
.jtlw .has-error .form-control, .al-input.is-invalid, .jtlw .form-control.is-invalid { border-color: var(--accent); }
.al-check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.al-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.al-check__box {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--ink); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; color: var(--paper); font-size: 12px; background: transparent;
}
.al-check input:checked + .al-check__box { background: var(--ink); }
.al-check input:checked + .al-check__box::after { content: '✓'; }

/* shake (validation) and spring-in, shared by forms and the PDP */
@keyframes al-shake { 0%,100% { transform: translateX(0) } 20% { transform: translateX(-7px) } 40% { transform: translateX(7px) } 60% { transform: translateX(-7px) } 80% { transform: translateX(7px) } }
.al-shake { animation: al-shake .33s linear; }

/* ---- Scroll reveal (docs/05) — fail-open: only marked elements wait --------- */
.al-rv { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.al-rv.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  :where(.jtlw) *, :where(.jtlw) *::before, :where(.jtlw) *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .al-rv { opacity: 1; transform: none; }
}

/* ---- Breakpoints (docs/06): tablet 768–1099 → gutter 20, phone < 768 → 16 ---- */
@media (max-width: 1099px) { .jtlw { --gutter: 20px; } }
@media (max-width: 767px)  { .jtlw { --gutter: 16px; } }

/* Text from JTL-Wawi or the JTL admin (product, category and manufacturer descriptions, CMS
   pages, OPC) may bring its own typeface: style="font-family:Calibri" pasted from a word
   processor, or <font face="Arial">. Our templates never write a font that way, so every such
   element takes the template's font instead — we only use our own fonts (owner, 2026-11-02).
   Bold, italic, size and colour from the Wawi stay. */
.jtlw [style*="font-family" i], .jtlw [style*="font:" i], .jtlw [style*="font :" i], .jtlw font[face] { font-family: inherit !important; }
