/* ========================================================
   DESIGN TOKENS — ported 1:1 from Industrix theme style.css
   Single source of truth for all design decisions.
   Admin (Filament settings) overrides selected values by
   injecting an inline <style> with the same variable names,
   exactly like the old WordPress Customizer did.
======================================================== */
:root {
  /* ── Brand colors (overridden by admin settings) ─── */
  --color-primary:        #004A8F;
  --color-primary-dark:   #00345F;
  --color-primary-light:  #2E73B8;
  --color-accent:         #F58220;
  --color-accent-dark:    #C8651A;

  /* RGB triplets — for use in rgba(). Format: "r g b" (modern syntax). */
  --color-primary-rgb:    0 74 143;
  --color-accent-rgb:     245 130 32;

  /* ── Neutrals ────────────────────────────────────── */
  --color-bg:             #F4F6F8;
  --color-surface:        #FFFFFF;
  --color-border:         #DDE3EA;
  --color-text:           #1A2332;
  --color-text-muted:     #6B7A8D;

  /* ── Semantic ────────────────────────────────────── */
  --color-success:        #1DB954;
  --color-success-dark:   #168F40;
  --color-warning:        #F59E0B;
  --color-warning-dark:   #B45309;
  --color-danger:         #DC2626;
  --color-danger-dark:    #991B1B;
  --color-info:           #3B82F6;
  --color-info-dark:      #1E40AF;

  /* ── Spacing scale (4pt grid) ────────────────────── */
  --space-0:   0;
  --space-1:   0.25rem;     /* 4px  */
  --space-2:   0.5rem;      /* 8px  */
  --space-3:   0.75rem;     /* 12px */
  --space-4:   1rem;        /* 16px */
  --space-5:   1.25rem;     /* 20px */
  --space-6:   1.5rem;      /* 24px */
  --space-7:   2rem;        /* 32px */
  --space-8:   2.5rem;      /* 40px */
  --space-9:   3rem;        /* 48px */
  --space-10:  4rem;        /* 64px */
  --space-12:  5rem;        /* 80px */
  --space-16:  6rem;        /* 96px */

  /* ── Type scale (fluid) ──────────────────────────── */
  --fs-xs:     clamp(0.72rem, 0.7rem + 0.1vw, 0.78rem);
  --fs-sm:     clamp(0.82rem, 0.78rem + 0.15vw, 0.88rem);
  --fs-base:   clamp(0.95rem, 0.9rem + 0.2vw, 1rem);
  --fs-md:     clamp(1rem, 0.92rem + 0.3vw, 1.125rem);
  --fs-lg:     clamp(1.1rem, 1rem + 0.4vw, 1.25rem);
  --fs-xl:     clamp(1.4rem, 1.2rem + 0.8vw, 1.75rem);
  --fs-2xl:    clamp(1.8rem, 1.4rem + 1.6vw, 2.5rem);
  --fs-3xl:    clamp(2.4rem, 1.6rem + 3vw, 3.5rem);
  --fs-4xl:    clamp(2.8rem, 1.8rem + 4vw, 4.5rem);

  --lh-tight:  1.2;
  --lh-snug:   1.4;
  --lh-base:   1.6;
  --lh-relaxed:1.75;

  /* ── Fonts ───────────────────────────────────────── */
  --font-heading: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:    'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    ui-monospace, 'JetBrains Mono', 'Fira Code', SFMono-Regular, Menlo, monospace;

  /* ── Border radius ───────────────────────────────── */
  --radius-xs:  3px;
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* ── Shadows ─────────────────────────────────────── */
  --shadow-xs:  0 1px 1px rgba(0,0,0,.04);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 30px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);
  --shadow-xl:  0 20px 50px rgba(0,0,0,.15);
  --shadow-2xl: 0 30px 80px rgba(0,0,0,.2);
  --shadow-focus: 0 0 0 3px rgba(var(--color-primary-rgb), .35);

  /* ── Motion ──────────────────────────────────────── */
  --transition-fast: 0.15s cubic-bezier(.4,0,.2,1);
  --transition:      0.22s cubic-bezier(.4,0,.2,1);
  --transition-slow: 0.4s cubic-bezier(.4,0,.2,1);

  /* ── Layout ──────────────────────────────────────── */
  --container-max:    1320px;
  --container-narrow: 900px;
  --container-wide:   1520px;
  --container-pad:    clamp(1rem, 4vw, 2rem);
  --section-py:       clamp(2.5rem, 6vw, 6rem);

  /* ── Standardized breakpoints (used in @media via theme) ── */
  /* xs: 400px / sm: 640px / md: 768px / lg: 1024px / xl: 1280px / 2xl: 1536px */

  /* ── Header ──────────────────────────────────────── */
  --header-height:    72px;
  --topbar-height:    38px;

  /* ── BUTTONS — token-based ───────────────────────── */
  --btn-h-sm:        32px;
  --btn-h:           44px;       /* WCAG 2.5.5 minimum touch target */
  --btn-h-lg:        56px;
  --btn-pad-x:       1.75rem;
  --btn-pad-x-sm:    1rem;
  --btn-pad-x-lg:    2.5rem;
  --btn-radius:      var(--radius-md);
  --btn-fw:          600;
  --btn-tracking:    0;
  --btn-transform:   none;
  --btn-fs:          var(--fs-sm);
  --btn-fs-sm:       var(--fs-xs);
  --btn-fs-lg:       var(--fs-base);
  --btn-bw:          2px;          /* outline variant */
  --btn-shadow:      var(--shadow-xs);
  --btn-shadow-hover:var(--shadow-sm);
  --btn-gap:         .5rem;

  /* ── CARDS — token-based ─────────────────────────── */
  --card-bg:           var(--color-surface);
  --card-border-w:     1px;
  --card-border-color: var(--color-border);
  --card-radius:       var(--radius-lg);
  --card-pad:          var(--space-6);
  --card-pad-sm:       var(--space-4);
  --card-shadow:       var(--shadow-sm);
  --card-shadow-hover: var(--shadow-md);
  --card-hover-translate: -4px;
  --card-image-radius: calc(var(--card-radius) - 2px);

  /* ── LINKS (in-prose) ────────────────────────────── */
  --link-color:        var(--color-primary);
  --link-color-hover:  var(--color-accent);
  --link-decoration:   none;
  --link-decoration-hover: underline;
  --link-offset:       2px;

  /* ── NAVIGATION ──────────────────────────────────── */
  --nav-fs:        var(--fs-sm);
  --nav-fw:        500;
  --nav-tracking:  0;
  --nav-transform: none;
  --nav-gap:       1.5rem;
  --nav-link-color: var(--color-text);
  --nav-link-hover: var(--color-primary);

  /* ── INPUT / FIELD ──────────────────────────────── */
  --field-h:           42px;
  --field-pad-x:       0.9rem;
  --field-radius:      var(--radius-md);
  --field-border:      1.5px solid var(--color-border);
  --field-border-focus:1.5px solid var(--color-primary);
  --field-bg:          var(--color-surface);
  --field-fs:          var(--fs-sm);

  /* ── Z-INDEX SCALE ──────────────────────────────── */
  --z-base:     1;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-mega:     400;
  --z-overlay:  800;
  --z-header:   900;
  --z-drawer:   950;
  --z-modal:    1000;
  --z-toast:    1100;
}
/* ========================================================
   BASE LAYER — consumes tokens.css. Framework-agnostic.
   This is the foundation; component CSS (product cards,
   mega-menu detail, mini-cart drawer, quick-view modal)
   is ported per phase from the legacy Industrix style.css.
======================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
h1,h2,h3,h4,h5,h6 { font-family: var(--font-heading); line-height: var(--lh-tight); margin: 0 0 var(--space-4); font-weight: 700; color: var(--color-text); }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
p  { margin: 0 0 var(--space-4); }

a {
  color: var(--link-color);
  text-decoration: var(--link-decoration);
  text-underline-offset: var(--link-offset);
  transition: color var(--transition-fast);
}
a:hover { color: var(--link-color-hover); text-decoration: var(--link-decoration-hover); }

:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-sm); }

/* ── Container ─────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}
.container--narrow { max-width: var(--container-narrow); }
.container--wide   { max-width: var(--container-wide); }
.section { padding-block: var(--section-py); }

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--btn-gap);
  height: var(--btn-h);
  padding-inline: var(--btn-pad-x);
  font-family: var(--font-body);
  font-size: var(--btn-fs);
  font-weight: var(--btn-fw);
  letter-spacing: var(--btn-tracking);
  text-transform: var(--btn-transform);
  border: none; border-radius: var(--btn-radius);
  cursor: pointer; text-decoration: none;
  box-shadow: var(--btn-shadow);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.btn:hover { box-shadow: var(--btn-shadow-hover); transform: translateY(-1px); }
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-dark); color: #fff; }
.btn--accent  { background: var(--color-accent); color: #fff; }
.btn--accent:hover { background: var(--color-accent-dark); color: #fff; }
.btn--outline {
  background: transparent; color: var(--color-primary);
  border: var(--btn-bw) solid var(--color-primary);
  line-height: calc(var(--btn-h) - 2 * var(--btn-bw));
}
.btn--outline:hover { background: var(--color-primary); color: #fff; }
.btn--sm { height: var(--btn-h-sm); padding-inline: var(--btn-pad-x-sm); font-size: var(--btn-fs-sm); }
.btn--lg { height: var(--btn-h-lg); padding-inline: var(--btn-pad-x-lg); font-size: var(--btn-fs-lg); }

/* ── Cards ─────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: var(--card-border-w) solid var(--card-border-color);
  border-radius: var(--card-radius);
  padding: var(--card-pad);
  box-shadow: var(--card-shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(var(--card-hover-translate)); box-shadow: var(--card-shadow-hover); }

/* ── Fields ────────────────────────────────────────── */
.field {
  width: 100%;
  height: var(--field-h);
  padding-inline: var(--field-pad-x);
  font-size: var(--field-fs);
  background: var(--field-bg);
  border: var(--field-border);
  border-radius: var(--field-radius);
  color: var(--color-text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.field:focus { border: var(--field-border-focus); box-shadow: var(--shadow-focus); outline: none; }

/* ── Helpers ───────────────────────────────────────── */
.muted { color: var(--color-text-muted); }
.eyebrow { font-size: var(--fs-xs); letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--color-primary); }
.grid { display: grid; gap: var(--space-6); }
.badge { display: inline-block; padding: 2px 8px; border-radius: var(--field-radius); font-size: var(--fs-xs); font-weight: 700; }
.badge--sale { background: var(--color-danger); color: #fff; }
.badge--featured { background: var(--color-accent); color: #fff; }
/* ========================================================
   CATALOG COMPONENTS (Phase 2) — consumes tokens.css.
   Ported look of the Industrix shop: product cards with
   brand/SKU/spec-chips, filter sidebar, single product, tabs.
======================================================== */

/* ── Product grid ──────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-6);
}

/* ── Product card ──────────────────────────────────── */
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: var(--card-border-w) solid var(--card-border-color);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.product-card:hover { transform: translateY(var(--card-hover-translate)); box-shadow: var(--card-shadow-hover); }

.product-card__badge {
  position: absolute; top: var(--space-3); left: var(--space-3);
  z-index: var(--z-base);
  padding: 3px 10px; border-radius: var(--field-radius);
  font-size: var(--fs-xs); font-weight: 700; color: #fff;
}
.product-card__badge--sale     { background: var(--color-danger); }
.product-card__badge--featured { background: var(--color-accent); }

.product-card__media {
  display: block; aspect-ratio: 4 / 3; background: var(--color-bg);
  display: grid; place-items: center;
}
.product-card__media img { width: 100%; height: 100%; object-fit: contain; padding: var(--space-4); }
.product-card__placeholder { font-size: 48px; opacity: .35; }

.product-card__body { padding: var(--card-pad-sm); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.product-card__brand { font-size: var(--fs-xs); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.product-card__title { font-size: var(--fs-sm); line-height: var(--lh-snug); margin: 0; font-weight: 600; }
.product-card__title a { color: var(--color-text); text-decoration: none; }
.product-card__title a:hover { color: var(--color-primary); }
.product-card__sku { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--color-text-muted); }

.product-card__specs { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: auto; }
.spec-chip {
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  color: var(--color-primary);
  border: 1px solid color-mix(in srgb, var(--color-primary) 18%, transparent);
}

.product-card__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--color-border); }
.price--now { font-weight: 800; font-size: var(--fs-md); color: var(--color-text); }
.price--old { text-decoration: line-through; color: var(--color-text-muted); font-size: var(--fs-sm); margin-right: var(--space-2); }

/* ── Shop layout + filters ─────────────────────────── */
.shop-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-7); flex-wrap: wrap; }
.shop-sort .field { width: auto; min-width: 200px; }
.shop-layout { display: grid; grid-template-columns: 260px 1fr; gap: var(--space-8); align-items: start; }
@media (max-width: 900px) { .shop-layout { grid-template-columns: 1fr; } }

.shop-filters { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-5); position: sticky; top: calc(var(--header-height) + var(--space-4)); }
.filter-block { padding-block: var(--space-4); border-bottom: 1px solid var(--color-border); }
.filter-block:last-of-type { border-bottom: none; }
.filter-block h4 { font-size: var(--fs-sm); margin: 0 0 var(--space-3); }
.filter-check { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); padding: 3px 0; cursor: pointer; }
.filter-price { display: flex; gap: var(--space-2); }
.shop-filters .btn { width: 100%; margin-top: var(--space-3); }

.shop-pagination { margin-top: var(--space-8); display: flex; justify-content: center; }
.shop-pagination a, .shop-pagination span { padding: 6px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); margin: 0 2px; text-decoration: none; }

/* ── Single product ────────────────────────────────── */
.breadcrumb { font-size: var(--fs-sm); margin-bottom: var(--space-6); }
.breadcrumb a { color: var(--color-text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--color-primary); }

.product-single { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-9); }
@media (max-width: 800px) { .product-single { grid-template-columns: 1fr; } }
.product-single__media { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl); display: grid; place-items: center; padding: var(--space-8); }
.product-single__info h1 { font-size: var(--fs-2xl); margin: var(--space-2) 0; }
.product-single__price { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-4) 0; }
.product-single__price .price--now { font-size: var(--fs-2xl); color: var(--color-primary); }
.product-single__stock { font-weight: 600; font-size: var(--fs-sm); }
.product-single__stock.in { color: var(--color-success); }
.product-single__stock.out { color: var(--color-warning); }
.product-single__actions { display: flex; gap: var(--space-3); margin: var(--space-6) 0; flex-wrap: wrap; }
.product-single__datasheet { display: inline-block; font-size: var(--fs-sm); }

/* ── Tabs ──────────────────────────────────────────── */
.product-tabs { margin-top: var(--space-9); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
.product-tabs__nav { display: flex; border-bottom: 1px solid var(--color-border); }
.product-tabs__nav button { flex: 0 0 auto; padding: var(--space-4) var(--space-6); background: none; border: none; border-bottom: 3px solid transparent; font-weight: 600; font-size: var(--fs-sm); cursor: pointer; color: var(--color-text-muted); }
.product-tabs__nav button.is-active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.product-tabs__panel { display: none; padding: var(--space-6); }
.product-tabs__panel.is-active { display: block; }
.spec-group { font-size: var(--fs-sm); color: var(--color-primary); margin: var(--space-4) 0 var(--space-2); }
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td { text-align: left; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-border); font-size: var(--fs-sm); }
.spec-table th { width: 38%; color: var(--color-text-muted); font-weight: 600; }

/* ── Xania pagination (v8) ─────────────────────────── */
.xania-pagination { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: var(--space-8); flex-wrap: wrap; }
.pg-btn { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text); text-decoration: none; font-weight: 600; font-size: var(--fs-sm); }
a.pg-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pg-btn.is-active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.pg-btn.is-disabled { opacity: .4; pointer-events: none; }
.pg-dots { color: var(--color-text-muted); padding: 0 4px; }
/* safety net: if any default pagination markup slips through, cap its SVGs */
.shop-pagination svg, nav[aria-label*="agination"] svg { width: 20px !important; height: 20px !important; }

/* ── Card price & foot alignment fixes (v8) ────────── */
.product-card__price { white-space: nowrap; display: flex; align-items: baseline; gap: 6px; }
.product-card__specs { margin-top: var(--space-2); }
.product-card__foot { margin-top: auto; }
.spec-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Shop layout variants + image ratio (v10) ──────── */
.shop-layout--right { grid-template-columns: 1fr 260px; }
.shop-layout--right .shop-filters { order: 2; }
.shop-layout--hidden { grid-template-columns: 1fr; }
.product-card__media { aspect-ratio: var(--shop-img-ratio, 4 / 3); }
@media (max-width: 900px) { .shop-layout--right { grid-template-columns: 1fr; } .shop-layout--right .shop-filters { order: 0; } }

/* ── Product gallery (v23) ─────────────────────────── */
.product-gallery #pg-main { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-4); }
.product-gallery__thumbs { display: flex; gap: var(--space-2); margin-top: var(--space-3); flex-wrap: wrap; }
.pg-thumb { width: 68px; height: 68px; padding: 4px; background: var(--color-surface); border: 1.5px solid var(--color-border); border-radius: var(--radius-md); cursor: pointer; }
.pg-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pg-thumb.is-active, .pg-thumb:hover { border-color: var(--color-primary); }

/* ── Product tabs content (v36) ── */
.tab-downloads, .tab-parts { list-style: none; padding: 0; margin: 0; }
.tab-downloads li, .tab-parts li { padding: 8px 0; border-bottom: 1px solid var(--color-border); }
.tab-downloads a { text-decoration: none; font-weight: 600; }
.tab-rich p { margin: 0 0 var(--space-3); line-height: 1.7; }
.tab-rich ul { margin: 0 0 var(--space-3) 1.2em; }

/* ── Auto spare parts grid (Phase 2.5) ── */
.parts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-3); margin-top: var(--space-3); }
.parts-card { display: flex; flex-direction: column; border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; background: var(--color-surface); }
.parts-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.parts-card img { width: 100%; height: 110px; object-fit: contain; background: var(--color-bg); padding: 8px; }
.parts-card__body { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.parts-card__name { font-size: var(--fs-sm); font-weight: 600; line-height: 1.3; }
.parts-card__price { font-size: var(--fs-sm); color: var(--color-primary); font-weight: 700; }

/* ── Blog (v41) ── */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-5); }
.blog-card { display: flex; flex-direction: column; border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; text-decoration: none; color: inherit; background: var(--color-surface); transition: box-shadow .15s, transform .15s; }
.blog-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.blog-card img { width: 100%; height: 180px; object-fit: cover; }
.blog-card__body { padding: var(--space-4); display: flex; flex-direction: column; gap: 8px; }
.blog-card__date { font-size: var(--fs-xs); color: var(--color-text-muted); }
.blog-card__body h3 { margin: 0; font-size: var(--fs-lg); line-height: 1.3; }
.blog-card__more { color: var(--color-primary); font-weight: 700; font-size: var(--fs-sm); margin-top: auto; }
.blog-body { line-height: 1.8; font-size: var(--fs-md); }
.blog-body h2, .blog-body h3 { margin-top: var(--space-5); }
.blog-body p { margin: 0 0 var(--space-4); }
.blog-body img { max-width: 100%; border-radius: var(--radius-md); }



/* ── Search autocomplete (v47) ── */
.search-suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); z-index: 200; overflow: hidden; max-height: 420px; overflow-y: auto; }
.search-suggest__item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-decoration: none; color: var(--color-text); border-bottom: 1px solid var(--color-border); }
.search-suggest__item:last-child { border-bottom: 0; }
.search-suggest__item:hover { background: var(--color-bg); }
.search-suggest__item img, .search-suggest__noimg { width: 40px; height: 40px; object-fit: cover; border-radius: var(--field-radius); flex: none; background: var(--color-bg); }
.search-suggest__meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.search-suggest__name { font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-suggest__sku { font-size: var(--fs-xs); color: var(--color-text-muted); }
.search-suggest__price { font-weight: 700; color: var(--color-primary); font-size: var(--fs-sm); white-space: nowrap; }
/* ========================================================
   CHECKOUT COMPONENTS (Phase 3) — drawer, modal, cart,
   checkout, account. Consumes tokens.css.
======================================================== */

/* ── Quick-view trigger on card ────────────────────── */
.product-card { position: relative; }
.product-card__quickview {
  position: absolute; top: var(--space-3); right: var(--space-3);
  width: 34px; height: 34px; border-radius: var(--radius-full);
  border: none; background: rgba(255,255,255,.9); box-shadow: var(--shadow-sm);
  cursor: pointer; opacity: 0; transition: opacity var(--transition-fast);
  z-index: var(--z-base);
}
.product-card:hover .product-card__quickview { opacity: 1; }

/* ── Overlay (shared) ──────────────────────────────── */
.mc-overlay, .qv-overlay {
  position: fixed; inset: 0; background: rgba(10,20,40,.45);
  opacity: 0; transition: opacity var(--transition); z-index: var(--z-overlay);
}
.mc-overlay.is-open, .qv-overlay.is-open { opacity: 1; }

/* ── Mini-cart drawer ──────────────────────────────── */
.mini-cart {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 92vw);
  background: var(--color-surface); box-shadow: var(--shadow-2xl);
  display: flex; flex-direction: column; z-index: var(--z-drawer);
  transform: translateX(100%); transition: transform var(--transition);
}
.mini-cart.is-open { transform: translateX(0); }
.mini-cart__head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-5); border-bottom: 1px solid var(--color-border); }
.mini-cart__head h3 { margin: 0; }
.mc-close, .qv-close { background: none; border: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--color-text-muted); }
.mini-cart__body { flex: 1; overflow-y: auto; padding: var(--space-4) var(--space-5); }
.mini-cart__foot { padding: var(--space-5); border-top: 1px solid var(--color-border); display: grid; gap: var(--space-2); }
.mc-empty, .mc-loading { padding: var(--space-8) 0; text-align: center; }
.mc-item { display: grid; grid-template-columns: 56px 1fr auto 24px; gap: var(--space-3); align-items: center; padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
.mc-item__img { width: 56px; height: 56px; background: var(--color-bg); border-radius: var(--radius-sm); display: grid; place-items: center; overflow: hidden; }
.mc-item__img img { width: 100%; height: 100%; object-fit: contain; }
.mc-item__name { font-weight: 600; font-size: var(--fs-sm); text-decoration: none; color: var(--color-text); }
.mc-item__total { font-weight: 700; font-size: var(--fs-sm); }
.mc-item__remove { background: none; border: none; font-size: 20px; color: var(--color-text-muted); cursor: pointer; }
.mc-subtotal { display: flex; justify-content: space-between; font-size: var(--fs-md); margin-bottom: var(--space-2); }

/* ── Quick-view modal ──────────────────────────────── */
.qv-modal {
  position: fixed; top: 50%; left: 50%; width: min(820px, 94vw); max-height: 88vh; overflow: auto;
  transform: translate(-50%, -48%) scale(.97); opacity: 0;
  background: var(--color-surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-2xl);
  z-index: var(--z-modal); transition: opacity var(--transition), transform var(--transition); padding: var(--space-7);
}
.qv-modal.is-open { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.qv-close { position: absolute; top: var(--space-4); right: var(--space-4); }
.qv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-7); }
.qv-media { background: var(--color-bg); border-radius: var(--radius-lg); display: grid; place-items: center; padding: var(--space-6); }
.qv-name { margin: var(--space-2) 0; }
.qv-loading, .qv-empty { padding: var(--space-9); text-align: center; }
@media (max-width: 640px) { .qv-grid { grid-template-columns: 1fr; } }

/* ── Cart page ─────────────────────────────────────── */
.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: var(--space-8); align-items: start; }
@media (max-width: 860px) { .cart-layout { grid-template-columns: 1fr; } }
.cart-lines { display: grid; gap: var(--space-4); }
.cart-line { display: grid; grid-template-columns: 64px 1fr 90px 90px 28px; gap: var(--space-4); align-items: center; }
.cart-line__img { width: 64px; height: 64px; background: var(--color-bg); border-radius: var(--radius-sm); display: grid; place-items: center; overflow: hidden; }
.cart-line__img img { width: 100%; height: 100%; object-fit: contain; }
.cart-line__qty .field { width: 72px; }
.cart-line__total { font-weight: 700; text-align: right; }
.cart-line__remove { background: none; border: none; font-size: 20px; color: var(--color-text-muted); cursor: pointer; }
.cart-summary { position: sticky; top: calc(var(--header-height) + var(--space-4)); display: grid; gap: var(--space-3); }
.cart-summary__row { display: flex; justify-content: space-between; }

/* ── Checkout ──────────────────────────────────────── */
.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: var(--space-8); align-items: start; }
@media (max-width: 900px) { .checkout-layout { grid-template-columns: 1fr; } }
.checkout-form label { display: block; font-size: var(--fs-sm); font-weight: 600; margin-bottom: var(--space-3); }
.checkout-form .field { margin-top: var(--space-1); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.co-business { display: flex; align-items: center; gap: var(--space-2); font-weight: 400 !important; margin: var(--space-3) 0; }
.pay-methods { display: grid; gap: var(--space-2); }
.pay-method { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border: 1.5px solid var(--color-border); border-radius: var(--radius-md); cursor: pointer; font-weight: 400 !important; }
.checkout-summary { position: sticky; top: calc(var(--header-height) + var(--space-4)); }
.cs-line, .cs-row { display: flex; justify-content: space-between; padding: var(--space-2) 0; font-size: var(--fs-sm); }
.cs-total { font-size: var(--fs-md); border-top: 1px solid var(--color-border); padding-top: var(--space-3); margin-top: var(--space-2); }
.cs-note { font-size: var(--fs-xs); padding: var(--space-2) 0; }

/* ── Account ───────────────────────────────────────── */
.account-orders { width: 100%; border-collapse: collapse; margin: var(--space-4) 0; }
.account-orders th, .account-orders td { text-align: left; padding: var(--space-3); border-bottom: 1px solid var(--color-border); font-size: var(--fs-sm); }

/* ── Sticky add-to-cart (mobile) ───────────────────── */
.sticky-atc {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky);
  background: var(--color-surface); border-top: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg); transform: translateY(100%); transition: transform var(--transition);
  padding: var(--space-3) var(--space-4); padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
  display: none;
}
.sticky-atc.is-visible { transform: translateY(0); }
@media (max-width: 900px) { .sticky-atc { display: block; } }

/* ── Repair timeline ───────────────────────────────── */
.repair-timeline { list-style: none; padding: 0; margin: var(--space-4) 0 0; }
.repair-timeline li { padding: var(--space-3) 0 var(--space-3) var(--space-6); border-left: 2px solid var(--color-primary); position: relative; }
.repair-timeline li::before { content: ''; position: absolute; left: -7px; top: var(--space-4); width: 12px; height: 12px; border-radius: 50%; background: var(--color-primary); }

/* ── IPLA stats grid ───────────────────────────────── */

/* ── Sumi chat widget ──────────────────────────────── */
.sumi { position: fixed; right: var(--space-5); bottom: var(--space-5); z-index: var(--z-toast); }
.sumi__bubble { width: 56px; height: 56px; border-radius: var(--radius-full); border: none; background: var(--color-primary); color: #fff; font-size: 24px; cursor: pointer; box-shadow: var(--shadow-lg); }
.sumi__panel[hidden] { display: none !important; }
.sumi__panel { position: absolute; right: 0; bottom: 70px; width: min(360px, 90vw); height: 460px; display: flex; flex-direction: column; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-2xl); overflow: hidden; }
.sumi__head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-4); background: var(--color-primary); color: #fff; }
.sumi__head button { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }
.sumi__log { flex: 1; overflow-y: auto; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.sumi__msg { max-width: 85%; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); font-size: var(--fs-sm); }
.sumi__msg--user { align-self: flex-end; background: var(--color-primary); color: #fff; }
.sumi__msg--bot { align-self: flex-start; background: var(--color-bg); }
.sumi__form { display: flex; gap: var(--space-2); padding: var(--space-3); border-top: 1px solid var(--color-border); }

/* ── Contact page ──────────────────────────────────── */
.contact-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--space-6); margin-top: var(--space-6); align-items: start; }
@media (max-width: 760px) { .contact-layout { grid-template-columns: 1fr; } }

/* ── CMS page content ──────────────────────────────── */
.page-content { line-height: var(--lh-relaxed); }
.page-content h2 { margin-top: var(--space-7); }
.page-content h3 { margin-top: var(--space-6); }
.page-content ul, .page-content ol { padding-left: var(--space-6); margin-bottom: var(--space-4); }
.page-content img { border-radius: var(--radius-lg); margin-block: var(--space-4); }
.page-content blockquote { border-left: 3px solid var(--color-primary); margin: var(--space-4) 0; padding: var(--space-2) var(--space-4); color: var(--color-text-muted); }

/* ── Repair customer portal (v14) ──────────────────── */
.repair-status-badge { background: rgba(var(--color-primary-rgb), .1); color: var(--color-primary); border: 1px solid rgba(var(--color-primary-rgb), .3); padding: 6px 14px; border-radius: var(--field-radius); font-weight: 700; font-size: var(--fs-sm); }
.repair-steps { list-style: none; counter-reset: step; padding: 0; margin-top: var(--space-5); }
.repair-step { counter-increment: step; display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: 8px 12px; border-radius: var(--radius-md); font-size: var(--fs-sm); }
.repair-step__label::before { content: counter(step) ". "; color: var(--color-text-muted); }
.repair-step.done .repair-step__label { color: var(--color-text-muted); }
.repair-step.done .repair-step__label::after { content: " ✓"; color: var(--color-success, #16a34a); }
.repair-step.current { background: rgba(var(--color-primary-rgb), .08); border: 1px solid rgba(var(--color-primary-rgb), .35); font-weight: 700; }

/* ── Account area with sidebar (v19) ───────────────── */
.account-grid { display: grid; grid-template-columns: 230px 1fr; gap: var(--space-6); align-items: start; }
@media (max-width: 800px) { .account-grid { grid-template-columns: 1fr; } .account-nav nav { flex-direction: row !important; flex-wrap: wrap; } .account-nav form { border: 0 !important; margin: 0 !important; padding: 0 !important; width: auto !important; } }

/* ── v20 UI polish ─────────────────────────────────── */
/* Account: compact headings + stat cards */
.account-grid h1 { font-size: clamp(1.35rem, 2.4vw, 1.8rem); margin: 2px 0 4px; }
.account-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-4); margin-top: var(--space-5); }
.account-stats .stat { text-decoration: none; text-align: center; padding: var(--space-5); display: flex; flex-direction: column; gap: 4px; }
.account-stats .stat strong { font-size: var(--fs-2xl); color: var(--color-primary); }
.account-stats .stat span { color: var(--color-text-muted); font-size: var(--fs-sm); }

/* Header actions: aligned round icon targets */
.header-actions a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; font-size: 19px; text-decoration: none; color: var(--color-text); }
.header-actions a:hover { background: rgba(var(--color-primary-rgb), .08); }
.header-actions .cart-count, #wish-count { position: absolute; top: -2px; right: -4px; font-size: 11px; line-height: 1; padding: 3px 6px; }
.mobile-menu-btn { font-size: 20px; line-height: 1; padding: 8px 12px; }

/* Search magnifier */
.search-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; padding: 9px 11px; display: flex; align-items: center; color: var(--color-text-muted); border-radius: var(--radius-md); }
.search-btn:hover { color: var(--color-primary); }
/* Hero CTAs: identical boxes, perfectly aligned */
.hero .btn { display: inline-flex; align-items: center; justify-content: center; min-width: 175px; text-align: center; }

/* Wishlist */
.wish-btn { position: absolute; top: 8px; right: 8px; z-index: 2; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 50%; width: 34px; height: 34px; font-size: 17px; line-height: 1; cursor: pointer; color: var(--color-text-muted); }
.wish-btn.is-active { color: var(--color-accent); border-color: var(--color-accent); }
.product-card { position: relative; }
.wish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-4); margin-top: var(--space-5); }

/* ── Repair wizard (v24, ported from WP premium plugin) ── */
.sumi-rw-progress { height: 5px; background: var(--color-border); border-radius: 99px; margin: var(--space-4) 0; overflow: hidden; }
.sumi-rw-progress-bar { height: 100%; width: 33%; background: var(--color-primary); border-radius: 99px; transition: width .25s ease; }
.sumi-rw-steps { list-style: none; display: flex; gap: var(--space-2); padding: 0; margin: 0 0 var(--space-4); flex-wrap: wrap; }
.sumi-rw-steps li { padding: 7px 14px; border: 1px solid var(--color-border); border-radius: var(--field-radius); font-size: var(--fs-sm); color: var(--color-text-muted); background: var(--color-surface); }
.sumi-rw-steps li.is-active { border-color: var(--color-primary); color: var(--color-primary); font-weight: 700; background: rgba(var(--color-primary-rgb), .06); }
.sumi-rw-steps li.is-done { color: var(--color-success, #16a34a); }
.sumi-rw-step { display: none; }
.sumi-rw-step.is-active { display: block; }
.sumi-rw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.sumi-rw-field.is-span-2 { grid-column: span 2; }
.sumi-rw-field label { display: block; font-weight: 600; font-size: var(--fs-sm); margin-bottom: 6px; }
.sumi-rw-field.is-hidden { display: none; }
.sumi-rw-required { color: var(--color-danger, #dc2626); }
.sumi-rw-optional { color: var(--color-text-muted); font-weight: 400; font-size: var(--fs-xs); }
.sumi-rw-error { color: var(--color-danger, #dc2626); font-size: var(--fs-xs); min-height: 16px; margin-top: 3px; }
.sumi-rw-hint { color: var(--color-text-muted); font-size: var(--fs-xs); margin-top: 5px; }
.sumi-rw-checklist, .sumi-rw-radio { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.sumi-rw-checklist label, .sumi-rw-radio label, .sumi-rw-consent { font-weight: 400 !important; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.sumi-rw-actions { display: flex; justify-content: space-between; margin-top: var(--space-6); gap: var(--space-3); }
.sumi-rw-filelist ul { margin: 6px 0 0; padding-left: 1.1em; font-size: var(--fs-xs); color: var(--color-text-muted); }
.sumi-rw-hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
@media (max-width: 640px) { .sumi-rw-grid { grid-template-columns: 1fr; } .sumi-rw-field.is-span-2 { grid-column: span 1; } }

/* ── RFQ basket (v25, ported from WP plugin) ───────── */
.sumi-rfq-topbar { display: flex; gap: var(--space-2); margin-bottom: var(--space-3); }
.sumi-rfq-tablewrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.sumi-rfq-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 760px; }
.sumi-rfq-table th { text-align: left; padding: 9px 10px; background: var(--color-bg); border-bottom: 1px solid var(--color-border); white-space: nowrap; }
.sumi-rfq-table td { padding: 6px 8px; border-bottom: 1px solid var(--color-border); vertical-align: top; }
.sumi-rfq-table .field { min-width: 90px; }
.rq-remove { background: none; border: 0; color: var(--color-danger, #dc2626); font-size: 20px; cursor: pointer; padding: 6px 8px; line-height: 1; }
.sumi-rfq-import { margin-top: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); }
.sumi-rfq-import summary { cursor: pointer; font-weight: 700; font-size: var(--fs-sm); }
.sumi-rfq-importgrid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); margin-top: var(--space-4); }
.sumi-rfq-dropzone { border: 2px dashed var(--color-border); border-radius: var(--radius-md); padding: var(--space-5); text-align: center; margin-top: var(--space-4); }
.sumi-rfq-dropzone.is-drag { border-color: var(--color-primary); background: rgba(var(--color-primary-rgb), .04); }
.sumi-rfq-droptitle { font-weight: 700; }
.sumi-rfq-or { text-align: center; margin: var(--space-3) 0; color: var(--color-text-muted); font-size: var(--fs-xs); }
.sumi-rfq-linkrow { display: flex; gap: var(--space-2); }
.sumi-rfq-linkrow .field { flex: 1; }
.sumi-rfq-templates { display: flex; gap: var(--space-2); align-items: center; margin-top: var(--space-4); flex-wrap: wrap; }
.sumi-rfq-preview { margin-top: var(--space-4); border: 1px solid rgba(var(--color-primary-rgb), .4); border-radius: var(--radius-md); padding: var(--space-4); background: rgba(var(--color-primary-rgb), .03); }
.sumi-rfq-previewhead { display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
@media (max-width: 700px) { .sumi-rfq-importgrid { grid-template-columns: 1fr; } }

/* ── Cookie consent (v38, GDPR/ePrivacy) ── */
.cookie-banner[hidden], .cookie-prefs[hidden] { display: none !important; }
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100000; background: var(--color-surface); border-top: 1px solid var(--color-border); box-shadow: 0 -4px 24px rgba(0,0,0,.12); padding: var(--space-4) var(--space-5); display: flex; gap: var(--space-4); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cookie-banner__text { font-size: var(--fs-sm); max-width: 60ch; }
.cookie-banner__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.cookie-prefs { position: fixed; inset: 0; z-index: 100001; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: var(--space-4); }
.cookie-prefs__panel { background: var(--color-surface); border-radius: var(--radius-lg); padding: var(--space-6); max-width: 480px; width: 100%; }
.cookie-prefs__row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; font-size: var(--fs-sm); border-bottom: 1px solid var(--color-border); }
.cookie-prefs__actions { display: flex; gap: var(--space-2); justify-content: flex-end; margin-top: var(--space-4); }
@media (max-width: 640px) { .cookie-banner { flex-direction: column; align-items: stretch; } .cookie-banner__actions { justify-content: stretch; } .cookie-banner__actions .btn { flex: 1; } }

/* ── Footer legal bar (v40) ── */
.footer-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; padding-bottom: var(--space-4); font-size: var(--fs-xs); }
.footer-legal a { color: #cbd5e1; text-decoration: none; }
.footer-legal a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-2); font-size: var(--fs-xs); border-top: 1px solid rgba(255,255,255,.08); padding-top: var(--space-3); }
.footer-social a { color: #cbd5e1; margin-left: 14px; text-decoration: none; }
.footer-social a:hover { color: #fff; }
@media (max-width: 640px) { .footer-bottom { justify-content: center; text-align: center; } .footer-social a { margin: 0 8px; } }
/* ========================================================
   RESPONSIVE LAYER (imported last so it wins).
   Breakpoints (Bootstrap-like):
     xs  <576   sm ≥576   md ≥768   lg ≥992   xl ≥1200   xxl ≥1400
   Goal: clean reflow on every screen, never cramped cards,
   no horizontal scroll.
======================================================== */

/* ── Global overflow safety ────────────────────────── */
html, body { overflow-x: hidden; }
img, svg, video, canvas, table { max-width: 100%; }
/* Let grid/flex children shrink instead of forcing overflow. */
.product-grid > *, .grid > *, .hero-grid > *, .footer-grid > *,
.shop-layout > *, .checkout-layout > *, .cart-layout > *,
.product-single > *, .header-bar > * { min-width: 0; }

/* ── Header bar ─────────────────────────────────────── */
.header-bar {
  display: flex; align-items: center; gap: var(--space-6);
  height: var(--header-height);
}
.header-search { flex: 1; max-width: 560px; }

@media (max-width: 1024px) {
  .header-bar {
    flex-wrap: wrap; height: auto;
    padding-block: var(--space-3); gap: var(--space-3);
  }
  .header-search { order: 3; flex: 1 1 100%; max-width: none; }
  .header-actions { margin-left: auto; }
}

/* ── Hero ──────────────────────────────────────────── */
.hero-grid {
  display: grid; grid-template-columns: 1.3fr 1fr;
  gap: var(--space-9); align-items: center;
}
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--space-7); }
}

/* ── Footer ────────────────────────────────────────── */
.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.4fr; gap: var(--space-8);
}
@media (max-width: 992px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-6); } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* ── Product grid — explicit columns, never cramped ──
   1 col on tiny phones, scaling up to 5 on wide desktops.
   Overrides the auto-fill default in catalog.css.            */
.product-grid { grid-template-columns: 1fr; }
@media (min-width: 420px)  { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px)  { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(var(--shop-cols, 4), 1fr); } }
@media (min-width: 1440px) { .product-grid { grid-template-columns: repeat(var(--shop-cols, 4), 1fr); } }

/* Category tiles: comfortable minimum so they never squeeze. */
@media (max-width: 480px) {
  .grid[style*="minmax(200px"] { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ── Cart line reflow on phones ────────────────────── */
@media (max-width: 560px) {
  .cart-line {
    position: relative;
    grid-template-columns: 56px 1fr;
    row-gap: var(--space-2);
  }
  .cart-line__qty, .cart-line__total { grid-column: 2; justify-self: start; }
  .cart-line__total { text-align: left; }
  .cart-line__remove { position: absolute; top: var(--space-3); right: var(--space-3); }
}

/* ── Tables: scroll instead of squeeze on small ─────── */
@media (max-width: 560px) {
  .account-orders { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ── Quick-view + mega panel safety on narrow ──────── */
@media (max-width: 700px) {
  .qv-modal { padding: var(--space-5); }
  .mega-panel { min-width: min(92vw, 640px) !important; }
}

/* ── Section rhythm tightening on phones ───────────── */
@media (max-width: 560px) {
  :root { --section-py: clamp(2rem, 8vw, 3rem); }
  .card { padding: var(--card-pad-sm); }
}

/* ── Sumi widget: keep clear of thumb zone on phones ── */
@media (max-width: 480px) {
  .sumi { right: var(--space-3); bottom: var(--space-3); }
  .sumi__panel { width: calc(100vw - 2 * var(--space-3)); }
}

/* ── Forms: single column on phones ────────────────── */
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ── Touch targets ─────────────────────────────────── */
@media (hover: none) {
  .product-card__quickview { opacity: 1; } /* no hover on touch → always visible */
}

/* ── Mobile primary nav (v19): hamburger reveals vertical menu ── */
@media (max-width: 900px) {
  /* Inchis: linkurile ascunse (inline display:flex de pe container cere !important) */
  .primary-nav .container { display: none !important; }

  /* Deschis: DRAWER FULL-SCREEN peste hero — pattern standard pt landing-uri colorate */
  .primary-nav.is-open {
    position: fixed; inset: 0; z-index: 99999;
    background: linear-gradient(165deg, var(--color-primary), color-mix(in srgb, var(--color-primary) 62%, #000));
    border-top: 0 !important; overflow-y: auto;
    animation: navFade .18s ease-out;
  }
  @keyframes navFade { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
  .primary-nav.is-open .container {
    display: flex !important; flex-direction: column !important; align-items: stretch !important;
    height: auto !important; gap: 0 !important; padding: 10px 26px 32px !important;
  }
  .primary-nav.is-open .container a {
    color: #fff !important; font-size: 1.35rem !important; font-weight: 600 !important;
    padding: 17px 4px; border-bottom: 1px solid rgba(255,255,255,.16);
    text-decoration: none;
  }
  .primary-nav.is-open .container a:last-child { border-bottom: 0; }
  .primary-nav.is-open .mobile-nav-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 22px 8px 26px; color: #fff;
  }
  .mobile-nav-close {
    background: rgba(255,255,255,.12); border: 1.5px solid rgba(255,255,255,.5); color: #fff;
    width: 44px; height: 44px; border-radius: 50%; font-size: 19px; line-height: 1; cursor: pointer;
  }

  /* Header: logo centrat static; actiunile pe rand propriu, egal distribuite pe latime */
  .mega-menu { display: none; }
  .header-bar > a:first-child { margin-inline: auto; }
  .header-bar > a:first-child img { height: 38px !important; }
  .header-actions {
    order: 4; width: 100%; margin-left: 0 !important;
    justify-content: space-evenly; gap: 0 !important; padding: 6px 0 2px;
  }
  .header-actions a { width: 44px; height: 44px; font-size: 22px; }
  .mobile-menu-btn { font-size: 24px; padding: 8px 16px; }
}

/* Antetul drawer-ului nu exista pe desktop */
.mobile-nav-head { display: none; }

/* ── Mobile typography (v21): lizibil, nu minuscul ── */
@media (max-width: 640px) {
  body { font-size: 16.5px; line-height: 1.6; }
  .hero h1 { font-size: clamp(1.7rem, 7.5vw, 2.3rem); line-height: 1.2; }
  .hero p { font-size: 1.02rem; }
  .hero .btn { width: 100%; }
  .eyebrow { font-size: .8rem; }
  .muted { font-size: .95em; }
}
@media (min-width: 901px) { .mobile-menu-btn { display: none; } }

/* ── Categories inside the mobile drawer (v29) ─────── */
.mobile-cats { display: none; }
@media (max-width: 900px) {
  .primary-nav.is-open .mobile-cats { display: block; padding: 6px 26px 30px; }
  .primary-nav.is-open .mobile-cats__label {
    color: rgba(255,255,255,.65); font-size: .78rem; letter-spacing: .08em;
    text-transform: uppercase; font-weight: 700; margin: 14px 0 4px; padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,.22);
  }
  .primary-nav.is-open .mobile-cats a {
    display: block; color: #fff; font-size: 1.08rem; font-weight: 500;
    padding: 11px 4px; border-bottom: 1px solid rgba(255,255,255,.12); text-decoration: none;
  }
  .primary-nav.is-open .mobile-cats a:last-child { border-bottom: 0; }
}
/* ── Sumi chatbot (white-label glassmorphism, v45.2 — rich UI) ── */
#sumi-chatbot {
  --sumi-primary: var(--color-primary, #0A5C9E);
  --sumi-primary-light: var(--color-primary-light, #1A7CC4);
  --sumi-primary-dark: var(--color-primary-dark, #063E6E);
  --sumi-accent:  var(--color-accent, #FF6B00);
  --sumi-accent-dark: var(--color-accent-dark, #CC5500);
  --sumi-surface: var(--color-surface, #fff);
  --sumi-border:  var(--color-border, #dde3ea);
  --sumi-text:    var(--color-text, #1a2332);
  --sumi-muted:   var(--color-text-muted, #6b7a8d);
  --sumi-radius:  var(--radius-lg, 16px);
  --sumi-gradient: linear-gradient(135deg, var(--sumi-primary), var(--sumi-primary-light) 45%, var(--sumi-accent));
  --sumi-glass-bg: color-mix(in srgb, var(--sumi-surface) 82%, transparent);
  --sumi-shadow: 0 24px 64px rgba(10,92,158,.20), 0 8px 24px rgba(10,92,158,.12);
  position: fixed; z-index: 99999; font-family: var(--font-body, system-ui, sans-serif);
}
.sumi-pos-bottom-right { bottom: 24px; right: 24px; }
.sumi-pos-bottom-left  { bottom: 24px; left: 24px; }
.sumi-hidden { display: none !important; }

.sumi-fab {
  width: 62px; height: 62px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--sumi-gradient); box-shadow: var(--sumi-shadow);
  display: flex; align-items: center; justify-content: center; position: relative;
  transition: transform .2s;
}
.sumi-fab:hover { transform: scale(1.06); }
.sumi-fab .sumi-avatar-svg { width: 38px; height: 38px; }
.sumi-fab.sumi-minimized { display: none; }
.sumi-unread { position: absolute; top: -2px; right: -2px; background: var(--sumi-accent); color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

.sumi-window {
  width: 384px; max-width: calc(100vw - 32px); height: 580px; max-height: calc(100vh - 48px);
  background: var(--sumi-glass-bg); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--color-border); border-radius: var(--sumi-radius); box-shadow: var(--sumi-shadow);
  display: flex; flex-direction: column; overflow: hidden; animation: sumi-in .25s cubic-bezier(.4,0,.2,1);
}
@keyframes sumi-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

/* Header with robot logo */
.sumi-header { background: var(--sumi-gradient); color: #fff; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.sumi-header-avatar { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; flex: none; }
.sumi-header-avatar .sumi-avatar-svg { width: 30px; height: 30px; }
.sumi-header-brand { display: flex; flex-direction: column; flex: 1; }
.sumi-header-title { font-weight: 800; font-size: 15px; }
.sumi-status-text { font-size: 12px; opacity: .92; }
.sumi-status-text::before { content: '●'; color: #5efc82; margin-right: 5px; font-size: 9px; vertical-align: middle; }
.sumi-header-actions { display: flex; gap: 4px; }
.sumi-icon-btn { background: rgba(255,255,255,.18); border: none; color: #fff; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 15px; line-height: 1; }
.sumi-icon-btn:hover { background: rgba(255,255,255,.3); }

/* Messages with avatar + content + time */
.sumi-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.sumi-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 92%; }
.sumi-msg-bot { align-self: flex-start; }
.sumi-msg-user { align-self: flex-end; flex-direction: row-reverse; }
.sumi-msg-avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.sumi-msg-bot .sumi-msg-avatar { background: color-mix(in srgb, var(--sumi-primary) 12%, transparent); }
.sumi-msg-content { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sumi-msg-user .sumi-msg-content { align-items: flex-end; }
.sumi-msg-bubble { padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5; word-wrap: break-word; overflow-wrap: anywhere; }
.sumi-msg-bot .sumi-msg-bubble { background: var(--sumi-surface); border: 1px solid var(--color-border); color: var(--sumi-text); border-bottom-left-radius: 4px; }
.sumi-msg-user .sumi-msg-bubble { background: var(--sumi-gradient); color: #fff; border-bottom-right-radius: 4px; }
.sumi-msg-bubble a { color: var(--sumi-primary); font-weight: 600; }
.sumi-msg-user .sumi-msg-bubble a { color: #fff; text-decoration: underline; }
.sumi-msg-time { font-size: 10.5px; color: var(--sumi-muted); padding: 0 4px; }
.sumi-cursor { color: var(--sumi-primary); font-weight: 700; }
.sumi-cursor-blink { animation: sumi-blink 1s steps(2) infinite; }
@keyframes sumi-blink { 50% { opacity: 0; } }

.sumi-contact-bar { display: flex; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--color-border); flex-wrap: wrap; background: color-mix(in srgb, var(--sumi-primary) 5%, transparent); }
.sumi-contact-btn { font-size: 13px; padding: 6px 12px; border-radius: var(--field-radius, 8px); background: var(--sumi-surface); border: 1px solid var(--color-border); color: var(--sumi-text); text-decoration: none; font-weight: 600; }
.sumi-contact-btn:hover { border-color: var(--sumi-primary); color: var(--sumi-primary); }

.sumi-quick { display: flex; gap: 6px; padding: 8px 16px 0; flex-wrap: wrap; }
.sumi-quick-btn { font-size: 12.5px; padding: 6px 11px; border-radius: var(--field-radius, 8px); background: var(--sumi-surface); border: 1px solid var(--color-border); color: var(--sumi-text); cursor: pointer; }
.sumi-quick-btn:hover { border-color: var(--sumi-primary); color: var(--sumi-primary); }

.sumi-input-row { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--color-border); align-items: flex-end; }
.sumi-input { flex: 1; resize: none; border: 1px solid var(--color-border); border-radius: var(--field-radius, 8px); padding: 9px 12px; font-size: 14px; font-family: inherit; background: var(--sumi-surface); color: var(--sumi-text); max-height: 120px; }
.sumi-input:focus { outline: none; border-color: var(--sumi-primary); }
.sumi-send { width: 40px; height: 40px; flex: none; border: none; border-radius: 50%; background: var(--sumi-gradient); color: #fff; cursor: pointer; font-size: 15px; }
.sumi-send:hover { transform: scale(1.05); }

@media (max-width: 480px) { .sumi-window { width: calc(100vw - 24px); height: calc(100vh - 96px); } }

/* Typing indicator (animated dots) */
.sumi-typing { display: inline-flex; gap: 4px; align-items: center; padding: 2px 0; }
.sumi-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--sumi-muted); animation: sumi-bounce 1.2s infinite ease-in-out; }
.sumi-typing span:nth-child(2) { animation-delay: .18s; }
.sumi-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes sumi-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
.sumi-send:disabled { opacity: .5; cursor: not-allowed; transform: none; }
