/* ===========================================================================
   Be Safe Safety — Design tokens
   ---------------------------------------------------------------------------
   Source of truth: C:/xampp/htdocs/figma-builds/be-safe-safety/styles.css
   (pixel-perfect Figma build). Token NAMES are kept identical to that build so
   element CSS can be ported with minimal friction — only root class names get
   the .bss-* prefix on the way into Breakdance, not the custom properties.

   Reusable component classes (.bss-btn and variants, etc.) get added BELOW the
   :root block as elements are ported — never duplicated per element.
   =========================================================================== */

/* ---------------------------------------------------------------------------
   Inter — self-hosted variable font (weights 100–900). Self-hosting removes the
   Google Fonts round-trip that made the type flash a system fallback (FOUT).
--------------------------------------------------------------------------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* --- Neutrals --- */
  --neutral-0: #FFFFFF;
  --neutral-100: #F5F5F7;
  --neutral-200: #E5E5EA;
  --neutral-300: #A1A1AA;
  --neutral-400: #71717A;
  --neutral-500: #3F3F46;
  --neutral-700: #1C1C1F;
  --neutral-900: #0B0B0C;

  /* --- Accents --- */
  --blue-500: #4F7BFF;
  --red-500: #EF4444;
  --red-600: #DC2626;
  --green-500: #22C55E;
  --yellow-600: #CA8A04;

  /* --- Semantic --- */
  --bg: var(--neutral-100);
  --bg-card: var(--neutral-0);
  --text: var(--neutral-900);
  --text-muted: var(--neutral-400);
  --border: var(--neutral-200);

  /* --- Typography --- */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* --- Layout --- */
  --container-max: 88rem;
  --content-max: 73.125rem;
  --gutter: 1rem;
  --header-gap: 3rem;             /* uniform header -> breadcrumb gap, all page types */
  --radius: 0.5rem;
  --radius-pill: 100px;
  --nav-h: 4.6875rem;             /* 75px — header height, all breakpoints (figma: ~1.06rem padding around the 2.5rem content row) */

  /* --- Motion --- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 150ms;
  --t-base: 250ms;
  --t-slow: 400ms;
}

/* On mobile the header sits much closer to the breadcrumb — figma shows a 1rem
   gap (vs 3rem on desktop). Overriding the token cascades to every page that
   uses var(--header-gap) for the header -> breadcrumb / content spacing. */
@media (max-width: 768px) {
  :root { --header-gap: 1rem; }
}

/* ===========================================================================
   Base typography — apply the Inter type system site-wide. Breakdance /
   WooCommerce don't set a project font on <body>, so without this ONLY the
   elements that hardcode a font-family render in Inter; everything else falls
   back to the system font (the reported "font problem"). `html body.breakdance`
   (0,1,2) out-specifies any plain `body.breakdance` builder rule; form controls
   are set explicitly because they don't inherit font-family.
   =========================================================================== */
html body.breakdance,
html body.breakdance input,
html body.breakdance select,
html body.breakdance textarea,
html body.breakdance button { font-family: var(--font); }

/* Headings must set font-family EXPLICITLY: Breakdance core sets it directly on
   `.breakdance h1|h2|…` (a direct property on the element), which beats the
   inherited Inter from <body> regardless of specificity. Without this the H1s
   render in BD's fallback font (the reported "h1 font is different" site-wide).
   `html body.breakdance hN` (0,1,3) also out-specifies BD core's `.breakdance hN`. */
html body.breakdance h1,
html body.breakdance h2,
html body.breakdance h3,
html body.breakdance h4,
html body.breakdance h5,
html body.breakdance h6 { font-family: var(--font); }

/* ===========================================================================
   Reset — neutralizes browser / theme / WooCommerce defaults that leak into
   Breakdance-rendered pages (links arriving blue + underlined, incl. on hover).
   Mirrors the Figma build's `a { color: inherit; text-decoration: none }`.
   Component hover rules (.bss-footer__list a:hover, etc.) carry an extra class
   so they out-specify this blanket reset.
   =========================================================================== */
body.breakdance a,
body.breakdance a:hover,
body.breakdance a:focus,
body.breakdance a:visited,
body.breakdance a:active { color: inherit; text-decoration: none; }

/* ===========================================================================
   Component library — added as elements are ported.
   (.bss-btn + variants, etc.)
   =========================================================================== */

/* --- Layout primitive: page gutter container (figma .container) --- */
.bss-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ---------------------------------------------------------------------------
   Buttons (figma .btn). Variant colour rules carry `body.breakdance .bss-btn`
   (0,3,x) so they out-specify Breakdance core's `body.breakdance a` (0,1,2)
   for both <a> and <button> tags — no !important.
--------------------------------------------------------------------------- */
.bss-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 1rem;
  /* Vertical centring: `text-box` was tried but it does NOT apply to flex
     containers (only block containers / inline boxes) — it was a no-op. With
     `line-height: 1` + `align-items: center` Inter's visible glyph band sits a
     hair below the line-box centre, so the label reads slightly low. Fix:
     bottom padding 2px larger than top, nudging the label up to true optical
     centre. Total block padding stays 24px, so the button height is unchanged. */
  padding: 0.6875rem 1.25rem 0.8125rem;
  border-radius: var(--radius-pill);
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  text-decoration: none;
  transition: background-color var(--t-base) var(--ease),
              color var(--t-base) var(--ease),
              border-color var(--t-base) var(--ease),
              transform var(--t-fast) var(--ease);
}
.bss-btn:active { transform: scale(0.97); }
.bss-btn--block { width: 100%; }

/* Unprefixed base — applies on non-Breakdance pages (WC My Account, Cart,
   Checkout templates) where `body.breakdance` is absent. Kept at (0,2,0)
   so the prefixed (0,3,1) rules below still win on every BD-rendered page. */
.bss-btn.bss-btn--dark { background: var(--neutral-900); color: var(--neutral-0); }
.bss-btn.bss-btn--dark:hover { background: var(--neutral-700); }
.bss-btn.bss-btn--white { background: var(--neutral-0); color: var(--neutral-700); }
.bss-btn.bss-btn--white:hover { background: var(--neutral-100); }
.bss-btn.bss-btn--outline {
  background: var(--neutral-0);
  color: var(--neutral-700);
  border: 1px solid var(--border);
}
.bss-btn.bss-btn--outline:hover { background: var(--neutral-100); border-color: var(--neutral-300); }

body.breakdance .bss-btn.bss-btn--dark { background: var(--neutral-900); color: var(--neutral-0); }
body.breakdance .bss-btn.bss-btn--dark:hover { background: var(--neutral-700); }
body.breakdance .bss-btn.bss-btn--white { background: var(--neutral-0); color: var(--neutral-700); }
body.breakdance .bss-btn.bss-btn--white:hover { background: var(--neutral-100); }
body.breakdance .bss-btn.bss-btn--outline {
  background: var(--neutral-0);
  color: var(--neutral-700);
  border: 1px solid var(--border);
}
body.breakdance .bss-btn.bss-btn--outline:hover { background: var(--neutral-100); border-color: var(--neutral-300); }

/* ---------- Add-to-cart loading state ----------
   bss-interactions.js adds `.is-loading` to the clicked add-to-cart button
   while the wc-ajax request is in flight, so the user gets instant feedback
   instead of a button that looks inert. The label is hidden and a spinner
   takes its place. `body.breakdance` keeps the colour override level with the
   `.bss-btn--dark` rule above and, ordered after it, wins. */
body.breakdance .bss-btn.is-loading,
[data-bss-add-to-cart].is-loading,
.single_add_to_cart_button.is-loading,
.add_to_cart_button.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}
body.breakdance .bss-btn.is-loading > *,
[data-bss-add-to-cart].is-loading > * {
  visibility: hidden;
}
.bss-btn.is-loading::after,
[data-bss-add-to-cart].is-loading::after,
.single_add_to_cart_button.is-loading::after,
.add_to_cart_button.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: var(--neutral-0);
  border-radius: 50%;
  animation: bss-spin 0.6s linear infinite;
}
@keyframes bss-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .bss-btn.is-loading::after,
  [data-bss-add-to-cart].is-loading::after,
  .single_add_to_cart_button.is-loading::after,
  .add_to_cart_button.is-loading::after { animation-duration: 1.6s; }
}

/* ---------------------------------------------------------------------------
   Quote banner (figma "Need bulk pricing?" card) — ONE shared component used
   by the PDP "Related products" grid and the cart "You may also like" grid.
   Blue gradient card; fills its grid cell (the grids are align-items:stretch).
--------------------------------------------------------------------------- */
.bss-quote-banner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--blue-500);
  background: linear-gradient(135deg, #3B5FCC 0%, #1F3A8A 100%);
  border-radius: 0.5rem;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  color: var(--neutral-0);
  min-height: 17.625rem;
  text-decoration: none;
}
/* Decorative ring marks — figma logo-circle-*.png quarters at 0.35 opacity. */
.bss-quote-banner__rings {
  position: absolute;
  top: -3rem;
  right: 1.5rem;
  width: 28rem;
  height: 28rem;
  pointer-events: none;
  opacity: 0.35;
}
body.breakdance .bss-quote-banner__rings img {
  position: absolute;
  width: 15rem;
  height: 7.5rem;
}
.bss-quote-banner__rings img:nth-child(1) { top: 0;   left: 0; }
.bss-quote-banner__rings img:nth-child(2) { top: 0;   left: 30%; }
.bss-quote-banner__rings img:nth-child(3) { top: 30%; left: 0; }
.bss-quote-banner__rings img:nth-child(4) { top: 30%; left: 30%; }
body.breakdance .bss-quote-banner__title {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--neutral-0);
  margin: 0;
  position: relative;
  z-index: 1;
}
.bss-quote-banner .bss-btn {
  align-self: flex-start;
  position: relative;
  z-index: 1;
}
@media (max-width: 640px) {
  .bss-quote-banner { min-height: 0; aspect-ratio: 179 / 141; }
}

/* ---------------------------------------------------------------------------
   Icon buttons (figma .iconbtn / .iconbtn--ghost) — header actions + the
   prev/next arrows in section headers.
--------------------------------------------------------------------------- */
.bss-iconbtn {
  height: 2.5rem;
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  color: var(--neutral-700);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}
.bss-iconbtn:hover { background: var(--neutral-100); }
.bss-iconbtn:active { transform: scale(0.94); }

.bss-iconbtn--ghost {
  border: 1px solid var(--border);
  background: var(--neutral-0);
  border-radius: var(--radius-pill);
  padding: 0.5rem 1rem;
  width: auto;
  transition: border-color var(--t-fast) var(--ease),
              background-color var(--t-fast) var(--ease);
}
.bss-iconbtn--ghost:hover { border-color: var(--neutral-300); background: var(--neutral-100); }
.bss-iconbtn--ghost:disabled,
.bss-iconbtn--ghost[aria-disabled="true"] {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.bss-iconbtn__arrow { width: 1.5rem; height: 1.5rem; display: block; color: var(--neutral-900); }
.bss-iconbtn__arrow svg { width: 100%; height: 100%; display: block; }
.bss-iconbtn--prev .bss-iconbtn__arrow { transform: rotate(180deg); }

/* Section header (figma .section__head / .section__nav) */
.bss-section-head {
  display: flex;
  align-items: center;
  gap: 2rem;
  justify-content: space-between;
  width: 100%;
}
body.breakdance h2.bss-section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--neutral-900);
  line-height: normal;
  flex: 1 0 0;
  margin: 0;
}
.bss-section-nav { display: flex; gap: 0.5rem; }
.bss-section-nav--mobile-only { display: none; }

/* ---------------------------------------------------------------------------
   Badge (figma .badge)
--------------------------------------------------------------------------- */
.bss-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 600;
  line-height: normal;
  white-space: nowrap;
}
.bss-badge--green { background: var(--green-500); color: var(--neutral-900); }

/* ---------------------------------------------------------------------------
   Card library (figma .card + variants) — shared by NewArrivals, Highlights,
   HeavyDuty. Image height rules carry `body.breakdance` so they beat BD core's
   `.breakdance img { height:auto }`.
--------------------------------------------------------------------------- */
.bss-card {
  position: relative;
  /* Neutral placeholder shown while the card image loads. (Was a debug red,
     which bled a hairline at the rounded corners under overflow:hidden.) */
  background: var(--neutral-100);
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
}

/* Full-image category card */
.bss-card--full { height: 25rem; transition: box-shadow var(--t-base) var(--ease); }
.bss-card--full:hover { box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.35); }
body.breakdance .bss-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  transition: transform 600ms var(--ease);
}
.bss-card--full:hover .bss-card__img { transform: scale(1.06); }
.bss-card__pill {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  /* Cap to the card's inner width so long labels (e.g. Dutch
     "Gereedschapsriemen & holsters") wrap onto multiple lines instead of
     overflowing — client explicitly accepted a taller pill on long words. */
  max-width: calc(100% - 2rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  background: var(--neutral-0);
  color: var(--neutral-700);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
  border-radius: var(--radius-pill);
  white-space: normal;
  text-align: center;
  transition: background-color var(--t-base) var(--ease), color var(--t-base) var(--ease);
}
.bss-card--full:hover .bss-card__pill { background: var(--neutral-900); color: var(--neutral-0); }

/* Product card */
.bss-card--product {
  background: var(--neutral-0);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}
.bss-card--product:hover { box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.12); }
.bss-card__thumb {
  width: 100%;
  height: 10.9375rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.breakdance .bss-card__thumb img {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  object-fit: contain;
  transition: transform 500ms var(--ease);
}
.bss-card--product:hover .bss-card__thumb img { transform: scale(1.06); }
.bss-card__body { display: flex; flex-direction: column; gap: 0.25rem; width: 100%; }
.bss-card__name { font-size: 0.875rem; font-weight: 600; color: var(--neutral-900); line-height: normal; margin: 0; }
.bss-card__brand { font-size: 0.875rem; font-weight: 500; color: var(--neutral-400); line-height: normal; margin: 0; }
.bss-card__price {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: normal;
  margin: 0;
}
.bss-price__old { color: var(--red-600); text-decoration: line-through; }
.bss-price__new { color: var(--neutral-400); }

/* Heavy-duty card */
.bss-card--media {
  background: var(--neutral-0);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  width: 17.53125rem;
  height: 25rem;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  scroll-snap-align: start;
  display: block;
  transition: border-color var(--t-base) var(--ease),
              transform var(--t-base) var(--ease),
              box-shadow var(--t-base) var(--ease);
}
.bss-card--media:hover {
  border-color: var(--neutral-300);
  box-shadow: 0 0.625rem 1.5rem -0.625rem rgba(0, 0, 0, 0.12);
}
.bss-card--media--wide { width: 36.0625rem; }
body.breakdance .bss-card__bigmedia {
  width: 16rem;
  height: 16rem;
  object-fit: contain;
  position: absolute;
  left: 50%;
  top: calc(50% - 1.875rem);
  transform: translate(-50%, -50%);
  transition: transform 500ms var(--ease);
}
.bss-card--media:hover .bss-card__bigmedia { transform: translate(-50%, -50%) scale(1.05); }
body.breakdance .bss-card--media--wide .bss-card__bigmedia { width: 17.375rem; height: 17.375rem; }
.bss-card__btn {
  position: absolute;
  left: 0.9375rem;
  bottom: 0.9375rem;
  /* Cap to the card's inner width (card padding = 0.9375rem each side) so
     long product names wrap inside the pill instead of overflowing onto
     the right gap between cards. */
  max-width: calc(100% - 1.875rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  background: var(--neutral-900);
  color: var(--neutral-0);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  white-space: normal;
  text-align: center;
  line-height: 1.3;
  transition: background-color var(--t-base) var(--ease);
}
.bss-card--media:hover .bss-card__btn { background: var(--neutral-700); }

@media (max-width: 768px) {
  .bss-section-nav--mobile-only { display: flex; }
  .bss-section-head { gap: 1rem; }
}
