/* ============================================================
   4Tex Spare Parts Shop
   tokens.css — design tokens, reset, typography, layout, buttons,
   cards, badges. Ported 1:1 from the 4tex.at corporate design
   system so the shop reads as part of the same website.
   No frameworks. No external font/network dependencies.
   ============================================================ */

/* ---- 1. Design tokens ------------------------------------ */
:root {
  /* Brand colours — binding corporate design */
  --navy-900: #071A2F;
  --navy-800: #0A2540;
  --navy-700: #123457;
  --navy-600: #1E4B78;
  --steel-500: #4A6079;
  --steel:    #5B7290;
  --grey-050: #F5F7FA;
  --grey-100: #ECEFF3;
  --grey-200: #D9DEE6;
  --grey-400: #9AA6B4;
  --grey-600: #5A6675;
  --ink-900:  #0D0D0D;
  --ink-700:  #22282F;
  --white:    #FFFFFF;

  /* Semantic */
  --bg:            var(--white);
  --bg-alt:        var(--grey-050);
  --bg-invert:     var(--navy-800);
  --text:          var(--ink-700);
  --text-strong:   var(--ink-900);
  --text-muted:    var(--grey-600);
  --border:        var(--grey-100);
  --border-strong: var(--grey-200);
  --brand:         var(--navy-800);
  --brand-hover:   var(--navy-700);

  /* Typography — system-first, no network dependency (CSP-safe) */
  --font-black: "Arial Black", "Arial Bold", Arial, sans-serif;
  --font-display: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: "Arial Black", "Arial Bold", Arial, sans-serif;

  /* Type scale (fluid) */
  --fs-hero:   clamp(2.2rem, 1.5rem + 3.2vw, 4.4rem);
  --fs-h1:     clamp(2rem, 1.5rem + 2.2vw, 3.2rem);
  --fs-h2:     clamp(1.6rem, 1.3rem + 1.4vw, 2.4rem);
  --fs-h3:     clamp(1.25rem, 1.1rem + 0.6vw, 1.55rem);
  --fs-lead:   clamp(1.05rem, 1rem + 0.4vw, 1.3rem);
  --fs-body:   1rem;
  --fs-small:  0.875rem;
  --fs-eyebrow: 0.78rem;

  /* Spacing (8px base grid) */
  --sp-1: 0.5rem;  --sp-2: 1rem;   --sp-3: 1.5rem;  --sp-4: 2rem;
  --sp-5: 3rem;    --sp-6: 4rem;   --sp-7: 6rem;    --sp-8: 8rem;

  /* Layout */
  --container: 1480px;
  --container-narrow: 1040px;
  --radius: 8px;
  --radius-lg: 20px;
  --radius-pill: 100px;
  --header-h: 76px;

  /* Navigation — binding corporate palette (white / black / grey / blue only) */
  --nav-blue: #005A9C;
  --nav-grey: #666666;

  /* Elevation & motion */
  --shadow-sm: 0 1px 2px rgba(7,26,47,.06), 0 1px 3px rgba(7,26,47,.05);
  --shadow-md: 0 4px 16px rgba(7,26,47,.08), 0 2px 6px rgba(7,26,47,.05);
  --shadow-lg: 0 18px 50px rgba(7,26,47,.14);
  --ease: cubic-bezier(.22,.61,.36,1);
  --dur: .5s;

  --logo-src: url("../images/logo-mask.svg");
}

/* ---- 2. Reset & base ------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
  overflow-x: clip;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--brand-hover); }
ul, ol { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font: inherit; }
h1,h2,h3 { font-family: var(--font-black); color: var(--text-strong);
  line-height: 1.16; font-weight: 900; letter-spacing: .005em; }
h4 { font-family: var(--font-display); color: var(--text-strong);
  line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }

/* ---- 3. Typography helpers ------------------------------- */
.eyebrow {
  font-family: var(--font-display); font-size: .8rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--navy-600); font-weight: 700; display: block;
}
.lead { font-size: var(--fs-lead); color: var(--text-muted); line-height: 1.6; }
.section-title { font-size: var(--fs-h2); margin: var(--sp-2) 0 var(--sp-3); max-width: 26ch; }
.text-balance { text-wrap: balance; }

/* ---- 4. Layout primitives -------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem); }
.container--narrow { max-width: var(--container-narrow); }
.section { padding-block: clamp(3.5rem, 7vw, 7rem); }
.section--tint { background: var(--bg-alt); }
.section--invert { background: var(--navy-800); color: #C9D4E0; }
.section--invert h1, .section--invert h2, .section--invert h3 { color: #fff; }
.section--invert .lead { color: #A9B8CB; }
.section--invert .eyebrow { color: #7F9BBE; }

.grid { display: grid; gap: var(--sp-4); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.stack > * + * { margin-top: var(--sp-2); }

/* ---- 5. Buttons -------------------------------------------
   Rectangular with a precise 3px radius, uppercase display type
   with wide tracking, calm 300ms transitions and a sliding arrow. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .7rem;
  padding: 1.05rem 2.1rem; border-radius: 3px;
  font-family: var(--font-display); font-weight: 600; font-size: .85rem;
  letter-spacing: .1em; text-transform: uppercase;
  transition: all .3s var(--ease); position: relative;
  cursor: pointer; white-space: nowrap; border: 1px solid transparent;
}
.btn svg { width: 1.05em; height: 1.05em; flex-shrink: 0; }
.btn--primary {
  background: linear-gradient(160deg, var(--navy-700) 0%, var(--navy-800) 60%, var(--navy-900) 100%);
  color: #fff; border-color: rgba(255,255,255,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 2px 8px rgba(7,26,47,.22);
}
.btn--primary:hover {
  background: linear-gradient(160deg, var(--navy-600) 0%, var(--navy-700) 60%, var(--navy-800) 100%);
  color: #fff; transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 10px 26px rgba(7,26,47,.32);
}
.btn--ghost { background: transparent; color: var(--navy-800); border-color: var(--navy-800); box-shadow: none; }
.btn--ghost:hover { background: var(--navy-800); color: #fff; transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(7,26,47,.24); }
.btn--light { background: #fff; color: var(--navy-800); border-color: #fff; }
.btn--light:hover { background: var(--grey-050); color: var(--navy-800); transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0,0,0,.25); }
.btn--on-dark { border-color: rgba(255,255,255,.55); color: #fff; background: rgba(255,255,255,.02); }
.btn--on-dark:hover { border-color: #fff; background: rgba(255,255,255,.12); color: #fff; transform: translateY(-2px); }
.btn--sm { padding: .7rem 1.3rem; font-size: .76rem; }
.btn--block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none !important;
  box-shadow: none !important; }
.btn .arrow { transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn:active { transform: translateY(0); }

.link-arrow { display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--font-display); font-weight: 500; font-size: .95rem; color: var(--navy-800); }
.link-arrow .arrow { transition: transform .25s var(--ease); }
.link-arrow:hover .arrow { transform: translateX(4px); }

/* ---- 6. Cards -------------------------------------------- */
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--sp-4); transition: transform .35s var(--ease), box-shadow .35s var(--ease),
    border-color .35s var(--ease); height: 100%;
  box-shadow: var(--shadow-sm);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card__icon {
  width: 52px; height: 52px; color: #fff; margin-bottom: var(--sp-3);
  display: grid; place-items: center; border-radius: 14px;
  background: linear-gradient(135deg, var(--navy-600), var(--navy-800));
}
.card__icon svg { width: 24px; height: 24px; }
.card h3 { font-size: var(--fs-h3); margin-bottom: .6rem; }
.card p { color: var(--text-muted); font-size: .96rem; }

/* ---- 7. Media frames --------------------------------------- */
.media { position: relative; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--grey-050); border: 1px solid var(--border); }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media--product { background: #fff; border-color: var(--border-strong); }
.media--product img { object-fit: cover; }
.media--square { aspect-ratio: 1/1; }
.media--zoom img { transition: transform .8s var(--ease); }
.media--zoom:hover img { transform: scale(1.045); }

/* ---- 8. Badges / pills ------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--font-mono);
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--navy-800); background: var(--grey-050); border: 1px solid var(--border-strong);
  padding: .3rem .7rem; border-radius: 100px; }
.pill--soon { color: var(--steel); background: transparent; border-style: dashed; }
.pill--accent { color: #fff; background: var(--nav-blue); border-color: var(--nav-blue); }

/* ---- 9. Breadcrumb ------------------------------------------ */
.breadcrumb { padding-block: var(--sp-2); font-size: var(--fs-small); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  font-family: var(--font-display); letter-spacing: .01em; }
.breadcrumb li { display: flex; align-items: center; gap: .5rem; color: var(--text-muted); }
.breadcrumb li:not(:last-child)::after { content: "/"; color: var(--grey-400); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--navy-800); }
.breadcrumb [aria-current="page"] { color: var(--navy-800); }

/* ---- 10. Page hero (interior) -------------------------------- */
.page-hero { background: linear-gradient(155deg, #ffffff 0%, #eef3f9 55%, #e7eef7 100%);
  padding-block: clamp(2rem,4vw,3rem) clamp(2.5rem,5vw,4rem); position: relative; overflow: hidden; }
.page-hero .container { position: relative; z-index: 2; }
.page-hero h1 { color: var(--text-strong); font-size: var(--fs-h1); max-width: 24ch; margin-block: var(--sp-2) var(--sp-2); }
.page-hero .lead { color: var(--text-muted); max-width: 60ch; }

/* ---- 11. Utility ---------------------------------------------- */
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.mw-60 { max-width: 60ch; }
.mt-4 { margin-top: var(--sp-4); }
.mt-3 { margin-top: var(--sp-3); }
.hidden { display: none !important; }
.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: 12px; top: -60px; z-index: 1000; background: var(--navy-800);
  color: #fff; padding: .7rem 1.1rem; border-radius: var(--radius); transition: top .2s var(--ease); }
.skip-link:focus { top: 12px; color: #fff; }
:focus-visible { outline: 2px solid var(--navy-600); outline-offset: 3px; border-radius: 2px; }

/* ============================================================
   DARK MODE — activated via data-theme="dark" on <html>.
   ============================================================ */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:            #0B0F15;
  --bg-alt:        #10161F;
  --text:          #C4CEDA;
  --text-strong:   #F3F6FA;
  --text-muted:    #97A4B2;
  --border:        #1D2734;
  --border-strong: #2C3848;
  --brand:         #5FA8E0;
  --brand-hover:   #82BCEA;
  --nav-blue:      #4FA3E3;
  --nav-grey:      #A5B1BE;
  --grey-050:      #10161F;
  --grey-100:      #1D2734;
  --grey-200:      #2C3848;
  --grey-400:      #8593A2;
  --grey-600:      #A9B5C2;
  --steel:         #8CA3BC;
  --navy-600:      #6FAEE4;
  --navy-800:      #BBD3EA;
  --navy-700:      #8FBCE6;
  --ink-900:       #F3F6FA;
  --ink-700:       #C4CEDA;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.5), 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.4);
  --shadow-lg: 0 18px 50px rgba(0,0,0,.6);
}
:root[data-theme="dark"] .btn--primary {
  background: linear-gradient(160deg, #123457 0%, #0A2540 60%, #071A2F 100%);
  color: #fff; border-color: rgba(255,255,255,.18);
}
:root[data-theme="dark"] .btn--primary:hover {
  background: linear-gradient(160deg, #1E4B78 0%, #123457 60%, #0A2540 100%); color: #fff;
}
:root[data-theme="dark"] .btn--light { background: #E8F0F8; color: #0A2540; border-color: #E8F0F8; }
:root[data-theme="dark"] .btn--light:hover { background: #fff; color: #0A2540; }
:root[data-theme="dark"] .btn--ghost { color: #E8F1F9; border-color: #55708C; }
:root[data-theme="dark"] .btn--ghost:hover { background: #E8F1F9; color: #0A2540; }
:root[data-theme="dark"] .card__icon { background: linear-gradient(135deg, #1E4B78, #0A2540); color: #fff; }
:root[data-theme="dark"] .card { background: #121A25; }
:root[data-theme="dark"] .media { background: #121A25; }
/* Product photos keep a white mount even in dark mode — their own
   background is white, so a dark tile would show as a visible frame
   around every photo instead of blending in. */
:root[data-theme="dark"] .pill { background: #121A25; color: #A9C7E2; }
:root[data-theme="dark"] .page-hero { background: linear-gradient(155deg, #0B0F15 0%, #0E141D 55%, #101826 100%); }
:root[data-theme="dark"] .link-arrow { color: #7FB6E8; }
