/* ============================================================
   COMPONENTS — header, buttons, cards, package/quote tool
   pieces, footer. No hard-coded colours or fonts — everything
   references the tokens in variables.css.
   ============================================================ */

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(10, 20, 32, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.site-header .container {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.35rem;
  white-space: nowrap;
}

.logo__mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  object-fit: contain;
}

.logo__text-dark { color: var(--color-text); }
.logo__text-accent { color: var(--color-primary); }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a {
  color: var(--color-text);
  transition: color var(--transition-fast);
  padding: 0.4rem 0;
}

.nav-links a:hover {
  color: var(--color-primary);
}

/* "FAQ" nav item is also the dropdown trigger for Contact/FAQ/Blog (see
   js/main.js for the open/close behaviour) — Contact wasn't reachable
   from the header at all before this, only from the footer. */
.nav-dropdown {
  position: relative;
}

.nav-dropdown__toggle {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  font: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text);
  padding: 0.4rem 0;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.nav-dropdown__toggle:hover { color: var(--color-primary); }

.nav-dropdown__toggle svg {
  width: 11px;
  height: 11px;
  transition: transform var(--transition-fast);
}

.nav-dropdown.is-open .nav-dropdown__toggle svg {
  transform: rotate(180deg);
}

.nav-dropdown__menu {
  display: none;
  flex-direction: column;
  gap: 0.1rem;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.5rem;
  min-width: 150px;
  padding: 0.4rem;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  z-index: 10;
}

.nav-dropdown.is-open .nav-dropdown__menu {
  display: flex;
}

.nav-dropdown__menu a {
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--color-text);
  white-space: nowrap;
}

.nav-dropdown__menu a:hover {
  background: var(--color-bg-elevated-2);
  color: var(--color-primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--color-text);
  transition: background var(--transition-fast);
}

.icon-btn:hover { background: var(--color-bg-elevated); }
.icon-btn svg { width: 20px; height: 20px; }

.cart-count {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 1.6rem;
}

/* Shown only inside the mobile dropdown at very small widths, where
   the header's own "Instant Quote" pill has to be hidden for space
   (see the 480px query below) — keeps Instant Quote reachable. */
.nav-quote-mobile-only {
  display: none;
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }

  .nav-links.is-open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-sm) var(--space-md) var(--space-md);
    gap: var(--space-xs);
  }

  /* Inside the mobile dropdown the whole nav is already a vertical list
     at full width, so the FAQ/Contact/Blog submenu renders as a plain
     indented sub-list in place rather than a floating popover — and it
     stays open once tapped, matching how every other item here behaves
     (no second tap needed to reveal it). */
  .nav-dropdown__menu {
    position: static;
    display: none;
    margin: 0 0 0 var(--space-sm);
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
  }

  .nav-dropdown.is-open .nav-dropdown__menu {
    display: flex;
  }
}

/* A 5-6 item nav plus the wordmark and header icons leaves no room
   for the "Instant Quote" pill at phone widths — hide it here and
   rely on .nav-quote-mobile-only inside the dropdown instead (same
   pattern used across this system's other templates for a crowded
   mobile header — see _system-docs/SYSTEM-OVERVIEW.md). */
@media (max-width: 480px) {
  .header-right > .btn--primary.btn--sm {
    display: none;
  }
  .nav-quote-mobile-only {
    display: block;
  }
  /* Logo + icon cluster still doesn't fit phone-width headers even
     with the quote pill gone — shrink both slightly rather than
     let the header force horizontal scroll on the whole page. */
  .logo {
    font-size: 1.05rem;
    gap: 0.35rem;
  }
  .logo__mark {
    width: 24px;
    height: 24px;
  }
  .header-right {
    gap: 0.5rem;
  }
}

/* Very small phones (320-360px): the logo and three icons still added up
   to wider than the screen, so everything shrinks one more notch. */
@media (max-width: 360px) {
  .logo { font-size: 0.95rem; gap: 0.3rem; }
  .logo__mark { width: 20px; height: 20px; }
  .header-right { gap: 0.15rem; }
  .icon-btn { width: 32px; height: 32px; }
  .icon-btn svg { width: 18px; height: 18px; }
  .nav-toggle { padding: 0.25rem; font-size: 1.4rem; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
  /* A <button> and an <a> get different default line-heights (button
     uses the browser's own form-control default; an anchor inherits
     body's line-height:1.6) — with identical padding/font-size that
     still renders a <button>.btn several px shorter than an <a>.btn,
     which is why a "Choose a package" row mixing <button> (Add to
     Basket) and <a> (Get a Quote / See Our Services Here) CTAs came
     out visibly different heights. Pinning line-height here removes
     the browser-default difference so every .btn is the same height
     regardless of which tag it's written as. */
  line-height: 1.2;
}

.btn--sm {
  padding: 0.5rem 1.1rem;
  font-size: 0.85rem;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-text-on-primary);
}
.btn--primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.btn--outline:hover {
  background: rgba(241, 90, 36, 0.1);
}

.btn--outline-white {
  background: transparent;
  border-color: var(--color-border-light);
  color: var(--color-text);
}
.btn--outline-white:hover {
  border-color: var(--color-text);
}

/* background: transparent is explicit here (not just implied) because
   these get applied to real <button> elements as well as <a> tags —
   a <button> has a white UA-default background unless this overrides
   it, which is the "filled white when it shouldn't be" bug to watch
   for on any future colour-outline button variant. */
.btn--teal { background: transparent; border-color: var(--color-accent-teal); color: var(--color-accent-teal); }
.btn--teal:hover { background: rgba(45, 212, 208, 0.1); }

.btn--purple { background: transparent; border-color: var(--color-accent-purple); color: var(--color-accent-purple); }
.btn--purple:hover { background: rgba(155, 107, 240, 0.1); }

.btn--green { background: transparent; border-color: var(--color-accent-green); color: var(--color-accent-green); }
.btn--green:hover { background: rgba(52, 211, 153, 0.1); }

.btn--block { width: 100%; }

.btn--white {
  background: #fff;
  color: #1f2933;
  border-color: #fff;
}
.btn--white:hover { background: #f0f0f0; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-md);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.card:hover {
  border-color: var(--color-border-light);
}

/* Template-product page's "Choose a package" grid: cards have uneven
   content length (some have an extra disclaimer paragraph, some don't),
   so without this the CTA buttons/links land at different heights.
   Grid items already stretch to the row's full height by default, so a
   flex column + margin-top:auto on the CTA reliably pins every button
   to the same bottom edge regardless of how much text is above it. */
#packages .card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#packages .card > .btn,
#packages .card > a.btn {
  margin-top: auto;
}

.card__image-wrap {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-bg-alt);
  margin-bottom: var(--space-sm);
}

.card__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Icon badge (used on package cards + feature rows) ---- */
.icon-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-sm);
}
.icon-badge svg { width: 22px; height: 22px; }

.icon-badge--orange { background: rgba(241, 90, 36, 0.15); color: var(--color-primary); }
.icon-badge--teal { background: rgba(45, 212, 208, 0.15); color: var(--color-accent-teal); }
.icon-badge--purple { background: rgba(155, 107, 240, 0.15); color: var(--color-accent-purple); }
.icon-badge--green { background: rgba(52, 211, 153, 0.15); color: var(--color-accent-green); }

/* ============================================================
   CHECK LIST
   ============================================================ */
.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.3rem 0;
  font-size: 0.92rem;
  color: var(--color-text-muted);
}

.check-list svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--color-primary);
}

/* ============================================================
   TAGS / BADGES
   ============================================================ */
.tag {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-light);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.tag--orange { border-color: var(--color-primary); color: var(--color-primary); }
.tag--teal { border-color: var(--color-accent-teal); color: var(--color-accent-teal); }
.tag--purple { border-color: var(--color-accent-purple); color: var(--color-accent-purple); }
.tag--green { border-color: var(--color-accent-green); color: var(--color-accent-green); }

/* ============================================================
   PACKAGE CARDS (4-tier system — homepage + packages.html)
   ============================================================ */
.package-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.package-card--featured {
  position: relative;
  border-color: var(--color-accent-teal);
  box-shadow: 0 0 0 1px var(--color-accent-teal);
}

.package-card__badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--color-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-pill, 999px);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  z-index: 2;
}

.package-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.package-card__desc {
  font-size: 0.88rem;
  margin-bottom: var(--space-sm);
  /* Reserves room for the longest description across the 4-card row
     (Custom Order's wraps to 4 lines, others to 2-3) so every card's
     "WHAT'S INCLUDED"/"WHAT CAN WE DO?" heading and list start at the
     same y-position — same fix pattern as .service-card__desc. */
  min-height: 5.3rem;
}

.package-card__whats {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text);
  margin-bottom: 0.3rem;
}

.package-card__list {
  flex-grow: 1;
  margin-bottom: var(--space-sm);
}

.package-card__price-label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: 0.1rem;
}

.package-card__price {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  margin-bottom: var(--space-sm);
}

/* ============================================================
   QUOTE TOOL (homepage + used standalone in the quote/checkout flow)
   ============================================================ */
.quote-tool {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-lg);
}

@media (max-width: 640px) {
  .quote-tool { padding: var(--space-md); }
}

.quote-step {
  margin-bottom: var(--space-lg);
}

.quote-step:last-child { margin-bottom: 0; }

.quote-step__header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: var(--space-md);
}

.quote-step__number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quote-step__header h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1.3rem;
}

.quote-base-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

@media (max-width: 640px) {
  .quote-base-options { grid-template-columns: 1fr; }
}

.quote-base-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-elevated-2);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-md);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}


/* Selecting a base package no longer tints/highlights the whole card —
   matches how add-on buttons indicate their own selected state: only
   the card's own CTA button (.quote-base-card__cta) fills with colour,
   toggled by js/quote-tool.js. Kept the card's hover/cursor affordance,
   just dropped the background+border "whole box" highlight. */
.quote-base-card__cta.is-selected {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.quote-base-card--teal .quote-base-card__cta.is-selected {
  background: var(--color-accent-teal);
  border-color: var(--color-accent-teal);
  color: #04211f;
}

.quote-base-card h4 { margin-bottom: 0.4rem; }

.quote-base-card p {
  font-size: 0.85rem;
  margin-bottom: var(--space-sm);
}

.quote-base-card__note {
  font-size: 0.75rem;
  color: var(--color-text-faint);
  display: block;
  margin-top: auto;
  margin-bottom: var(--space-sm);
}

.quote-toggle-btn {
  width: 100%;
  padding: 0.7rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--color-border-light);
  background: transparent;
  color: var(--color-text);
  font-weight: 700;
  transition: all var(--transition-fast);
}

.quote-toggle-btn.is-selected {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.quote-toggle-btn--teal.is-selected {
  background: var(--color-accent-teal);
  border-color: var(--color-accent-teal);
  color: #04211f;
}

/* The divider line between rows belongs on the GROUP (row + its
   collapsible details panel together), not on .quote-row alone.
   .quote-row is the label/controls line, .quote-details-panel is a
   sibling that follows it and expands open below it — putting the
   border-bottom on .quote-row drew the divider immediately after that
   line, so opening "See more details" made the blurb appear UNDER an
   already-fixed line instead of the line moving down to sit below the
   now-taller group. Border on the group fixes that: it naturally sits
   after whichever content is currently visible, open or closed. */
.quote-row-group { border-bottom: 1px solid var(--color-border); }
.quote-row-group:last-child { border-bottom: none; }

.quote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  flex-wrap: wrap;
}

.quote-row__label {
  flex: 1;
  min-width: 180px;
}

.quote-row__label strong {
  display: block;
  font-size: 0.95rem;
}

.quote-row__label a {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  text-decoration: underline;
}

/* "See more details" — expands a short blurb inline rather than
   navigating away from the tool (data-details-toggle / data-details-panel
   pair, wired up in js/quote-tool.js). */
.quote-details-btn {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.quote-details-btn:hover { color: var(--color-primary); }

.quote-details-panel {
  display: block;
  overflow: hidden;
  max-height: 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  transition: max-height var(--transition-fast), padding-bottom var(--transition-fast);
  padding-bottom: 0;
}

.quote-details-panel.is-open {
  max-height: 6rem;
  padding-bottom: var(--space-sm);
}

/* Basket/checkout "what's included" breakdown reuses this same
   expand/collapse component, but a custom quote package can carry far
   more lines (base + several add-ons) than the short 2-3 line blurb
   this component was originally built for. The shared 6rem cap was
   silently clipping longer breakdown lists via overflow:hidden — the
   data was always there in item.meta.breakdown, it just wasn't visible.
   This modifier (added alongside .quote-details-panel in basket.html
   and purchase.html) gives the breakdown case a much taller cap instead
   of reusing the blurb's short one. */
.quote-details-panel--breakdown.is-open {
  max-height: 30rem;
}

.quote-row__controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Phones: keep the label on the left and the counter + price on the right
   (same as the other rows) instead of letting the controls wrap underneath.
   The label is allowed to wrap onto two lines instead. */
.quote-row__controls { margin-left: auto; }

@media (max-width: 560px) {
  .quote-row { flex-wrap: nowrap; align-items: center; }
  .quote-row__label { min-width: 0; flex: 1 1 auto; }
  .quote-row__controls { flex-shrink: 0; gap: 0.4rem; }
  .quote-stepper button { width: 26px; height: 28px; }
  .quote-stepper__value { width: 22px; }
  .quote-add-btn { padding: 0.45rem 0.7rem; min-width: 62px; }
}

.quote-stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.quote-stepper button {
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  color: var(--color-text);
  font-size: 1rem;
}

.quote-stepper button:hover { background: var(--color-bg-elevated-2); }
.quote-stepper button:disabled { opacity: 0.35; cursor: not-allowed; }
.quote-stepper button:disabled:hover { background: transparent; }

.quote-stepper__value {
  width: 30px;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.quote-add-btn {
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-pill);
  border: 2px solid var(--color-primary);
  background: transparent;
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.85rem;
  min-width: 78px;
  transition: all var(--transition-fast);
}

.quote-add-btn.is-selected {
  background: var(--color-primary);
  color: #fff;
}

.quote-add-btn--month {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.quote-month-suffix {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* ---- Quote summary panel ---- */
.quote-summary {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-md);
  position: sticky;
  top: calc(var(--header-height) + var(--space-md));
}

.quote-summary h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  margin-bottom: var(--space-sm);
}

.quote-summary__group-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-primary);
  margin: var(--space-sm) 0 0.4rem;
}

.quote-summary__line {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.35rem 0;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--color-border);
}

.quote-summary__line:last-child { border-bottom: none; }

.quote-summary__line--empty {
  color: var(--color-text-faint);
  font-style: italic;
}

.quote-summary__totals {
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border-light);
}

.quote-summary__totals .quote-summary__line {
  border-bottom: none;
  padding: 0.25rem 0;
}

.quote-summary__discount { color: var(--color-accent-green); }

.quote-summary__note {
  font-size: 0.75rem;
  color: var(--color-text-faint);
  padding-top: 0.3rem !important;
}

.quote-summary__grand-total {
  font-weight: 700;
  font-size: 1.1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border-light);
  margin-top: 0.4rem;
}

.quote-summary__actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: var(--space-md);
}

.quote-discount-banner {
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid var(--color-accent-green);
  border-radius: var(--radius);
  padding: var(--space-sm);
  text-align: center;
  margin-bottom: var(--space-sm);
}

.quote-discount-banner strong {
  display: block;
  color: var(--color-accent-green);
  font-size: 1.2rem;
}

.quote-info-box {
  border: 1px solid var(--color-primary);
  border-radius: var(--radius);
  padding: var(--space-sm);
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.quote-info-box strong {
  display: block;
  color: var(--color-primary);
  margin-bottom: 0.3rem;
}

.quote-info-box a { color: var(--color-primary); text-decoration: underline; }

/* ============================================================
   FORM FIELDS
   ============================================================ */
.field { margin-bottom: var(--space-sm); }

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--color-bg-elevated-2);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  transition: border-color var(--transition-fast);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--color-primary);
}

.field textarea { resize: vertical; min-height: 120px; }

/* Discount/gift-code input on purchase.html — same visual language as
   .field input, just scoped separately since it sits in a flex row
   next to its Apply button rather than in its own labelled block. */
.discount-code-input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0.9rem;
  background: var(--color-bg-elevated-2);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast);
}

.discount-code-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.discount-code-input::placeholder {
  color: var(--color-text-faint);
}

/* ============================================================
   FEATURE ROW (hero strip: Modern Designs / Fast Delivery / etc.)
   ============================================================ */
.feature-row {
  /* A 2x2 grid (not flex-wrap) so the 4 items land in fixed, even
     positions — item order is Modern Designs / Fast Delivery / SEO
     Ready / Ongoing Support, which puts "SEO Ready" directly under
     "Fast Delivery" in the second column. */
  display: grid;
  grid-template-columns: repeat(2, auto);
  column-gap: var(--space-lg);
  row-gap: var(--space-sm);
}

@media (max-width: 420px) {
  .feature-row { grid-template-columns: 1fr; }
}

.feature-row__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.feature-row__item svg {
  width: 24px;
  height: 24px;
  color: var(--color-primary);
  flex-shrink: 0;
}

/* ============================================================
   STAT STRIP
   ============================================================ */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  text-align: center;
}

@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

.stats__number {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  color: var(--color-primary);
}

.stats__label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ============================================================
   TEMPLATE CATEGORY / PRODUCT CARDS
   ============================================================ */
.template-card {
  display: block;
}

.template-card__image {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  margin-bottom: var(--space-sm);
  position: relative;
}

.template-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-medium);
}

.template-card:hover .template-card__image img {
  transform: scale(1.04);
}

.template-card__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
}

.template-card__label svg {
  width: 18px;
  height: 18px;
  color: var(--color-primary);
  transition: transform var(--transition-fast);
}

.template-card:hover .template-card__label svg { transform: translateX(4px); }

/* ---- Carousel wrapper for Templates.html category sections ---- */
.template-carousel {
  position: relative;
}

.template-carousel__track {
  display: flex;
  overflow-x: auto;
  gap: var(--space-md);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 0.5rem;
}

.template-carousel__track::-webkit-scrollbar { display: none; }

.template-carousel__track .template-card {
  flex: 0 0 300px;
  scroll-snap-align: start;
}

.template-carousel__arrow {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-bg-elevated-2);
  border: 1px solid var(--color-border-light);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.template-carousel__arrow--prev { left: -20px; }
.template-carousel__arrow--next { right: -20px; }

@media (max-width: 640px) {
  .template-carousel__arrow { display: none; }
}

/* Arrows are switched off site-wide for now — too few templates yet
   to make scrolling worth it. Delete this rule to bring them back
   once the catalogue has grown (the markup and JS in js/main.js are
   still in place, untouched). */
.template-carousel__arrow { display: none; }

/* ============================================================
   TWO-COLUMN "MAIN + SIDEBAR" LAYOUT
   ------------------------------------------------------------
   Used by the Instant Quote tool, basket.html, purchase.html —
   anywhere a wide main column sits next to a narrower summary
   sidebar. Collapses to a single column on small screens (the
   inline 2fr/1fr split used to be set with an inline style,
   which a media query can never override — hence this class).
   ============================================================ */
.layout-with-sidebar {
  display: grid;
  grid-template-columns: 2fr 1fr;
  align-items: start;
  gap: var(--space-xl);
}

@media (max-width: 860px) {
  /* minmax(0, 1fr), not 1fr: a plain 1fr column can't shrink below its
     contents, so a wide basket row stretched the whole page past the
     phone screen (and made the nav/footer look short when zoomed out). */
  .layout-with-sidebar { grid-template-columns: minmax(0, 1fr); }
}
.layout-with-sidebar > * { min-width: 0; }

/* ============================================================
   BASKET / SERVICE LINE ITEM (services.html, basket.html)
   ============================================================ */
.service-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.service-card h3 {
  /* Reserves space for 2 lines so a short one-line title ("Analytics")
     and a long one that wraps ("Booking System (Standard)") both leave
     the price/description/list starting at the same y-position across
     a row of cards — the fix for the "boxes aren't aligned" bug.
     Left as a plain block (not flex) so every title's TEXT starts at
     the same top y-position too — bottom-aligning the title box
     (the previous flex/align-items:flex-end approach) kept the price
     lines level but made the titles themselves look scattered, since
     a short one-line title sat pinned to the bottom of its box while a
     two-line title filled it from the top. A plain min-height reserves
     the same vertical space either way, without needing to flex it. */
  min-height: 3rem;
}

.service-card__price {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  margin: 0.4rem 0 0.6rem;
}

.service-card__price span {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.service-card__desc {
  font-size: 0.88rem;
  margin-bottom: var(--space-sm);
  /* Same reasoning as h3 above — reserve room for the longest
     description (~3 lines) so every card's bullet list starts level. */
  min-height: 4.3rem;
}

.service-card__list {
  flex-grow: 1;
  margin-bottom: var(--space-sm);
}

.service-card__list li {
  align-items: flex-start;
}

/* ============================================================
   BASKET LINE ITEM
   ============================================================ */
.basket-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
}

.basket-item__thumb {
  width: 80px;
  height: 60px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-elevated-2);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
  overflow: hidden;
}

.basket-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Warning shown under a Services-page "Add to Basket" button when that
   service/add-on is already in the basket (added here before, or via the
   Instant Quote tool) — see services/index.html. */
.service-card__warning {
  /* base.css gives every <p> a 65ch max-width with no auto margins, which
     left-docks a short paragraph in a centered layout instead of actually
     centering it — the same bug fixed on the calendar/contact pages'
     "Prefer email?" text, so this uses the same margin:auto fix. */
  margin: var(--space-xs) auto 0;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--color-primary);
  text-align: center;
}

.basket-item__info { flex-grow: 1; min-width: 0; overflow-wrap: anywhere; }

.basket-item__price {
  font-weight: 700;
  white-space: nowrap;
}

.basket-item__remove {
  background: none;
  border: none;
  color: var(--color-text-faint);
  transition: color var(--transition-fast);
}
.basket-item__remove:hover { color: var(--color-error); }

/* Phones: the row wraps - picture + name on top, quantity / price / remove
   underneath - instead of squeezing five things onto one line. */
@media (max-width: 560px) {
  .basket-item { flex-wrap: wrap; gap: var(--space-sm) var(--space-md); }
  .basket-item__thumb { width: 64px; height: 48px; }
  .basket-item__info { flex: 1 1 100%; }
  /* with a thumbnail: name sits beside the picture, controls wrap below */
  .basket-item__thumb + .basket-item__info { flex: 1 1 0; min-width: 120px; }
  .basket-item__price { margin-left: auto; }
}

/* ============================================================
   ACCOUNT DASHBOARD
   ============================================================ */
.account-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--space-lg);
  align-items: start;
}

.account-layout > * { min-width: 0; }

@media (max-width: 860px) {
  .account-layout { grid-template-columns: minmax(0, 1fr); }

  /* Stacked layout: the sidebar becomes a swipeable tab row that sticks
     below the nav bar, above the page content. */
  .account-layout .account-sidebar {
    /* Sticks just BELOW the nav bar (header is --header-height + 1px border)
       and sits above the page content (z-index) so nothing scrolls over it. */
    position: sticky;
    top: calc(var(--header-height) + 0.75rem);
    z-index: 50;
    /* paints the page background over the small gap above the bar so
       scrolling content doesn't show through between it and the nav bar */
    box-shadow: 0 -0.75rem 0 0 var(--color-bg);
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--space-sm);
  }
  .account-sidebar .account-nav-link {
    flex: 0 0 auto;
    width: auto;
    margin-bottom: 0;
    white-space: nowrap;
    padding: 0.65rem 0.9rem;
  }
  .account-sidebar .account-nav-link--logout {
    margin-top: 0;
    width: auto !important;
  }
}

.account-sidebar {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-md);
  position: sticky;
  top: calc(var(--header-height) + var(--space-md));
}

.account-sidebar__logo {
  margin-bottom: var(--space-md);
}

.account-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.3rem;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.account-nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.account-nav-link:hover { background: var(--color-bg-elevated-2); }

.account-nav-link.is-active {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.account-nav-link--logout {
  margin-top: var(--space-md);
  color: var(--color-text-muted);
}

.stat-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-md);
}

.stat-card__label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.stat-card__value {
  font-family: var(--font-heading);
  font-size: 1.7rem;
}

.panel {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-md);
}

.panel__title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.panel__empty {
  color: var(--color-text-faint);
  font-size: 0.9rem;
  font-style: italic;
  padding: var(--space-md) 0;
  text-align: center;
}

.data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}
.data-row:last-child { border-bottom: none; }
.data-row__meta { color: var(--color-text-muted); font-size: 0.82rem; }

.status-pill {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.status-pill--active { background: rgba(52, 211, 153, 0.15); color: var(--color-accent-green); }
.status-pill--pending { background: rgba(241, 90, 36, 0.15); color: var(--color-primary); }
.status-pill--done { background: rgba(143, 160, 179, 0.15); color: var(--color-text-muted); }

/* ============================================================
   AUTH (register.html)
   ============================================================ */
.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - var(--header-height));
}

.auth-layout__intro {
  padding: var(--space-xl) var(--space-lg);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Kept AFTER the unconditional .auth-layout__intro rule above, on
   purpose: same specificity (one class), so whichever comes later in
   the file wins regardless of the media query — this one needs to be
   last so the mobile display:none actually takes effect instead of
   silently losing to the unconditional display:flex above it. */
@media (max-width: 860px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-layout__intro { display: none; }
}

.auth-layout__form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.auth-card {
  width: 100%;
  max-width: 460px;
}

.auth-tabs {
  display: flex;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.auth-tab {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-weight: 700;
  font-size: 1.05rem;
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.auth-tab.is-active {
  color: var(--color-text);
  border-color: var(--color-primary);
}

.auth-panel { display: none; }
.auth-panel.is-active { display: block; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
  color: var(--color-text-faint);
  font-size: 0.85rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border-light);
}

.auth-forgot {
  display: block;
  text-align: right;
  font-size: 0.85rem;
  color: var(--color-primary);
  margin: -0.5rem 0 var(--space-md);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--color-bg-dark);
  border-top: 1px solid var(--color-border);
  padding: var(--space-xl) 0 var(--space-md);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-grid h4 {
  color: var(--color-text);
  margin-bottom: var(--space-sm);
  font-size: 0.95rem;
}

.footer-grid a {
  display: block;
  margin-bottom: 0.5rem;
  transition: color var(--transition-fast);
}
.footer-grid a:hover { color: var(--color-primary); }

.footer-legal {
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  font-size: 0.82rem;
  flex-wrap: wrap;
}

.footer-legal a, .footer-legal button {
  color: var(--color-text-muted);
  background: none;
  border: none;
  font-size: 0.82rem;
  padding: 0;
}
.footer-legal a:hover, .footer-legal button:hover { color: var(--color-primary); }

.footer-bottom {
  padding-top: var(--space-sm);
  font-size: 0.8rem;
  color: var(--color-text-faint);
}

/* ============================================================
   COOKIE CONSENT (see css/cookie-consent.css for the full pattern —
   this file only sets up shared tokens it relies on, already
   present above)
   ============================================================ */

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--color-text-faint);
}
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-primary); }

/* ============================================================
   PRODUCT GALLERY (template-product.html) + LIGHTBOX
   ============================================================ */
.product-gallery {
  max-width: 100%;
}

.product-gallery__main {
  position: relative;
  overflow: hidden;
}

.product-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Thumbnail strip stays in the DOM (the lightbox and active-state
   logic still reference it) but is hidden on the page itself —
   navigation happens via the arrows below instead. */
.product-gallery__strip {
  display: none;
}

.product-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-bg-elevated-2);
  border: 1px solid var(--color-border-light);
  color: var(--color-text);
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity var(--transition-fast);
}

.product-gallery__nav:hover { opacity: 1; }
.product-gallery__nav--prev { left: var(--space-sm); }
.product-gallery__nav--next { right: var(--space-sm); }

.product-gallery__counter {
  position: absolute;
  bottom: var(--space-sm);
  right: var(--space-sm);
  background: rgba(5, 10, 16, 0.65);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .product-gallery { max-width: 100%; }
  .product-gallery__nav { width: 34px; height: 34px; font-size: 1.2rem; }
}

.product-gallery__thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  scroll-snap-align: start;
  cursor: pointer;
  opacity: 0.6;
  transition: all var(--transition-fast);
}

.product-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-gallery__thumb:hover { opacity: 0.85; }

.product-gallery__thumb.is-active {
  opacity: 1;
  border-color: var(--color-primary);
}

.gallery-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 16, 0.92);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.gallery-lightbox.is-open { display: flex; }

.gallery-lightbox__image {
  max-width: min(90vw, 1100px);
  max-height: 85vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.gallery-lightbox__close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-bg-elevated-2);
  border: 1px solid var(--color-border-light);
  color: var(--color-text);
  font-size: 1.6rem;
  line-height: 1;
}

.gallery-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-bg-elevated-2);
  border: 1px solid var(--color-border-light);
  color: var(--color-text);
  font-size: 1.8rem;
  line-height: 1;
}

.gallery-lightbox__nav--prev { left: var(--space-md); }
.gallery-lightbox__nav--next { right: var(--space-md); }

@media (max-width: 640px) {
  .gallery-lightbox__nav { width: 40px; height: 40px; font-size: 1.4rem; }
  .gallery-lightbox__close { width: 38px; height: 38px; font-size: 1.3rem; }
}

/* ============================================================
   SITE MODAL — a generic centered overlay/dialog pair, for anything
   that needs a modal outside the cookie-consent flow (which
   deliberately keeps its own .cookie-modal, isolated per principle 9
   so it drops into any template unchanged). First use: basket.html's
   "Log In / Create Account / Continue as Guest" checkout modal. Same
   open/close mechanics as .cookie-modal — toggle .is-open on both the
   overlay and the dialog.
   ============================================================ */
.site-modal-overlay,
.site-modal {
  position: fixed;
  z-index: 600;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
}
.site-modal-overlay {
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.site-modal {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%);
  width: 90%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  padding: var(--space-lg);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: var(--radius);
}
.site-modal-overlay.is-open,
.site-modal.is-open {
  opacity: 1;
  visibility: visible;
}
.site-modal.is-open {
  transform: translate(-50%, -50%);
}
.site-modal__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
}
.site-modal__close:hover { color: var(--color-text); }
