/* ==================================================================
   components.css — Header, footer, mega menu, USP banner, buttons
   All scoped to .v2-* class names. Coexists with legacy CSS.
   ================================================================== */

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--ease-default), color var(--ease-default), border-color var(--ease-default);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-md { padding: 10px 18px; font-size: 14px; }
.btn-lg { padding: 14px 24px; font-size: 16px; }

.btn-primary { background: var(--c-brand); color: #fff; }
.btn-primary:hover { background: var(--c-brand-hover); color: #fff; text-decoration: none; }

.btn-secondary { background: var(--c-white); color: var(--c-text); border: 1px solid var(--c-border); }
.btn-secondary:hover { background: var(--c-bg-soft); border-color: var(--c-text-muted); text-decoration: none; }

.btn-ghost { background: transparent; color: var(--c-text-muted); }
.btn-ghost:hover { color: var(--c-text); text-decoration: none; }

/* ── Header ──────────────────────────────────────────────── */
.v2-header {
  background: var(--c-white);
  /* Stays pinned at top while the page scrolls — search/cart/account always reachable */
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  /* Subtle shadow appears once we collapse, mimicking elevation on lift */
  box-shadow: 0 0 0 transparent;
  transition: box-shadow 0.2s ease;
}
.v2-header-scrolled {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Thin top utility bar */
.v2-header-utility {
  background: var(--c-bg-soft);
  border-bottom: 1px solid var(--c-border-light);
  font-size: 12px;
  color: var(--c-text-muted);
  padding: 5px 0;
  /* Collapsible — animates closed when scrolled. overflow stays visible by default
     so the language-switcher dropdown can escape downward. */
  max-height: 60px;
  transition: max-height 0.22s ease, padding 0.22s ease, opacity 0.18s ease;
}
.v2-header-scrolled .v2-header-utility {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  border-bottom-color: transparent;
  /* Only clip when collapsed */
  overflow: hidden;
  pointer-events: none;
}
.v2-header-utility-inner {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
}
.v2-header-utility a {
  color: var(--c-text-muted);
  text-decoration: none;
  font-weight: 500;
}
.v2-header-utility a:hover { color: var(--c-text); text-decoration: none; }
.v2-header-utility-sep {
  width: 1px;
  height: 11px;
  background: var(--c-border);
}

/* Main header row: logo | search | account + cart */
.v2-header-main {
  padding: 14px 0;
  border-bottom: 1px solid var(--c-border-light);
}
.v2-header-main-inner {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 32px;
  align-items: center;
}

.v2-header-logo {
  display: flex;
  align-items: center;
}
.v2-header-logo img {
  height: 44px;
  width: auto;
  display: block;
}

/* Search bar — fills the center column */
.v2-header-search {
  width: 100%;
}
/* Override the legacy absolute positioning from SearchBar's inline styles */
.v2-header-search .modern-search {
  position: relative !important;
  transform: none !important;
  width: 100% !important;
  top: auto !important;
  left: auto !important;
}
/* Keep the suggestions dropdown anchored to the search input, not flying off */
.v2-header-search .modern-search-suggestions {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  right: 0 !important;
  width: auto !important;
  z-index: 10000;
}

/* Right section: icon+text action buttons — vertical layout like B&H */
.v2-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Generic vertical icon+text action button — aligned to a shared baseline */
.v2-header-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;  /* push content to the bottom so value text aligns */
  text-decoration: none;
  color: var(--c-text);
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 14px 6px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  position: relative;
  transition: background var(--ease-default);
  height: 60px;  /* fixed height so baselines align across buttons */
}
.v2-header-action-btn:hover {
  background: var(--c-bg-soft);
  text-decoration: none;
  color: var(--c-text);
}
.v2-header-action-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  margin-bottom: 2px;
}
.v2-header-action-icon {
  width: 26px;
  height: 26px;
  color: var(--c-text);
  flex-shrink: 0;
}
.v2-header-action-label {
  font-size: 10px;
  color: var(--c-text-muted);
  line-height: 1.15;
}
.v2-header-action-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.15;
}

/* Restyle legacy MiniBasket + MiniAssembly inside the v2 header */
.v2-header-actions .header-icon-btn-wrap {
  position: relative;
  height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}
.v2-header-actions .header-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 14px 6px;
  border-radius: var(--radius-md);
  transition: background var(--ease-default);
  text-decoration: none;
  color: var(--c-text);
}
.v2-header-actions .header-icon-btn:hover {
  background: var(--c-bg-soft);
  text-decoration: none;
}
/* Scale down the legacy icons */
.v2-header-actions .header-icon-btn img {
  width: 26px !important;
  height: 26px !important;
  object-fit: contain;
  display: block;
}
.v2-header-actions .header-icon-btn svg {
  width: 26px !important;
  height: 26px !important;
}
/* Override the legacy icon-wrap to be a relative container for the badge */
.v2-header-actions .header-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
}
/* Reposition badge to top-right of icon */
.v2-header-actions .header-icon-badge {
  position: absolute;
  top: -5px;
  right: -10px;
  background: var(--c-brand);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: var(--radius-full);
  padding: 0 4px;
}
/* Hover dropdowns — must sit above the mega menu (z-index 300) */
.v2-header-actions .miniBasket-modern,
.v2-header-actions .miniAssembly-modern {
  z-index: 10000;
}
/* Badge for custom v2 action buttons (Account) */
.v2-header-action-badge {
  position: absolute;
  top: -5px;
  right: -8px;
  background: var(--c-brand);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: var(--radius-full);
  padding: 0 4px;
  pointer-events: none;
}

/* ── Account popout (hover to open) ────────────────────── */
.v2-account-wrap { position: relative; }
.v2-account-popout {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  width: 280px;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  padding: 20px;
  flex-direction: column;
  gap: 14px;
  animation: v2FadeIn 0.12s ease;
}
.v2-account-wrap:hover > .v2-account-popout {
  display: flex;   /* overrides display:none — flex for the column layout */
}
/* Touch devices: disable hover, use tap-to-open (.is-open) instead.
   First tap opens popout, second tap navigates to account / opens login. */
@media (pointer: coarse) {
  .v2-account-wrap:hover > .v2-account-popout { display: none; }
  .v2-account-wrap.is-open > .v2-account-popout { display: flex; }
}
/* Mobile: account icon is leftmost in the actions row, so right:0 overflows
   left. Pull it right with a negative left so it opens centered-ish on screen. */
@media (max-width: 768px) {
  .v2-account-popout {
    right: auto;
    left: -90px;
    width: calc(100vw - 32px);
    max-width: 320px;
  }
}
.v2-account-popout-greeting {
  font-size: 15px;
  color: var(--c-text);
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--c-border-light);
}
.v2-account-popout-login {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  background: var(--c-brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--ease-default);
}
.v2-account-popout-login:hover { background: var(--c-brand-hover); }
.v2-account-popout-register {
  display: block;
  width: 100%;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  color: var(--c-brand);
  border: 1.5px solid var(--c-brand);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background var(--ease-default), color var(--ease-default);
}
.v2-account-popout-register:hover {
  background: var(--c-brand);
  color: #fff;
  text-decoration: none;
}
.v2-account-popout-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.v2-account-popout-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background var(--ease-default);
}
.v2-account-popout-links a:hover { background: var(--c-bg-soft); text-decoration: none; }
.v2-account-popout-links svg { width: 20px; height: 20px; color: var(--c-text-muted); flex-shrink: 0; }
.v2-account-popout-logout {
  width: 100%;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-muted);
  background: none;
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: color var(--ease-default), border-color var(--ease-default);
}
.v2-account-popout-logout:hover { color: var(--c-danger); border-color: var(--c-danger); }

@keyframes v2FadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Language switcher v2 ─────────────────────────────── */
.v2-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--c-text-muted);
  padding: 0;
}
.v2-lang-btn:hover { color: var(--c-text); }
.v2-lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: var(--z-dropdown);
  min-width: 120px;
  overflow: hidden;
  animation: v2FadeIn 0.12s ease;
}
.v2-lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  font-size: 13px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  color: var(--c-text);
  transition: background var(--ease-default);
}
.v2-lang-option:hover { background: var(--c-bg-soft); }
.v2-lang-option.active { font-weight: 700; color: var(--c-brand); }

/* Flag image in language switcher (button + dropdown options) */
.v2-lang-flag {
  width: 28px !important;
  height: 18px !important;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  display: inline-block !important;
  vertical-align: middle;
  max-width: none;
}

/* Mobile menu button */
.v2-mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--c-navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0;
  cursor: pointer;
}
.v2-mobile-menu-btn:hover { background: var(--c-navy-dark); }

@media (max-width: 768px) {
  .v2-header-utility { display: none; }
  .v2-header-main-inner {
    grid-template-columns: auto 1fr;
    gap: 10px;
  }
  .v2-header-main { padding: 8px 0; }
  .v2-header-search { display: none; }
  .v2-header-actions { justify-self: end; align-items: flex-end; }
  .v2-header-action-btn { padding: 4px 8px 0; }
  .header-icon-btn { padding-bottom: 0; }
  /* Hide text labels on action buttons — keep icons + badges only so
     the Menu button fits without wrapping. */
  .v2-header-action-label,
  .v2-header-action-value { display: none; }
  .v2-mobile-menu-btn { display: inline-flex; align-items: center; }
  .v2-header-logo img { height: 32px; }
  /* Hide the desktop nav bar on mobile — the drawer takes over. */
  .v2-nav { display: none; }
}

/* ── Main navigation bar (mega menu) ─────────────────────── */
.v2-nav {
  background: var(--c-navy);
  position: relative;
  z-index: var(--z-mega-menu);
  /* Collapsible alongside the utility bar — only the main row stays sticky.
     overflow stays visible by default so the mega-menu dropdowns can escape. */
  max-height: 80px;
  transition: max-height 0.22s ease, opacity 0.18s ease;
}
.v2-header-scrolled .v2-nav {
  max-height: 0;
  opacity: 0;
  /* Only clip when collapsed — the nav has no hover triggers in this state anyway */
  overflow: hidden;
  pointer-events: none;
}
.v2-nav-inner {
  display: flex;
  align-items: stretch;
}

@media (max-width: 768px) {
  .v2-nav { display: none; }
}

/* Top-level menu items */
.v2-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}
.v2-menu-item {
  position: static;  /* mega dropdown positions relative to .v2-nav, not the li */
}
.v2-menu-link {
  display: block;
  padding: 10px 16px !important;  /* override legacy ul li padding */
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--ease-default);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}
.v2-menu-link:hover,
.v2-menu-item:hover > .v2-menu-link {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  text-decoration: none;
}
/* Spacer pushes trailing items to the right */
.v2-menu-spacer {
  flex: 1;
  padding: 0 !important;
}
/* Highlight style for Sale & Clearance */
.v2-menu-link-highlight {
  color: #fbbf24 !important;
  border-right: none !important;
}
.v2-menu-link-highlight:hover {
  color: #fde68a !important;
}

/* Mega dropdown panel — full viewport width, anchored to .v2-nav */
.v2-nav { position: relative; }
.v2-mega {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  background: var(--c-white);
  border-top: 2px solid var(--c-brand);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-mega-menu);
  /* Hover-intent: hidden by default, no delay when closing */
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.08s linear, visibility 0s linear 0.08s;
}
.v2-menu-item:hover > .v2-mega {
  /* Delay opening 250ms so it doesn't pop when mousing past the nav */
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.12s linear 0.25s, visibility 0s linear 0.25s;
}
/* Click-to-dismiss: keep the panel hidden after a link click,
   even though the cursor is still over the parent. Cleared on mouseleave. */
.v2-menu-item-dismissed:hover > .v2-mega {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.v2-mega-inner {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 24px var(--site-padding);
}
.v2-mega-columns {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  padding: 0 !important;
}
.v2-mega-col {
  min-width: 0;
}
.v2-mega-group {
  margin-bottom: 18px;
}
.v2-mega-heading {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-navy);
  text-decoration: none;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--c-border-light);
}
.v2-mega-heading:hover { color: var(--c-brand); text-decoration: none; }

.v2-mega-sub,
.v2-mega-col ul {
  list-style: none;
  padding: 0 !important;
  margin: 0;
}
.v2-mega-sub li {
  margin: 0;
}
.v2-mega-sub a {
  display: block;
  padding: 3px 0;
  font-size: 12.5px;
  color: var(--c-text-muted);
  text-decoration: none;
  line-height: 1.5;
}
.v2-mega-sub a:hover { color: var(--c-brand); text-decoration: none; }
.v2-mega-spacer {
  padding-top: 10px;
}
/* Kill legacy styles on v2 menu items */
.v2-menu li,
.v2-mega-sub li,
.v2-mega-col li {
  background-image: none !important;
  list-style: none;
  padding-left: 0 !important;
  margin: 0;
}
/* Sub-menu items: inline bullet + link on one line */
.v2-mega-sub li {
  display: flex;
  align-items: baseline;
  gap: 0;
}
.v2-mega-sub li::before {
  content: '·';
  flex-shrink: 0;
  width: 10px;
  text-align: center;
  color: var(--c-text-faint);
  font-weight: 700;
  font-size: 15px;
}
.v2-mega-sub li a {
  flex: 1;
  min-width: 0;
}

/* ── USP Banner ──────────────────────────────────────────── */
.v2-usp {
  background: var(--c-white);
  border-bottom: 1px solid var(--c-border-light);
  padding: 10px 0;
}
.v2-usp-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.v2-usp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--c-text-muted);
  white-space: nowrap;
}
.v2-usp-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  opacity: 0.6;
}
.v2-usp-text strong {
  display: block;
  color: var(--c-text);
  font-size: 13px;
}
.v2-usp-text span {
  font-size: 12px;
}

@media (max-width: 768px) {
  .v2-usp-inner { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
  .v2-usp-item { flex-shrink: 0; }
}

/* ── Footer ──────────────────────────────────────────────── */
.v2-footer-links {
  background: var(--c-navy-dark);
  color: #fff;
  padding: 40px 0 32px;
}
.v2-footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
@media (max-width: 768px) {
  .v2-footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

.v2-footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  color: #fff;
}
.v2-footer-col ul {
  list-style: none;
}
.v2-footer-col li {
  margin-bottom: 8px;
}
.v2-footer-col a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  text-decoration: none;
  transition: color var(--ease-default);
}
.v2-footer-col a:hover { color: #fff; text-decoration: none; }

.v2-footer-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.v2-footer-phone {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.v2-footer-phone:hover { color: #fff; text-decoration: none; }
.v2-footer-phone svg { width: 16px; height: 16px; flex-shrink: 0; }
.v2-footer-hours {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

/* Bottom bar */
.v2-footer-bottom {
  background: #111827;
  padding: 14px 0;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}
.v2-footer-bottom a { color: rgba(255, 255, 255, 0.5); }
.v2-footer-bottom a:hover { color: #fff; }

/* Company details line (address, VAT) */
.v2-footer-company {
  text-align: center;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.35);
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 24px;
  line-height: 1.6;
}

/* ==================================================================
   Site-wide component styles (replaces legacy StyleSheet2.css)
   ================================================================== */

/* ── Site main ───────────────────────────────────────────── */
.site-main {
  min-height: 60vh;
  padding-bottom: var(--sp-8);
}

/* ── Card (replaces .white-box) ──────────────────────────── */
.card {
  background: var(--c-white);
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
}
.card-sm { padding: var(--sp-4); }
.card-flush { padding: 0; }

/* ── Breadcrumbs ─────────────────────────────────────────── */
.breadcrumb {
  font-size: 13px;
  color: var(--c-text-muted);
  padding: var(--sp-3) 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
}
.breadcrumb a { color: var(--c-link); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--c-text-faint); }
.breadcrumb-current { color: var(--c-text-muted); }
/* Mobile: hide the last breadcrumb item (the current page name, typically
   the product title) + its separator to save vertical space. Only hides
   when the last item is a non-link terminal (.breadcrumb-current). */
@media (max-width: 640px) {
  .breadcrumb > span:last-child:has(.breadcrumb-current) { display: none; }
  .breadcrumb { font-size: 12px; padding: var(--sp-2) 0; }
}
.breadcrumb-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--c-link);
  text-decoration: none;
  font-weight: 600;
  margin-right: 8px;
}

/* ── Page header ─────────────────────────────────────────── */
.page-header {
  padding: var(--sp-4) 0 var(--sp-6);
}
.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--c-text);
  margin: 0;
}
.page-header p {
  font-size: 14px;
  color: var(--c-text-muted);
  margin: var(--sp-2) 0 0;
}

/* ── Forms ────────────────────────────────────────────────── */
.form-field {
  margin-bottom: var(--sp-4);
}
.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: var(--sp-1);
}
.form-field input,
.form-field select,
.form-field textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-white);
  color: var(--c-text);
  transition: border-color var(--ease-default), box-shadow var(--ease-default);
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--c-brand);
  box-shadow: 0 0 0 3px rgba(255, 143, 19, 0.15);
}
.form-field input.error,
.form-field select.error {
  border-color: var(--c-danger);
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.1);
}
.form-field small {
  display: block;
  font-size: 12px;
  color: var(--c-text-muted);
  margin-top: var(--sp-1);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}
.form-actions {
  display: flex;
  gap: var(--sp-3);
  padding-top: var(--sp-4);
}
.form-error {
  color: var(--c-danger);
  font-size: 13px;
  padding: var(--sp-2) var(--sp-3);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  margin-bottom: var(--sp-4);
}

/* ── Account layout (sidebar + content) ──────────────────── */
.account-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--sp-8);
  align-items: start;
}
@media (max-width: 768px) {
  .account-layout { grid-template-columns: 1fr; gap: var(--sp-4); }
}

.account-sidebar {
  background: var(--c-white);
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.account-sidebar-header {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--c-border-light);
  font-size: 14px;
  color: var(--c-text);
}
.account-sidebar-header strong { display: block; font-size: 15px; }
.account-sidebar-logout {
  float: right;
  font-size: 13px;
  color: var(--c-text-muted);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
}
.account-sidebar-logout:hover { color: var(--c-danger); }
.account-sidebar-nav { list-style: none; padding: 0; margin: 0; }
.account-sidebar-nav a {
  display: block;
  padding: var(--sp-3) var(--sp-5);
  font-size: 14px;
  color: var(--c-text);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background var(--ease-default), border-color var(--ease-default);
}
.account-sidebar-nav a:hover {
  background: var(--c-bg-soft);
  text-decoration: none;
}
.account-sidebar-nav a.active {
  background: var(--c-brand-light);
  border-left-color: var(--c-brand);
  font-weight: 600;
  color: var(--c-brand);
}
/* Mobile: horizontal pills that wrap instead of vertical sidebar */
@media (max-width: 768px) {
  .account-sidebar { border-radius: var(--radius-md); }
  .account-sidebar-header {
    padding: var(--sp-3) var(--sp-4);
    font-size: 13px;
  }
  .account-sidebar-header strong { font-size: 14px; }
  .account-sidebar-nav {
    display: flex;
    gap: var(--sp-1);
    padding: var(--sp-2) var(--sp-3);
  }
  .account-sidebar-nav li {
    flex: 1;
  }
  .account-sidebar-nav a {
    display: block;
    padding: 6px 4px;
    border-left: none;
    border-radius: var(--radius-full);
    white-space: nowrap;
    font-size: 12px;
    text-align: center;
    background: var(--c-bg-soft);
    border: 1px solid var(--c-border);
  }
  .account-sidebar-nav a.active {
    background: var(--c-white);
    color: var(--c-brand);
    border-color: var(--c-brand);
    font-weight: 600;
  }
}

/* ── Checkout layout ─────────────────────────────────────── */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--sp-8);
  align-items: start;
}
@media (max-width: 768px) {
  .checkout-layout { grid-template-columns: 1fr; }
}

/* ── Product grid (PLP) ──────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}
@media (max-width: 1100px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .product-grid { grid-template-columns: 1fr; } }

/* ── Product card (PLP item) ─────────────────────────────── */
.product-card {
  background: var(--c-white);
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  transition: box-shadow var(--ease-default), border-color var(--ease-default);
  text-decoration: none;
  color: var(--c-text);
}
.product-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--c-border);
  text-decoration: none;
}
.product-card-image {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-2);
}
.product-card-image img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}
.product-card-name {
  font-size: 13px;
  line-height: 1.35;
  color: var(--c-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.product-card-stock {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.product-card-stock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--c-text);
}
.product-card-stock-dot.green { background: var(--c-success); }
.product-card-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-text);
  margin-top: auto;
}
.product-card-before-price {
  font-size: 13px;
  color: var(--c-text-faint);
  text-decoration: line-through;
}
.product-card-cta {
  margin-top: var(--sp-2);
}

/* ── Data table ──────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--c-text-muted);
  background: var(--c-bg-soft);
  border-bottom: 1px solid var(--c-border);
}
.data-table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-border-light);
  color: var(--c-text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--c-bg-soft); }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  justify-content: center;
  padding: var(--sp-6) 0;
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 var(--sp-2);
  font-size: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border-light);
  color: var(--c-text);
  text-decoration: none;
  transition: background var(--ease-default);
}
.pagination a:hover { background: var(--c-bg-soft); text-decoration: none; }
.pagination .active {
  background: var(--c-brand);
  color: var(--c-white);
  border-color: var(--c-brand);
  font-weight: 700;
}
.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Stock indicator ─────────────────────────────────────── */
.stock-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--c-text-muted);
}
/* Only in-stock gets green — everything else stays neutral */
.stock-green { color: var(--c-success); }

/* ── Price display ───────────────────────────────────────── */
.price-display {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.price-current {
  font-weight: 700;
  color: var(--c-text);
}
.price-before {
  color: var(--c-text-faint);
  text-decoration: line-through;
}
.price-savings {
  font-size: 12px;
  font-weight: 700;
  color: #c62828;
}

/* ── Filter sidebar (PLP) ────────────────────────────────── */
.filter-sidebar {
  background: var(--c-white);
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
}
.filter-group {
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--c-border-light);
}
.filter-group:last-child { border-bottom: none; }
.filter-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: var(--sp-2);
}
.filter-group label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 4px 0;
  font-size: 13px;
  color: var(--c-text-muted);
  cursor: pointer;
}
.filter-group label:hover { color: var(--c-text); }
.filter-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--c-brand);
}

/* ── PLP layout (sidebar + grid) ─────────────────────────── */
.plp-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--sp-6);
  align-items: start;
}
@media (max-width: 768px) {
  .plp-layout { grid-template-columns: 1fr; }
}

/* ── Mobile drawer v2 ────────────────────────────────────── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}
.drawer-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 82vw;
  max-width: 360px;
  background: var(--c-white);
  z-index: 1001;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.drawer-panel.open {
  transform: translateX(0);
}
.drawer-header {
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-bg-soft);
  border-bottom: 1px solid var(--c-border-light);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.drawer-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--c-text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  margin-left: auto;
}
.drawer-close:hover { color: var(--c-text); }
.drawer-search {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-border-light);
  /* Positioning context for the autocomplete suggestions dropdown */
  position: relative;
  z-index: 10;
}
/* Override SearchBar's default absolute positioning inside the drawer */
.drawer-search .modern-search {
  position: static !important;
  transform: none !important;
  width: 100% !important;
  left: auto !important;
  top: auto !important;
}
.drawer-search .modern-search-suggestions {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  right: 0 !important;
  width: auto !important;
  z-index: 10000;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.drawer-nav { list-style: none; padding: 0; margin: 0; }
.drawer-nav-item {
  border-bottom: 1px solid var(--c-border-light);
}
.drawer-nav-link {
  /* Reset browser defaults so <button> and <a> both render as flat rows */
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font: inherit;
  text-align: left;

  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  font-size: 15px;
  color: var(--c-text);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--ease-default);
}
.drawer-nav-link:hover,
.drawer-nav-link:focus-visible { background: var(--c-bg-soft); text-decoration: none; outline: none; }
.drawer-nav-link-arrow {
  color: var(--c-text-faint);
  font-size: 18px;
  line-height: 1;
}
.drawer-titlebar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-navy);
  color: var(--c-white);
  font-size: 14px;
  font-weight: 600;
}
.drawer-titlebar-back {
  background: none;
  border: none;
  color: var(--c-white);
  cursor: pointer;
  font-size: 18px;
  padding: 0;
}
.drawer-footer {
  padding: var(--sp-4);
  border-top: 1px solid var(--c-border-light);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* ── Modal (generic base) ────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
}
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10001;
  background: var(--c-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 400px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.modal-header {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--c-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--c-text-muted);
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--c-text); }
.modal-body { padding: var(--sp-5); }

/* ── Toast ───────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--sp-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10002;
}
.toast {
  background: var(--c-text);
  color: var(--c-white);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.2s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Holiday notice ──────────────────────────────────────── */
.holiday-notice {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  font-size: 13px;
  color: #92400e;
  margin-bottom: var(--sp-4);
}

/* ── Misc utilities ──────────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--c-text-muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.font-bold { font-weight: 700; }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }

/* ==================================================================
   PLP Product Cards (Grid + List modes)
   ================================================================== */

/* Shared */
/* Wrapper for the top-left badge stack on product cards (sale% + optional countdown). */
.plp-card-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 6px;
  align-items: center;
  z-index: 1;
}
.plp-card-sale-badge {
  background: #fbbf24;
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
/* Live countdown badge — same pill shape as sale-badge, urgency colour from .sale-ends-*-bg */
.plp-card-countdown-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  /* Subtle pulse for high-urgency reds; soon=orange stays static */
}
.sale-ends-critical-bg {
  background: #c62828;
  animation: saleCountdownPulse 1.6s ease-in-out infinite;
}
.sale-ends-soon-bg {
  background: #ef6c00;
}
@keyframes saleCountdownPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}
@media (prefers-reduced-motion: reduce) {
  .sale-ends-critical-bg { animation: none; }
}
/* Stock — neutral black icon + text on all states, matching PDP style */
.plp-card-stock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--c-text-muted);
}
.plp-card-stock svg {
  flex-shrink: 0;
}

/* Stock status colors — applied via .stock-{green|yellow|red} on both
   PLP cards (.plp-card-stock) and PDP (.pdp-v2-stock). */
.stock-green { color: #2e7d32; }
.stock-green svg { color: #2e7d32; }
.stock-yellow { color: #e65100; }
.stock-yellow svg { color: #e65100; }
.stock-red { color: #c62828; }
.stock-red svg { color: #c62828; }
.plp-card-price { font-size: 20px; font-weight: 700; color: var(--c-text); }
.plp-card-before-price { font-size: 13px; color: var(--c-text-faint); text-decoration: line-through; }
.plp-card-save-text { font-size: 12px; font-weight: 700; color: #c62828; }

/* Smart sale-ends label — shown on cards when the sale ends within 14 days.
   Three urgency tiers (driven by the .sale-ends-* modifier) escalate the colour. */
.plp-card-sale-ends {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1px;
}
.sale-ends-critical { color: #c62828; }   /* red — < 24h or last day */
.sale-ends-soon     { color: #ef6c00; }   /* orange — 2-3 days */
.sale-ends-normal   { color: var(--c-text-faint); }  /* muted — 4-14 days */
.plp-card-sku { font-size: 11px; color: var(--c-text-faint); }
.plp-card-add { width: 100%; }

/* ── Grid card ───────────────────────────────────────────── */
.plp-card-grid {
  background: var(--c-white);
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius-lg);
  /* overflow: visible so the Add-to-assembly dropdown isn't clipped by the card */
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--ease-default), border-color var(--ease-default);
}
/* Carry the rounded top corners onto the image wrapper (that used to rely on card overflow:hidden) */
.plp-card-grid-image {
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  overflow: hidden;
}
.plp-card-grid:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--c-border);
}
.plp-card-grid-image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  padding: var(--sp-3);
  background: var(--c-white);
}
.plp-card-grid-image img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
}
.plp-card-grid-body {
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  flex: 1;
}
.plp-card-grid-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--c-text);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.plp-card-grid-name:hover { color: var(--c-link); text-decoration: none; }
/* .plp-card-grid-stock removed — unified to .plp-card-stock */
.plp-card-grid-specs {
  list-style: disc;
  padding-left: 16px;
  margin: 0;
  font-size: 11.5px;
  color: var(--c-text-muted);
  line-height: 1.45;
}
.plp-card-grid-specs li { margin-bottom: 1px; }
.plp-card-grid-price {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: var(--sp-2);
}
.plp-card-grid .plp-card-price { font-size: 17px; }

/* ── List card ───────────────────────────────────────────── */
.plp-card-list {
  display: grid;
  grid-template-columns: 180px 1fr 200px;
  gap: var(--sp-5);
  background: var(--c-white);
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  transition: box-shadow var(--ease-default);
}
.plp-card-list:hover { box-shadow: var(--shadow-md); }
@media (max-width: 768px) {
  .plp-card-list {
    grid-template-columns: 100px 1fr;
    gap: var(--sp-3);
  }
  .plp-card-list-right {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
  }
}
.plp-card-list-image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
}
.plp-card-list-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.plp-card-list-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
}
.plp-card-list-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--c-text);
  text-decoration: none;
}
.plp-card-list-name:hover { color: var(--c-link); text-decoration: none; }
.plp-card-list-desc {
  font-size: 13px;
  color: var(--c-text-muted);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.plp-card-list-specs {
  list-style: disc;
  padding-left: 16px;
  margin: 0;
  font-size: 13px;
  color: var(--c-text-muted);
  line-height: 1.5;
}
.plp-card-list-specs li { margin-bottom: 2px; }
/* .plp-card-list-stock removed — unified to .plp-card-stock */
.plp-card-list-body .plp-card-stock { margin-top: auto; }
.plp-card-list-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-3);
}
.plp-card-list-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.plp-card-list-right .plp-card-price { font-size: 22px; }
.plp-card-list-right .plp-card-add { width: auto; min-width: 160px; }

/* ── Action row: Add to basket + optional Add to assembly button ── */
/* Grid: assembly button sits to the RIGHT of cart.
   List: assembly button sits to the LEFT of cart (see JSX order). */
.plp-card-actions {
  display: flex;
  gap: var(--sp-2);
  align-items: stretch;
}
.plp-card-grid .plp-card-actions .plp-card-add { flex: 1; }
/* List: keep stretch so the assembly button matches the cart button height */
.plp-card-list-right .plp-card-actions { gap: var(--sp-3); }

/* Assembly icon button — matches PDP V2's `.pdp-v2-icon-btn` look */
.plp-card-assembly-btn {
  background: var(--c-white);
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  min-width: 42px;
  /* Match the cart button's height via flex stretch */
  align-self: stretch;
  flex-shrink: 0;
  /* Belt-and-braces: explicit floor so it never collapses shorter than the cart button */
  min-height: 38px;
}
.plp-card-assembly-btn:hover {
  border-color: var(--c-text);
  color: var(--c-text);
  background: var(--c-bg-soft);
}

/* ── PLP toolbar (sort + view toggle + count) ────────────── */
.plp-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-3) 0;
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}
.plp-count {
  font-size: 13px;
  color: var(--c-text-muted);
}
.plp-sort-group {
  display: flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
}
.plp-sort-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--c-text-muted);
  transition: all var(--ease-default);
}
@media (max-width: 640px) {
  .plp-sort-btn { padding: 5px 8px; font-size: 11px; }
  .plp-view-toggle { display: none; }
}
.plp-sort-btn:hover { color: var(--c-text); border-color: var(--c-text-muted); }
.plp-sort-btn.active {
  background: var(--c-text);
  color: var(--c-white);
  border-color: var(--c-text);
}
.plp-view-toggle {
  display: flex;
  gap: var(--sp-1);
}
.plp-view-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--c-text-muted);
  transition: all var(--ease-default);
}
.plp-view-btn:hover { color: var(--c-text); }
.plp-view-btn.active {
  background: var(--c-text);
  color: var(--c-white);
  border-color: var(--c-text);
}
.plp-view-btn svg { width: 16px; height: 16px; }

/* ── PLP grid container ──────────────────────────────────── */
/* Default: 4 columns (search, brand, new-products, sale — no filter sidebar) */
.plp-products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}
@media (max-width: 1280px) { .plp-products-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1000px) { .plp-products-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .plp-products-grid { grid-template-columns: 1fr; } }
/* Inside .plp-layout (CategoryPage with filter sidebar): 3 columns */
.plp-layout .plp-products-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .plp-layout .plp-products-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .plp-layout .plp-products-grid { grid-template-columns: 1fr; } }

.plp-products-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* ── Mobile filter button + drawer ───────────────────────── */
.plp-mobile-filter-btn {
  display: none;
  width: 100%;
  padding: var(--sp-3);
  font-size: 14px;
  font-weight: 600;
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-bottom: var(--sp-4);
  text-align: center;
  color: var(--c-text);
}
@media (max-width: 768px) {
  .plp-mobile-filter-btn { display: block; }
  .plp-layout .filter-sidebar { display: none; }
  .plp-layout .filter-sidebar.mobile-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1000;
    overflow-y: auto;
    border-radius: 0;
    max-width: 320px;
    box-shadow: var(--shadow-lg);
  }
}

/* ── Load more button ────────────────────────────────────── */
.plp-load-more {
  text-align: center;
  padding: var(--sp-6) 0;
}

/* ==================================================================
   Mini-basket + Mini-assembly hover dropdowns
   (migrated from overrides.css)
   ================================================================== */
.header-icon-btn-wrap { position: relative; }
.header-icon-btn {
  display: block;
  position: relative;
  text-decoration: none;
}
.header-icon-wrap {
  position: relative;
  display: flex;
  line-height: 0;
}
.header-icon-badge {
  position: absolute;
  top: -5px;
  right: -8px;
  background: var(--c-brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: var(--radius-full);
  padding: 0 4px;
  z-index: 1;
}
.miniBasket-modern {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 10000;
  width: 360px;
  max-height: 420px;
  background: var(--c-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--c-border);
  overflow: hidden;
  animation: miniDropFadeIn 0.15s ease;
}
.header-icon-btn-wrap:hover .miniBasket-modern { display: block; }
@media (pointer: coarse) {
  .header-icon-btn-wrap:hover .miniBasket-modern { display: none; }
  .header-icon-btn-wrap.is-open .miniBasket-modern { display: block; }
}
@media (max-width: 700px) {
  .miniBasket-modern { width: 300px; right: -8px; }
}
.miniBasket-items { max-height: 320px; overflow-y: auto; padding: 8px 0; }
.miniBasket-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--c-text);
  transition: background var(--ease-default);
  border-bottom: 1px solid var(--c-border-light);
}
.miniBasket-item:hover { background: var(--c-bg-soft); }
.miniBasket-item-img { flex-shrink: 0; width: 45px; height: 45px; display: flex; align-items: center; justify-content: center; }
.miniBasket-item-qty { flex-shrink: 0; font-weight: 700; font-size: 13px; color: var(--c-text-muted); min-width: 24px; }
.miniBasket-item-name { flex: 1; font-size: 13px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.miniBasket-item-price { flex-shrink: 0; font-weight: 600; font-size: 13px; color: var(--c-brand); white-space: nowrap; }
.miniBasket-footer { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: var(--c-bg-soft); border-top: 1px solid var(--c-border-light); }
.miniBasket-total { font-size: 14px; color: var(--c-text); }
.miniBasket-total strong { color: var(--c-brand); }
.miniBasket-goto { font-size: 13px; font-weight: 600; color: var(--c-link); text-decoration: none; }
.miniBasket-goto:hover { text-decoration: underline; }

.miniAssembly-modern {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 10000;
  width: 280px;
  background: var(--c-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--c-border);
  overflow: hidden;
  animation: miniDropFadeIn 0.15s ease;
}
.header-icon-btn-wrap:hover .miniAssembly-modern { display: block; }
@media (pointer: coarse) {
  .header-icon-btn-wrap:hover .miniAssembly-modern { display: none; }
  .header-icon-btn-wrap.is-open .miniAssembly-modern { display: block; }
}
@media (max-width: 700px) {
  .miniAssembly-modern { width: 240px; right: -8px; }
}
.miniAssembly-empty { padding: 16px; text-align: center; color: var(--c-text-muted); font-size: 13px; }
.miniAssembly-items { max-height: 260px; overflow-y: auto; padding: 4px 0; }
.miniAssembly-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; text-decoration: none; color: var(--c-text); transition: background var(--ease-default); border-bottom: 1px solid var(--c-border-light); }
.miniAssembly-item:hover { background: var(--c-bg-soft); }
.miniAssembly-item-name { font-weight: 600; font-size: 13px; }
.miniAssembly-item-count { font-size: 12px; color: var(--c-text-muted); flex-shrink: 0; }
.miniAssembly-footer { padding: 10px 14px; background: var(--c-bg-soft); border-top: 1px solid var(--c-border-light); text-align: center; }
.miniAssembly-goto { font-size: 13px; font-weight: 600; color: var(--c-link); text-decoration: none; }
.miniAssembly-goto:hover { text-decoration: underline; }

@keyframes miniDropFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.basket-shake { animation: basketShake 0.5s ease-in-out; }
@keyframes basketShake {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(-12deg); }
  30% { transform: rotate(10deg); }
  45% { transform: rotate(-8deg); }
  60% { transform: rotate(6deg); }
  75% { transform: rotate(-3deg); }
  90% { transform: rotate(2deg); }
}

/* ==================================================================
   Admin Quick Edit (PDP inline editor for staff)
   ================================================================== */
.aqe-panel {
  clear: both;
  margin: 20px 0;
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-navy);
  border-radius: var(--radius-md);
  background: var(--c-bg-soft);
  padding: 16px 20px;
}
.aqe-header { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--c-border-light); }
.aqe-icon { font-size: 16px; color: var(--c-navy); }
.aqe-title { font-size: 14px; font-weight: 700; color: var(--c-navy); text-transform: uppercase; letter-spacing: 0.5px; }
.aqe-full-edit { margin-left: auto; font-size: 12px; color: var(--c-navy); text-decoration: none; }
.aqe-full-edit:hover { text-decoration: underline; }
.aqe-grid { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; }
.aqe-field { display: flex; flex-direction: column; gap: 3px; }
.aqe-label { font-size: 11px; font-weight: 600; color: var(--c-text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.aqe-input { width: 120px; padding: 6px 8px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); font-size: 13px; background: var(--c-white); transition: border-color var(--ease-default); }
.aqe-input:focus { outline: none; border-color: var(--c-navy); box-shadow: 0 0 0 2px rgba(32, 49, 137, 0.1); }
.aqe-field--checkbox { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 6px; }
.aqe-field--checkbox input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--c-navy); }
.aqe-field--readonly { display: flex; flex-direction: column; gap: 3px; }
.aqe-value { font-size: 13px; color: var(--c-text); padding: 6px 0; }
.aqe-actions { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--c-border-light); display: flex; align-items: center; gap: 12px; }
.aqe-btn { padding: 7px 24px; background: var(--c-navy); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; transition: background var(--ease-default); }
.aqe-btn:hover { background: #19266b; }
.aqe-btn:disabled { background: #999; cursor: not-allowed; }
.aqe-msg { font-size: 13px; font-weight: 500; }
.aqe-msg--success { color: var(--c-success); }
.aqe-msg--error { color: var(--c-danger); }

/* ── Alerts (success/error/warning info banners) ─────────── */
.alert {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: var(--sp-4);
}
.alert-success {
  background: #e8f5e9;
  border-color: #c8e6c9;
  color: #1b5e20;
}
.alert-error {
  background: #ffebee;
  border-color: #ffcdd2;
  color: #b71c1c;
}
.alert-warning {
  background: #fff8e1;
  border-color: #ffe082;
  color: #6d4c00;
}

/* ── Assembly detail page ──────────────────────────────────────
   The table uses inline styles with fixed column widths. On
   mobile we override those via CSS so it fits without horizontal
   page overflow. */
.assembly-detail {
  padding: 25px;
}
.assembly-table {
  /* Prevent the table from blowing out the card width */
  table-layout: auto;
}
@media (max-width: 640px) {
  .assembly-detail {
    padding: 12px !important;
  }
  /* Name rename input — don't let it push the card wider */
  .assembly-name-input {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 18px !important;
    box-sizing: border-box;
  }
  /* Let the table scroll horizontally if it still doesn't fit,
     rather than overflowing the entire page. */
  .assembly-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .assembly-table thead,
  .assembly-table tbody {
    display: table;
    width: 100%;
  }
  /* Hide the thumbnail column on mobile — saves 60px.
     :not([colspan]) ensures section headers (CPU, RAM, etc.) stay visible. */
  .assembly-table th:first-child,
  .assembly-table td:first-child:not([colspan]) {
    display: none;
  }
  /* Shrink fixed column widths so the table fits ~340px.
     Target .assembly-line (product rows only) so the picker
     rows inside colspan cells are not affected. */
  .assembly-table th:nth-child(3),
  .assembly-line td:nth-child(3) { width: 80px !important; }
  .assembly-table th:nth-child(4),
  .assembly-line td:nth-child(4) { width: 80px !important; }
  .assembly-table th:nth-child(5),
  .assembly-line td:nth-child(5) { width: 30px !important; }
  .assembly-line td { padding: 6px 4px !important; }
  .assembly-line td a { font-size: 13px; word-break: break-word; }
}

/* ── Cart (basket) line items ─────────────────────────────────
   Desktop: 6-column grid matching the table header.
   Mobile:  2-column area layout — image spans two rows on the
            left, info/remove on top-right, qty/total on bottom-right.
            Unit price is hidden on mobile (duplicates line total
            when qty=1 and isn't worth the space otherwise). */
.cart-table-header {
  display: grid;
  grid-template-columns: 60px 1fr 120px 100px 100px 40px;
  gap: 12px;
  padding: 12px 16px;
  background: var(--c-bg-soft);
  border-bottom: 1px solid var(--c-border-light);
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  align-items: center;
}
.cart-row {
  display: grid;
  grid-template-areas: "image info qty unit total remove";
  grid-template-columns: 60px 1fr 120px 100px 100px 40px;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border-light);
  align-items: center;
}
.cart-row-image { grid-area: image; }
.cart-row-image img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}
.cart-row-info { grid-area: info; min-width: 0; }
.cart-row-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cart-row-sku {
  font-size: 11px;
  color: var(--c-text-faint);
  margin-top: 2px;
}
.cart-row-qty {
  grid-area: qty;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.cart-row-qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  background: var(--c-white);
  cursor: pointer;
  font-size: 14px;
}
.cart-row-qty-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cart-row-qty-input {
  width: 36px;
  text-align: center;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: 4px 2px;
  font-size: 14px;
  /* Hide the default number-input spinner arrows */
  -moz-appearance: textfield;
  appearance: textfield;
}
.cart-row-qty-input::-webkit-outer-spin-button,
.cart-row-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.cart-row-unit-price {
  grid-area: unit;
  text-align: right;
  font-size: 14px;
  color: var(--c-text-muted);
}
.cart-row-total {
  grid-area: total;
  text-align: right;
  font-size: 14px;
  font-weight: 600;
}
.cart-row-remove {
  grid-area: remove;
  justify-self: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--c-text-faint);
  font-size: 22px;
  line-height: 1;
  padding: 4px;
}
.cart-row-remove:hover { color: var(--c-danger); }

@media (max-width: 640px) {
  /* Desktop column header becomes meaningless once rows restructure — hide it. */
  .cart-table-header { display: none; }

  .cart-row {
    grid-template-areas:
      "image info   remove"
      "image qty    total";
    grid-template-columns: 72px 1fr auto;
    row-gap: 10px;
    column-gap: 12px;
    padding: 12px;
  }
  .cart-row-image {
    align-self: start;
  }
  .cart-row-image img {
    width: 72px;
    height: 72px;
  }
  .cart-row-qty { justify-content: flex-start; }
  .cart-row-total { font-size: 15px; }
  .cart-row-unit-price { display: none; }
  .cart-row-remove {
    align-self: start;
    justify-self: end;
  }
}

/* ── Contact page ────────────────────────────────────────── */

/* Form: 2-col on desktop (name+email row, phone+subject row), full-width message */
.contact-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3) var(--sp-4);
}
.contact-form-grid .contact-form-message {
  grid-column: 1 / -1;
}
@media (max-width: 600px) {
  .contact-form-grid { grid-template-columns: 1fr; }
}

.contact-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-8);
  align-items: start;
  margin-bottom: var(--sp-6);
}
@media (max-width: 768px) {
  .contact-info-grid { grid-template-columns: 1fr; gap: var(--sp-4); }
}
.contact-info-grid p { margin: 0 0 var(--sp-3); font-size: 14px; line-height: 1.6; }
.contact-info-grid p:last-child { margin-bottom: 0; }
.contact-info-grid a { color: var(--c-link); }

.google-maps {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
}
.google-maps iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0;
}

/* ── Scroll-to-top button ────────────────────────────────────
   Floating bottom-right pill. Hidden until the user scrolls past
   the threshold; fades + slides in when shown.
   (Tawk.to chat widget lives bottom-LEFT, so no collision concerns.) */
.scroll-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-navy);
  color: var(--c-white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  /* Hidden + offset by default; transitions in when .scroll-to-top-visible is added */
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.15s ease, visibility 0s linear 0.18s;
  z-index: var(--z-sticky);
}
.scroll-to-top-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.15s ease, visibility 0s linear 0s;
}
.scroll-to-top:hover {
  background: var(--c-brand);
}
.scroll-to-top:focus-visible {
  outline: 2px solid var(--c-brand);
  outline-offset: 2px;
}
@media (max-width: 768px) {
  .scroll-to-top {
    /* Slightly smaller + tighter to the edge on phones */
    width: 40px;
    height: 40px;
    right: 14px;
    bottom: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-to-top {
    transition: opacity 0.18s ease, visibility 0s linear 0.18s;
    transform: none;
  }
  .scroll-to-top-visible {
    transition: opacity 0.18s ease, visibility 0s linear 0s;
  }
}
