/* ================================================================
   SYNOXX - shared stylesheet (mobile-first)
   Sections: tokens, reset, typography, buttons, layout, header/nav,
   mega menu, hero, cards, catalogue/filters, product page, prose,
   footer, utilities.
   ================================================================ */

/* ---- Design tokens (official SYNOXX Brief Style Guide) ------------ */
:root {
  --color-primary: #2151A1;         /* Royal Blue */
  --color-primary-dark: #163A76;    /* darker royal for hover/active */
  --color-navy: #101B3C;            /* Midnight Navy */
  --color-accent: #F2B705;          /* Golden Yellow */
  --color-accent-dark: #D6A200;
  --color-accent-ink: #101B3C;      /* text on yellow (contrast) */
  --color-text: #303740;            /* Graphite */
  --color-muted: #575D64;
  --color-muted-2: #7D8288;
  --color-border: #CACDD1;
  --color-border-soft: #E4E7EB;
  --color-background: #ffffff;
  --color-surface: #F1F3F5;         /* Light Neutral */
  --color-surface-2: #E7EAEE;

  /* Space Grotesk = headings/display, Sora = body/UI (both self-hosted) */
  --font-heading: "Space Grotesk", "Sora", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-primary: "Sora", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --container-width: 75rem;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 27, 60, 0.06), 0 1px 3px rgba(16, 27, 60, 0.08);
  --shadow-md: 0 6px 18px rgba(16, 27, 60, 0.10);
  --shadow-lg: 0 18px 48px rgba(16, 27, 60, 0.16);

  --space-section: clamp(2.5rem, 6vw, 5rem);
  --header-h: 64px;
}

/* Self-hosted brand fonts (SIL OFL). Regenerate via scripts/convert-fonts.js. */
@font-face {
  font-family: "Sora";
  src: url("../fonts/sora-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Sora";
  src: url("../fonts/sora-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Sora";
  src: url("../fonts/sora-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---- Reset / base ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--color-text);
  background: var(--color-background);
  font-family: var(--font-primary);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 700; font-family: var(--font-heading); letter-spacing: -0.01em; }
p { margin: 0 0 1rem; }
ul { margin: 0; padding: 0; }
li { list-style: none; }
:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--color-primary); color: #fff; padding: 0.75rem 1rem; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ---- Layout ------------------------------------------------------- */
.container { width: min(100% - 2rem, var(--container-width)); margin-inline: auto; }
.section { padding-block: var(--space-section); }
.section--tight { padding-block: clamp(1.75rem, 4vw, 3rem); }
.section--muted { background: var(--color-surface); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.section__title { font-size: clamp(1.5rem, 3.5vw, 2.25rem); margin: 0; }
.section__title--sm { font-size: clamp(1.25rem, 2.5vw, 1.6rem); margin-bottom: 1.25rem; }
.section__link { font-weight: 600; white-space: nowrap; }

/* ---- Typography helpers ------------------------------------------ */
h1 { font-size: clamp(1.9rem, 5vw, 3rem); }

/* ---- Buttons ------------------------------------------------------ */
.button {
  --btn-bg: var(--color-primary); --btn-fg: #fff; --btn-bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 44px; padding: 0.6rem 1.15rem;
  font: inherit; font-weight: 600; line-height: 1.1; text-align: center;
  color: var(--btn-fg); background: var(--btn-bg); border: 1.5px solid var(--btn-bd);
  border-radius: var(--radius-sm); cursor: pointer; text-decoration: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .05s ease;
}
.button:hover { text-decoration: none; }
.button:active { transform: translateY(1px); }
.button--primary { --btn-bg: var(--color-primary); }
.button--primary:hover { --btn-bg: var(--color-primary-dark); }
.button--accent { --btn-bg: var(--color-accent); --btn-fg: var(--color-accent-ink); }
.button--accent:hover { --btn-bg: var(--color-accent-dark); }
.button--outline { --btn-bg: transparent; --btn-fg: var(--color-primary); --btn-bd: var(--color-primary); }
.button--outline:hover { --btn-bg: var(--color-primary); --btn-fg: #fff; }
.button--ghost { --btn-bg: var(--color-surface-2); --btn-fg: var(--color-text); }
.button--ghost:hover { --btn-bg: var(--color-border); }
.button--sm { min-height: 38px; padding: 0.4rem 0.75rem; font-size: 0.9rem; }
.button--lg { min-height: 52px; padding: 0.8rem 1.5rem; font-size: 1.05rem; }
.link-button { background: none; border: 0; color: var(--color-primary); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; padding: 0; }

/* ---- Header / nav ------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-background);
  border-bottom: 1px solid var(--color-border);
}
.site-header__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; }
.brand__logo { height: 30px; width: auto; }

.hamburger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; margin-left: auto;
  background: transparent; border: 1px solid var(--color-border); border-radius: var(--radius-sm); cursor: pointer;
}
.hamburger__box { position: relative; width: 20px; height: 2px; }
.hamburger__line, .hamburger__line::before, .hamburger__line::after {
  position: absolute; left: 0; width: 20px; height: 2px; background: var(--color-text); border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.hamburger__line { top: 0; }
.hamburger__line::before { content: ""; top: -6px; }
.hamburger__line::after { content: ""; top: 6px; }
.site-header.is-open .hamburger__line { background: transparent; }
.site-header.is-open .hamburger__line::before { transform: translateY(6px) rotate(45deg); }
.site-header.is-open .hamburger__line::after { transform: translateY(-6px) rotate(-45deg); }

/* Mobile drawer nav */
.nav {
  position: fixed; inset: var(--header-h) 0 0 auto;
  width: min(88vw, 380px);
  background: var(--color-background);
  border-left: 1px solid var(--color-border);
  transform: translateX(100%);
  transition: transform .25s ease;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.site-header.is-open .nav { transform: translateX(0); box-shadow: var(--shadow-lg); }
.nav__list { display: flex; flex-direction: column; gap: 0.25rem; }
.nav__link {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  width: 100%; min-height: 48px; padding: 0.5rem 0.5rem;
  color: var(--color-text); font-weight: 600; font-size: 1.05rem;
  background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer; text-align: left;
}
.nav__link:hover { background: var(--color-surface); text-decoration: none; }
.nav__link[aria-current="page"] { color: var(--color-primary); }
.nav__chevron { width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s ease; }
.nav__item--mega .nav__toggle[aria-expanded="true"] .nav__chevron { transform: rotate(-135deg); }
.nav__cta { margin-top: 0.75rem; }
.nav__cta .button { width: 100%; }

.nav-scrim { position: fixed; inset: 0; background: rgba(23,32,51,.45); z-index: 90; border: 0; }

/* ---- Mega menu (mobile accordion first) -------------------------- */
.mega { overflow: hidden; max-height: 0; transition: max-height .25s ease; }
.nav__item--mega .nav__toggle[aria-expanded="true"] + .mega { max-height: 2000px; }
.mega__inner { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.25rem 0 0.5rem; }
.mega__cat {
  display: flex; align-items: center; gap: 0.75rem; width: 100%;
  min-height: 48px; padding: 0.5rem; background: var(--color-surface); border: 0;
  border-radius: var(--radius-sm); cursor: pointer; text-align: left; font: inherit;
}
.mega__cat-icon { flex: 0 0 auto; width: 52px; height: 44px; display: grid; place-items: center; }
.mega__cat-icon img { width: 52px; height: 44px; object-fit: contain; }
.mega__cat-text { display: flex; flex-direction: column; flex: 1; }
.mega__cat-name { font-weight: 600; }
.mega__cat-count { font-size: 0.8rem; color: var(--color-muted); }
.mega__cat-arrow { width: 9px; height: 9px; border-right: 2px solid var(--color-muted); border-bottom: 2px solid var(--color-muted); transform: rotate(45deg); transition: transform .2s ease; }
.mega__group.is-active .mega__cat-arrow { transform: rotate(-135deg); }
.mega__panel { padding: 0.5rem 0.25rem 0.75rem 0.5rem; }
.mega__panel[hidden] { display: none; }
.mega__panel-head { margin-bottom: 0.5rem; }
.mega__panel-title { font-weight: 700; font-size: 1rem; }
.mega__panel-desc { display: none; }
.mega__subs { display: flex; flex-direction: column; gap: 0.1rem; }
.mega__subs a { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.5rem; color: var(--color-text); border-radius: var(--radius-sm); min-height: 48px; }
.mega__subs a:hover { background: var(--color-surface); text-decoration: none; color: var(--color-primary); }
.mega__sub-thumb { width: 48px; height: 38px; flex: 0 0 auto; object-fit: contain; background: var(--color-surface); border-radius: 6px; }
.mega__subs a:hover .mega__sub-thumb { background: #fff; }
.mega__sub-name { flex: 1; }
.mega__sub-count { color: var(--color-muted); font-size: 0.8rem; }
.mega__empty { color: var(--color-muted); padding: 0.5rem; }
.mega__panel-link { display: inline-block; font-weight: 600; margin-top: 0.4rem; padding: 0.4rem 0.5rem; }
.mega__foot { padding: 0.25rem; }
.mega__viewall { display: inline-block; font-weight: 700; padding: 0.5rem; }

/* ---- Hero --------------------------------------------------------- */
.hero { background: linear-gradient(160deg, var(--color-surface) 0%, var(--color-surface-2) 100%); }
.hero__inner { display: grid; gap: 1.5rem; padding-block: clamp(2rem, 6vw, 4rem); align-items: center; }
.hero__title { font-size: clamp(1.9rem, 6vw, 3.25rem); margin-bottom: 0.5rem; }
.hero__lede { font-size: clamp(1rem, 2.4vw, 1.2rem); color: var(--color-muted); max-width: 40ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
.hero__media img { margin-inline: auto; width: 100%; max-width: 520px; }
.hero__media--brand { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.hero__brand-logo { width: min(280px, 70%); height: auto; }
.hero__brand-art { width: 100%; max-width: 460px; }

/* ---- Hero carousel ---- */
.hero-carousel { position: relative; }
.hero-slide + .hero-slide { border-top: 1px solid var(--color-border-soft); }
.hero-slide__eyebrow { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; font-weight: 700; color: var(--color-primary); font-family: var(--font-heading); margin: 0 0 0.4rem; }
.hero__title--product { font-size: clamp(1.4rem, 4vw, 2.5rem); }
.hero-slide__price { font-family: var(--font-heading); font-weight: 700; font-size: clamp(1.4rem, 3vw, 1.9rem); color: var(--color-primary); margin: 0.25rem 0 0.6rem; }
.hero-slide__price-note { font-family: var(--font-primary); font-size: 0.8rem; font-weight: 500; color: var(--color-muted); }
.hero-slide--product .hero__media img { object-fit: contain; max-height: 300px; }

.hero-carousel.is-enhanced { overflow: hidden; }
.hero-carousel.is-enhanced .hero-carousel__track { display: flex; flex-wrap: nowrap; will-change: transform; transition: transform 0.5s ease; }
.hero-carousel.is-enhanced .hero-slide { min-width: 100%; border-top: 0; }
.hero-carousel__arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--color-border); background: rgba(255,255,255,0.9); color: var(--color-text); font-size: 1.7rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
.hero-carousel__arrow:hover { background: #fff; }
.hero-carousel__arrow--prev { left: 0.5rem; }
.hero-carousel__arrow--next { right: 0.5rem; }
.hero-carousel__dots { position: absolute; bottom: 0.75rem; left: 0; right: 0; display: flex; gap: 0.5rem; justify-content: center; z-index: 2; }
.hero-carousel__dot { width: 10px; height: 10px; border-radius: 50%; border: 0; background: rgba(16,27,60,0.25); cursor: pointer; padding: 0; transition: width 0.2s ease, background 0.2s ease; }
.hero-carousel__dot[aria-current="true"] { background: var(--color-primary); width: 24px; border-radius: 6px; }
@media (max-width: 48rem) { .hero-carousel__arrow { display: none; } }

/* ---- Category card image ---- */
.cat-card__img { width: 100%; height: 100%; object-fit: contain; padding: 0.75rem; }

/* ---- Category cards ---------------------------------------------- */
.cat-cards { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.cat-cards--scroll { grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 0.5rem; -webkit-overflow-scrolling: touch; }
.cat-cards--scroll > * { scroll-snap-align: start; }
.cat-card { display: flex; flex-direction: column; background: var(--color-background); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .15s ease, transform .15s ease; }
.cat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.cat-card__media { display: block; height: 180px; background: var(--color-surface); }
.cat-card__icon { display: grid; place-items: center; height: 100%; }
.cat-card__icon img { width: 64px; height: 64px; }
.cat-card__body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.cat-card__title { font-size: 1.2rem; margin: 0; }
.cat-card__title a { color: var(--color-text); }
.cat-card__desc { color: var(--color-muted); margin: 0; }
.cat-card__meta { font-size: 0.85rem; color: var(--color-muted); margin: 0; }
.cat-card__link { font-weight: 600; margin-top: auto; }

/* ---- Subcategory cards ------------------------------------------- */
.sub-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.sub-card { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1rem; background: var(--color-background); border: 1px solid var(--color-border); border-radius: var(--radius-sm); color: var(--color-text); }
.sub-card:hover { border-color: var(--color-primary); text-decoration: none; box-shadow: var(--shadow-sm); }
.sub-card__icon { flex: 0 0 auto; width: 56px; height: 44px; display: grid; place-items: center; }
.sub-card__icon img { width: 56px; height: 44px; object-fit: contain; }
.sub-card__text { display: flex; flex-direction: column; }
.sub-card__name { font-weight: 600; }
.sub-card__count { font-size: 0.8rem; color: var(--color-muted); }

/* ---- Product grid + card ----------------------------------------- */
.product-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.product-grid__empty { text-align: center; color: var(--color-muted); padding: 2rem 0; }
.product-card { position: relative; display: flex; flex-direction: column; background: var(--color-background); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .15s ease, transform .15s ease; }
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.product-card__badge { position: absolute; top: 0.75rem; left: 0.75rem; z-index: 1; background: var(--color-muted); color: #fff; font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.5rem; border-radius: 999px; }
.product-card__media { display: block; height: 200px; background: #fff; }
.product-card__media img { width: 100%; height: 100%; object-fit: contain; padding: 0.85rem; }
.product-card__body { display: flex; flex-direction: column; gap: 0.35rem; padding: 1rem 1.15rem 1.15rem; flex: 1; }
.product-card__sku { font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-muted); margin: 0; }
.product-card__title { font-size: 1.05rem; margin: 0; line-height: 1.3; }
.product-card__title a { color: var(--color-text); }
.product-card__title a:hover { color: var(--color-primary); }
.product-card__spec { font-weight: 600; color: var(--color-primary); margin: 0; }
.product-card__compat { font-size: 0.85rem; color: var(--color-muted); margin: 0; }
.product-card__price { font-family: var(--font-heading); font-weight: 700; font-size: 1.2rem; color: var(--color-primary); margin: 0.2rem 0 0; }
.product-card__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.product-card__actions .button { flex: 1 1 auto; }
.product-card__buy { font-size: 0.85rem; font-weight: 600; margin-top: 0.25rem; }

/* ---- Breadcrumbs -------------------------------------------------- */
.breadcrumbs { background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.breadcrumbs__list { display: flex; flex-wrap: wrap; gap: 0.35rem; padding-block: 0.6rem; font-size: 0.85rem; }
.breadcrumbs__item { display: flex; align-items: center; gap: 0.35rem; color: var(--color-muted); }
.breadcrumbs__item:not(:last-child)::after { content: "›"; color: var(--color-muted); }
.breadcrumbs__item [aria-current] { color: var(--color-text); font-weight: 600; }

/* ---- Page head ---------------------------------------------------- */
.page-head { max-width: 60ch; }
.page-head__title { margin-bottom: 0.5rem; }
.page-head__lede { color: var(--color-muted); font-size: 1.1rem; }
.page-head__back a { font-weight: 600; }

/* ---- Catalogue (filters + grid) ---------------------------------- */
.catalogue { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.toolbar { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.toolbar__count { margin: 0; color: var(--color-muted); }
.toolbar__sort { display: inline-flex; align-items: center; gap: 0.4rem; margin-left: auto; }
.toolbar__sort-label { font-size: 0.85rem; color: var(--color-muted); }
.toolbar__sort select, .filters__form select { font: inherit; padding: 0.4rem 0.5rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-background); min-height: 40px; }

/* Filters: off-canvas panel on mobile */
.filters {
  position: fixed; inset: 0 0 0 auto; z-index: 120; width: min(90vw, 340px);
  background: var(--color-background); border-left: 1px solid var(--color-border);
  transform: translateX(100%); transition: transform .25s ease;
  overflow-y: auto; padding: 1rem; box-shadow: var(--shadow-lg);
}
.filters.is-open { transform: translateX(0); }
.filters__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.filters__title { margin: 0; font-size: 1.25rem; }
.filters__clear { background: none; border: 0; color: var(--color-primary); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.filter__group { border-top: 1px solid var(--color-border); padding: 0.5rem 0; }
.filter__group:first-child { border-top: 0; }
.filter__summary { cursor: pointer; font-weight: 600; padding: 0.5rem 0; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.filter__summary::-webkit-details-marker { display: none; }
.filter__summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--color-muted); border-bottom: 2px solid var(--color-muted); transform: rotate(45deg); transition: transform .2s ease; }
.filter__group[open] .filter__summary::after { transform: rotate(-135deg); }
.filter__options { display: flex; flex-direction: column; gap: 0.15rem; padding-bottom: 0.5rem; }
.filter__option { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.25rem; min-height: 40px; cursor: pointer; }
.filter__option input { width: 18px; height: 18px; accent-color: var(--color-primary); }

/* ---- Product detail ---------------------------------------------- */
.product { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.gallery__main { position: relative; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; }
.gallery__open { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: #fff; cursor: zoom-in; }
.gallery__main img { width: 100%; height: 100%; object-fit: contain; padding: 1.5rem; }
.gallery__zoom { position: absolute; bottom: 0.6rem; right: 0.6rem; z-index: 2; width: 38px; height: 38px; display: grid; place-items: center; background: rgba(255,255,255,0.92); border: 1px solid var(--color-border); border-radius: 9px; color: var(--color-text); pointer-events: none; box-shadow: var(--shadow-sm); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(16,27,60,0.94); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox__img { max-width: 92vw; max-height: 86vh; object-fit: contain; background: #fff; border-radius: 8px; }
.lightbox__btn { position: absolute; display: grid; place-items: center; background: rgba(255,255,255,0.14); color: #fff; border: 1px solid rgba(255,255,255,0.35); border-radius: 50%; cursor: pointer; width: 48px; height: 48px; font-size: 1.8rem; line-height: 1; }
.lightbox__btn:hover { background: rgba(255,255,255,0.28); }
.lightbox__close { top: 1rem; right: 1rem; font-size: 1.5rem; }
.lightbox__prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox__counter { position: absolute; bottom: 1rem; left: 0; right: 0; text-align: center; color: #fff; font-size: 0.9rem; }
@media (max-width: 48rem) { .lightbox__btn { width: 42px; height: 42px; } .lightbox__prev { left: 0.4rem; } .lightbox__next { right: 0.4rem; } }
.gallery__badge { position: absolute; top: 1rem; left: 1rem; background: var(--color-muted); color: #fff; font-weight: 600; padding: 0.25rem 0.6rem; border-radius: 999px; font-size: 0.8rem; }
.gallery__thumbs { display: flex; gap: 0.5rem; margin-top: 0.75rem; flex-wrap: wrap; }
.gallery__thumb { padding: 0.25rem; background: var(--color-background); border: 1px solid var(--color-border); border-radius: var(--radius-sm); cursor: pointer; width: 64px; height: 52px; }
.gallery__thumb.is-active { border-color: var(--color-primary); }
.gallery__thumb img { width: 100%; height: 100%; object-fit: contain; }
.product__sku { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-muted); margin: 0 0 0.25rem; }
.product__title { font-size: clamp(1.5rem, 4vw, 2.2rem); }
.product__desc { color: var(--color-muted); font-size: 1.05rem; }
.product__price { font-family: var(--font-heading); font-weight: 700; font-size: clamp(1.6rem, 3.5vw, 2.1rem); color: var(--color-primary); margin: 0.25rem 0 0.75rem; display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.product__price-note { font-family: var(--font-primary); font-size: 0.85rem; font-weight: 500; color: var(--color-muted); }
.keyspecs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin: 1.25rem 0; padding: 0; }
.keyspec { background: var(--color-surface); border-radius: var(--radius-sm); padding: 0.6rem 0.75rem; }
.keyspec dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-muted); }
.keyspec dd { margin: 0.15rem 0 0; font-weight: 700; }
.product__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.75rem; }
.product__actions .button { flex: 1 1 200px; }
.product-details { display: flex; flex-direction: column; gap: 1.5rem; }
.product-block { border-top: 1px solid var(--color-border); padding-top: 1.25rem; }
.product-block:first-child { border-top: 0; padding-top: 0; }
.product-block__title { font-size: 1.15rem; }
.product-block__note { font-size: 0.9rem; color: var(--color-muted); }
.checklist li { position: relative; padding-left: 1.6rem; margin-bottom: 0.4rem; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 0.35rem; width: 8px; height: 14px; border-right: 3px solid var(--color-primary); border-bottom: 3px solid var(--color-primary); transform: rotate(45deg); }
.tag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag { display: inline-block; background: var(--color-surface-2); color: var(--color-primary-dark); font-size: 0.85rem; font-weight: 600; padding: 0.25rem 0.6rem; border-radius: 999px; }
.tag--muted { background: var(--color-surface); color: var(--color-muted); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.spec-table { width: 100%; border-collapse: collapse; min-width: 320px; }
.spec-table th, .spec-table td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--color-border); vertical-align: top; }
.spec-table tbody th { width: 45%; color: var(--color-muted); font-weight: 600; }
.spec-table--variants thead th { background: var(--color-surface); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--color-muted); }
.notice { padding: 0.85rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; }
.notice--warning { background: #fff4e5; border: 1px solid #ffd8a8; color: #7a4a00; }
.product__datasheet { margin-top: 0.5rem; }

/* ---- Prose pages -------------------------------------------------- */
.prose { max-width: 70ch; }
.prose--narrow { max-width: 65ch; }
.prose--center { text-align: center; margin-inline: auto; }
.prose__intro { font-size: 1.15rem; color: var(--color-muted); }
.prose__section h2 { margin-top: 1.5rem; }
.value-props { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.value-prop__title { font-size: 1.15rem; color: var(--color-primary); }

/* ---- Partners / Where to Buy ---- */
.page-head__eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; font-weight: 700; color: var(--color-primary); font-family: var(--font-heading); margin: 0 0 0.5rem; }
.partner-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.partner-card { display: flex; flex-direction: column; background: var(--color-background); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); color: var(--color-text); transition: box-shadow .15s ease, transform .15s ease; }
.partner-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; border-color: var(--color-primary); }
.partner-card__logo { display: flex; align-items: center; justify-content: center; height: 150px; background: #fff; padding: 1.25rem; border-bottom: 1px solid var(--color-border); overflow: hidden; }
.partner-card__logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.partner-card__fallback { font-family: var(--font-heading); font-weight: 700; font-size: 1.3rem; color: var(--color-primary); }
.partner-card__body { padding: 1.1rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: 0.3rem; }
.partner-card__name { font-family: var(--font-heading); font-weight: 700; font-size: 1.15rem; }
.partner-card__region { font-size: 0.85rem; color: var(--color-muted); }
.partner-card__desc { color: var(--color-muted); margin: 0.25rem 0; }
.partner-card__cta { font-weight: 600; color: var(--color-primary); margin-top: auto; }
.partner-cta { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.partner-cta__title { margin: 0 0 0.25rem; }
.partner-cta__text p { margin: 0; color: var(--color-muted); }

/* Buying options (product page) */
.buy-options { margin: 0.5rem 0 1rem; }
.buy-options__title { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-muted); margin: 0 0 0.6rem; }
.buy-option { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); margin-bottom: 0.6rem; color: var(--color-text); background: var(--color-background); }
.buy-option:hover { border-color: var(--color-primary); box-shadow: var(--shadow-sm); text-decoration: none; }
.buy-option__logo { flex: 0 0 auto; width: 84px; height: 48px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.buy-option__logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.buy-option__logo--icon { width: 48px; height: 48px; font-size: 1.6rem; font-weight: 700; color: var(--color-primary); background: var(--color-surface); border-radius: var(--radius-sm); }
.buy-option__text { flex: 1; display: flex; flex-direction: column; }
.buy-option__name { font-weight: 700; }
.buy-option__meta { font-size: 0.85rem; color: var(--color-muted); }
.buy-option__cta { font-weight: 600; color: var(--color-primary); white-space: nowrap; }
.buy-option--partner { border-style: dashed; }

/* Partner form */
.form-page { max-width: 720px; }
.partner-form { margin-top: 1rem; }
.partner-form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-bottom: 1.25rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field__label { font-weight: 600; font-size: 0.9rem; }
.field input, .field textarea { font: inherit; padding: 0.6rem 0.75rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-background); color: var(--color-text); width: 100%; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; border-color: var(--color-primary); }
.form-note { color: var(--color-muted); font-size: 0.9rem; margin-top: 0.75rem; }
@media (min-width: 48rem) {
  .partner-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .field--full { grid-column: 1 / -1; }
}
@media (min-width: 64rem) {
  .partner-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Footer ------------------------------------------------------- */
.site-footer { background: var(--color-navy); color: #c3ccdd; margin-top: var(--space-section); }
.site-footer a { color: #e3e9f4; }
.site-footer__grid { display: grid; grid-template-columns: 1fr; gap: 2rem; padding-block: 2.5rem; }
.footer__logo { height: 30px; width: auto; margin-bottom: 0.75rem; }
.footer__tagline { color: #9aa6bd; max-width: 34ch; }
.footer__heading { font-size: 1rem; color: #fff; margin-bottom: 0.75rem; }
.footer__links { display: flex; flex-direction: column; gap: 0.4rem; }
.site-footer__bottom { border-top: 1px solid rgba(255,255,255,.12); padding-block: 1.25rem; font-size: 0.85rem; color: #9aa6bd; }
.site-footer__bottom p { margin: 0; }

/* ---- Utilities ---------------------------------------------------- */
[hidden] { display: none !important; }

/* ================================================================
   Tablet  (>= 48rem / 768px)
   ================================================================ */
@media (min-width: 48rem) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-cards { grid-template-columns: repeat(2, 1fr); }
  .cat-cards--scroll { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); overflow: visible; }
  .hero__inner { grid-template-columns: 1.1fr 0.9fr; }
  .value-props { grid-template-columns: repeat(3, 1fr); }
  .site-footer__grid { grid-template-columns: 2fr 1fr 1fr; }
  .keyspecs { grid-template-columns: repeat(4, 1fr); }
}

/* ================================================================
   Desktop  (>= 64rem / 1024px)
   ================================================================ */
@media (min-width: 64rem) {
  .hamburger { display: none; }
  .nav-scrim { display: none !important; }

  /* Horizontal nav */
  .nav {
    position: static; width: auto; transform: none; background: none; border: 0;
    box-shadow: none; overflow: visible; padding: 0; flex-direction: row; align-items: center; gap: 1rem;
  }
  .nav__list { flex-direction: row; align-items: center; gap: 0.25rem; }
  .nav__item { position: relative; }
  .nav__link { min-height: 44px; font-size: 1rem; padding: 0.5rem 0.75rem; }
  .nav__cta { margin-top: 0; }
  .nav__cta .button { width: auto; }
  .nav__chevron { width: 8px; height: 8px; }

  /* Product grid: 3 columns */
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .cat-cards { grid-template-columns: repeat(3, 1fr); }
  .cat-cards--scroll { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .catalogue { grid-template-columns: 280px 1fr; align-items: start; }

  /* Filters become a static sidebar */
  .filters { position: sticky; top: calc(var(--header-h) + 1rem); inset: auto; width: auto; transform: none; box-shadow: none; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.25rem; max-height: calc(100vh - var(--header-h) - 2rem); }
  .toolbar__filter-toggle { display: none; }
  .filters__head .filters__clear { display: inline; }

  /* Product page: gallery + info side by side */
  .product { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
  .product__gallery { position: sticky; top: calc(var(--header-h) + 1rem); }

  /* --- Mega menu becomes a dropdown --- */
  .mega {
    position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(6px);
    width: min(880px, 90vw); max-height: none; overflow: visible;
    background: var(--color-background); border: 1px solid var(--color-border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
    padding: 1rem;
  }
  .nav__item--mega:hover .mega,
  .nav__item--mega:focus-within .mega,
  .nav__toggle[aria-expanded="true"] + .mega {
    opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0);
  }
  .mega__inner {
    display: block; position: relative; min-height: 340px; padding: 0;
  }
  /* Left rail = stacked category buttons (each group is rail-width and
     flows normally); panels are absolute and fill the right region. */
  .mega__group { width: 252px; }
  .mega__group + .mega__group { margin-top: 0.15rem; }
  .mega__cat { background: transparent; border-radius: var(--radius-sm); }
  .mega__cat:hover, .mega__group.is-active .mega__cat { background: var(--color-surface); color: var(--color-primary); }
  .mega__cat-arrow { border-color: currentColor; opacity: 0.6; transform: rotate(-45deg); }
  .mega__group.is-active .mega__cat-arrow { transform: rotate(-45deg); }
  .mega__panel {
    position: absolute; top: 0; left: 276px; right: 0; bottom: 0;
    padding: 0.25rem 0.25rem 0.25rem 1rem; border-left: 1px solid var(--color-border);
    overflow-y: auto;
  }
  .mega__panel-desc { display: block; color: var(--color-muted); font-size: 0.9rem; margin: 0.25rem 0 0.75rem; }
  .mega__subs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.1rem; }
  .mega__foot { border-top: 1px solid var(--color-border); margin-top: 0.75rem; padding: 0.5rem 0 0; }
}

/* ================================================================
   Large desktop (>= 80rem / 1280px) - optional 4-up grid
   ================================================================ */
@media (min-width: 80rem) {
  .page-catalogue .catalogue .product-grid { grid-template-columns: repeat(3, 1fr); }
  .cat-cards--scroll { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}

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