/* ============================================================
   Design tokens — colors, type, spacing.
   Values below were measured directly from partzilla.com's live
   computed styles (see partzilla-design-system.md for the full
   writeup), then applied to our own brand/content. Two identity
   rules run through the whole file:
     1. Square corners everywhere — no border-radius on cards,
        buttons, inputs, or images. No box-shadows either.
     2. Oswald for headings/nav/buttons/prices' labels, Inter for
        body copy and the price figures themselves. Both are free
        Google Fonts, loaded in includes/header.php.
   ============================================================ */
:root {
  --ink: #222222;        /* headings, product prices, emphasis text */
  --muted: #666666;       /* secondary/meta text */
  --line: #e0e0e0;        /* the one border color used sitewide */
  --accent: #c3161c;      /* primary red — buttons, nav bar, links, active states */
  --accent-dark: #a01115; /* hover/active shade of the red */
  --accent-ink: #ffffff;
  --bg: #ffffff;
  --card: #ffffff;
  --danger: #b3261e;
  --danger-bg: #fbeceb;
  --success: #16a34a;     /* promo ribbon badges */
  --success-2: #29c30f;   /* "SAVE x%" savings text */
  --success-bg: #e8f3ec;
  --font-display: "Oswald", "Oswald Fallback", sans-serif;
  --font-body: "Inter", "Inter Fallback", sans-serif;
}

* { box-sizing: border-box; }

/* Visually hidden but still readable by screen readers — for a label whose
   text would be redundant on-screen next to a self-explanatory field. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* A visible keyboard-focus ring on every interactive element, sitewide.
   Component-specific rules elsewhere in this file (search box, hero dots,
   buttons) override this with a variant tuned to their own background —
   this is the baseline so nothing is ever left with no visible focus state
   at all. :focus-visible (not :focus) so it only shows for keyboard/AT
   users, not every mouse click. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: #000000;
  background: var(--bg);
  line-height: 1.5;
}

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 768px) {
  .wrap { padding: 0 2rem; }
}

a { color: var(--accent); }

/* --- Header: utility bar (black) + category nav (red) --- */
.site-header { background: #000; }

.utility-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 64px;
  color: #fff;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  text-decoration: none;
  color: #fff;
  white-space: nowrap;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
}
/* Admin-uploaded logo (admin/content.php → Branding), shown in place of
   the text wordmark above when one has been set. object-fit keeps it from
   stretching regardless of the source image's own aspect ratio. */
.brand-logo-img { height: 36px; max-width: 220px; width: auto; object-fit: contain; display: block; }
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  align-items: center;
  flex-direction: column;
  gap: 0.2rem;
  cursor: pointer;
  padding: 0;
}
.menu-toggle svg { display: block; }

.header-search {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  max-width: 560px;
  background: #fff;
  height: 36px;
}
.header-search input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  display: inline-block;
  margin-top: 0;
  border: none;
  border-radius: 0;
  padding: 0 0.8rem;
  font-size: 0.95rem;
  max-width: none;
  font-family: var(--font-body);
}
/* A real focus ring, inset so it doesn't get clipped by the header's
   overflow — this field used to remove its outline with nothing standing
   in for it, which made keyboard focus invisible here. */
.header-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.header-search button {
  background: #000;
  color: #fff;
  border: none;
  border-radius: 0;
  padding: 0 0.9rem;
  display: flex;
  align-items: center;
}

/* --- Search typeahead (assets/search-autocomplete.js) --- */
.search-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 40;
  max-height: 70vh;
  overflow-y: auto;
}
.search-suggestion {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.8rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--line);
}
.search-suggestion:last-child { border-bottom: none; }
.search-suggestion:hover, .search-suggestion.is-active { background: #f7f7f7; }
.search-suggestion img, .search-suggestion-noimg {
  width: 36px; height: 36px; object-fit: contain; background: #f2f2f2; flex: 0 0 auto;
}
.search-suggestion-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.search-suggestion-name { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-suggestion-sku { font-size: 0.78rem; color: var(--muted); }
.search-suggestion-price { font-size: 0.9rem; font-weight: 600; white-space: nowrap; }

.header-nav { display: flex; align-items: center; gap: 1.5rem; white-space: nowrap; }
.header-nav a {
  text-decoration: none;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
}
.header-nav .cart-link { display: flex; align-items: center; gap: 0.4rem; }

/* "Order Help" flyout — matches partzilla.com's utility-bar dropdown:
   a white panel under a text trigger in the black bar. Toggled by
   assets/nav-dropdown.js adding/removing .is-open on [data-dropdown]. */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  padding: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.nav-dropdown-toggle svg { transition: transform 0.15s ease; }
.nav-dropdown.is-open .nav-dropdown-toggle svg { transform: rotate(180deg); }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 20px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 60;
  flex-direction: column;
  padding: 0.4rem 0;
}
.nav-dropdown.is-open .nav-dropdown-menu { display: flex; }
.nav-dropdown-menu a {
  display: block;
  padding: 0.65rem 1.1rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}
.nav-dropdown-menu a:hover { background: var(--card); color: var(--accent); }

/* "Shop All" mega-menu — same toggle mechanics as the Order Help flyout
   above (assets/nav-dropdown.js adds/removes .is-open on [data-dropdown]),
   but a wide multi-column panel instead of a short link list, so a shopper
   can jump straight to a specific part from the header without an extra
   page load. */
.nav-mega-menu {
  display: none;
  position: absolute;
  top: calc(100% + 20px);
  left: 0;
  width: min(820px, 90vw);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 60;
  padding: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.25rem;
}
.nav-mega-dropdown.is-open .nav-mega-menu { display: grid; }
.nav-mega-all-link {
  grid-column: 1 / -1;
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.75rem;
}
.nav-mega-column { min-width: 0; }
.nav-mega-heading {
  display: block;
  color: #000;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.nav-mega-heading:hover { color: var(--accent); }
.nav-mega-column ul { list-style: none; margin: 0; padding: 0; }
.nav-mega-column li { margin-bottom: 0.5rem; }
.nav-mega-column a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
}
.nav-mega-column a:hover { color: var(--accent); }

.category-bar { background: var(--accent); }
.category-bar-inner {
  display: flex;
  gap: 1.75rem;
  overflow-x: auto;
  padding: 0.65rem 0;
}
.category-bar-inner a {
  color: #fff;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}
.category-bar-inner a.active, .category-bar-inner a:hover { text-decoration: underline; }

/* Mobile drawer: full-screen grouped links, toggled by mobile-menu.js
   adding/removing .is-open on <body>. Markup lives in includes/header.php. */
.mobile-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #fff;
  overflow-y: auto;
}
body.is-menu-open .mobile-drawer { display: block; }
body.is-menu-open { overflow: hidden; }
.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 1rem;
  background: #000;
}
.mobile-drawer-close {
  background: none;
  border: none;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  padding: 0;
}
.mobile-drawer-body { padding: 1.5rem 1rem 3rem; }
.mobile-drawer-group { margin-bottom: 2rem; }
.mobile-drawer-group h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #000;
  margin: 0 0 0.75rem;
}
.mobile-drawer-group ul { list-style: none; margin: 0; padding: 0; }
.mobile-drawer-group li { margin-bottom: 0.85rem; }
.mobile-drawer-group a {
  color: var(--accent);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
}

@media (max-width: 1023px) {
  .category-bar { display: none; }
  .menu-toggle { display: flex; }
  .header-nav .nav-dropdown { display: none; }
}
@media (min-width: 1024px) {
  .mobile-drawer { display: none !important; }
}
@media (max-width: 640px) {
  .utility-bar { flex-wrap: wrap; height: auto; padding: 0.75rem 0; row-gap: 0.75rem; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; }
}

main.wrap { padding-top: 2rem; padding-bottom: 4rem; min-height: 60vh; }

/* --- Footer --- */
.site-footer { background: var(--card); }

/* Tier 1: contact strip — brand blurb (left) + direct-reach details
   (right). Partzilla runs a similar band above its footer link columns. */
.footer-contact-strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.5rem 0;
}
.footer-contact-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
}
.footer-contact-grid h4 {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  text-transform: uppercase;
  color: #000;
}
.footer-contact-grid p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.footer-contact-grid a { color: var(--accent); font-weight: 600; text-decoration: none; }
.footer-contact-reach { text-align: right; }
.footer-contact-reach-label {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.8rem;
  color: #000 !important;
  font-weight: 600;
  margin-bottom: 0.2rem !important;
}
.footer-contact-reach .link-button { font-size: 0.85rem; margin-top: 0.3rem; display: inline-block; }

/* Tier 1b: newsletter signup band, between the contact strip and the link
   columns. */
.footer-newsletter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}
.footer-newsletter h4 { margin: 0 0 0.25rem; font-family: var(--font-display); font-size: 0.95rem; text-transform: uppercase; color: #000; }
.footer-newsletter p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.footer-newsletter-form { display: flex; gap: 0.6rem; }
.footer-newsletter-form input[type="email"] {
  min-width: 220px;
  border: 1px solid var(--line);
  padding: 0.55rem 0.75rem;
  font-family: var(--font-body);
}
@media (max-width: 640px) {
  .footer-newsletter { grid-template-columns: 1fr; text-align: center; }
  .footer-newsletter-form { flex-direction: column; }
  .footer-newsletter-form input[type="email"] { min-width: 0; }
}

/* Tier 2: the columned utility-link menu — "Shop / Customer Service / My
   Account / Company / Legal", matching a multi-column commerce footer. */
.footer-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.75rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
}
.footer-menu-col h5 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 700;
  color: #000;
  margin: 0 0 0.9rem;
}
.footer-menu-col ul { list-style: none; margin: 0; padding: 0; }
.footer-menu-col li { margin-bottom: 0.6rem; }
.footer-menu-col a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
}
.footer-menu-col a:hover { color: var(--accent); }

/* Tier 3: social icons row. */
.footer-social-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}
.footer-social-label {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--muted);
}
.footer-social-icons { display: flex; gap: 0.75rem; }
.footer-social-icons a {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  color: #000;
}
.footer-social-icons a:hover { color: var(--accent); border-color: var(--accent); }

/* Tier 4: copyright bar. */
.footer-bottom {
  padding: 1.25rem 0 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.footer-bottom .brand { color: #000; font-size: 1rem; display: block; margin-bottom: 0.5rem; }

@media (max-width: 640px) {
  .footer-contact-grid { grid-template-columns: 1fr; text-align: center; }
  .footer-contact-reach { text-align: center; }
  .footer-menu { grid-template-columns: repeat(2, 1fr); text-align: left; }
  .footer-social-row { flex-direction: column; gap: 0.6rem; }
}

/* --- Homepage: hero slider ---
   Vanilla CSS + JS carousel (assets/hero-slider.js) — no image files
   required; each slide is a gradient panel with an inline SVG icon, so
   there's nothing to source or license. Swap a slide's background for a
   real photo later by adding a `background-image` rule to its
   `.hero-slide--x` class and dropping the text/icon opacity down. */
.hero-slider {
  position: relative;
  margin: 0 0 2.5rem;
  overflow: hidden;
}
.hero-slide {
  display: none;
  position: relative;
  min-height: 230px;
  padding: 3rem 2.5rem;
  color: #fff;
}
.hero-slide.is-active { display: block; }
.hero-slide--a { background: linear-gradient(115deg, var(--accent) 0%, var(--accent) 45%, #7c0e12 46%, #7c0e12 100%); }
.hero-slide--b { background: linear-gradient(115deg, #2d2d2d 0%, #2d2d2d 45%, #000 46%, #000 100%); }
.hero-slide--c { background: linear-gradient(115deg, #4f4a2d 0%, #4f4a2d 45%, #2d2a1a 46%, #2d2a1a 100%); }
.hero-slide-text { position: relative; z-index: 1; }
.hero-eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0.9;
  margin: 0 0 0.5rem;
}
.hero-slide h1 { font-family: var(--font-display); text-transform: uppercase; font-size: 2.1rem; max-width: 22ch; margin: 0 0 0.75rem; }
.hero-slide p { font-family: var(--font-body); max-width: 46ch; margin: 0 0 1.25rem; opacity: 0.95; }
.hero-slide .button { background: #fff; color: #000; }
.hero-slide-icon {
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.22;
  pointer-events: none;
}
.hero-slide-icon svg { display: block; width: 140px; height: 140px; }
.hero-dots {
  position: absolute;
  z-index: 2;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}
.hero-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  border: none;
  padding: 0;
  cursor: pointer;
}
.hero-dot.is-active { background: #fff; }
.hero-dot:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 640px) {
  .hero-slide { padding: 2rem 1.25rem; min-height: 260px; }
  .hero-slide h1 { font-size: 1.6rem; }
  .hero-slide-icon { display: none; }
}

/* --- Homepage: quick-link category cards --- */
.quicklinks { margin-bottom: 2.5rem; }
.quicklinks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.quicklink-card {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1.1rem;
}
.quicklink-card h3 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1rem;
  text-transform: uppercase;
  color: #000;
}
.quicklink-thumbs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.quicklink-thumbs a {
  display: block;
  width: 56px;
  height: 56px;
  overflow: hidden;
  background: #f2f2f2;
}
.quicklink-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.quicklink-more { font-size: 0.85rem; font-weight: 700; text-decoration: none; }

/* --- Homepage: how-it-works steps --- */
.how-it-works { margin-bottom: 2.5rem; }
.how-it-works h2 {
  margin-bottom: 1rem;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1.25rem;
  color: #000;
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.step { padding: 0.25rem 0; }
.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.step h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* --- Homepage: value props band --- */
.value-props {
  background: #000;
  color: #fff;
  margin: 0 0 2.5rem;
  padding: 2rem 0;
}
.value-props-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  padding: 0 2rem;
}
.value-prop { text-align: left; }
.value-prop svg { color: var(--accent); margin-bottom: 0.6rem; }
.value-prop h3 { margin: 0 0 0.35rem; font-family: var(--font-display); text-transform: uppercase; font-size: 0.95rem; }
.value-prop p { margin: 0; font-size: 0.85rem; color: #ccc; }

/* --- Homepage: shipping banner --- */
.shipping-banner {
  background: var(--accent);
  color: #fff;
  text-align: center;
  padding: 1rem 1rem;
  margin-bottom: 2.5rem;
}
.shipping-banner p { margin: 0; font-family: var(--font-display); text-transform: uppercase; font-weight: 700; font-size: 1.05rem; }

.newest-parts { margin-top: 0; }
.newest-parts h2, section > h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1.25rem;
  color: #000;
}

.button, button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 0;
  padding: 0.65rem 1.75rem;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1rem;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
}
.button:hover, button:hover { background: var(--accent-dark); }

.button-outline {
  background: transparent;
  color: #000;
  border: 1px solid var(--line);
}
.button-outline:hover { background: #f7f7f7; }

.link-button {
  background: none;
  border: none;
  color: var(--accent);
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.9rem;
  font-family: var(--font-body);
  text-transform: none;
}
.link-button:hover { background: none; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
}
@media (min-width: 768px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 0.5rem 0.5rem 1rem;
  text-decoration: none;
  color: #000;
}

.product-image-wrap {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f2f2f2;
  margin-bottom: 0.75rem;
}
.product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.product-image-wrap.large { max-width: 420px; }

/* --- Product photo gallery (product.php, assets/product-gallery.js) --- */
.product-image-wrap[data-gallery-main-wrap] { position: relative; max-width: 420px; }
.gallery-zoom-btn {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--line);
  color: #000;
  cursor: pointer;
}
.gallery-zoom-btn:hover { background: #f2f2f2; }
.product-gallery-thumbs { display: flex; flex-wrap: wrap; gap: 0.6rem; max-width: 420px; }
.gallery-thumb {
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  background: #f2f2f2;
  cursor: pointer;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gallery-thumb.is-active { border-color: var(--accent); }
.gallery-thumb:hover { border-color: var(--line); }
.gallery-thumb.is-active:hover { border-color: var(--accent); }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #fff;
  color: #fff;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.15); }

.product-name { font-weight: 600; margin-bottom: 0.3rem; color: var(--accent); }
.product-meta { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; }
.product-price { margin-top: 0.5rem; font-family: var(--font-body); font-weight: 700; font-size: 1.35rem; color: var(--ink); }
.product-price.large { font-size: 1.6rem; }

.badge.out-of-stock {
  display: inline-block;
  margin-top: 0.5rem;
  color: var(--danger);
  font-size: 0.85rem;
}

.filters {
  display: flex;
  gap: 0.6rem;
  margin: 1rem 0 1.5rem;
  flex-wrap: wrap;
}
.filters input, .filters select {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0;
  font-family: var(--font-body);
}

/* --- Product listing page: sidebar filters + toolbar + pagination ---
   256px sidebar matches the measured Partzilla spec. Filters are plain
   <details>/<summary> so they work with zero JS, and each option is a
   whole-row <a> (not a checkbox input) that rebuilds the query string via
   tfp_filter_url()/tfp_toggle_*_url() in includes/functions.php. */
.listing-layout {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  gap: 2rem;
  margin-top: 1rem;
  align-items: start;
}

.filter-sidebar {
  border: 1px solid var(--line);
}
.filter-sidebar-title {
  margin: 0;
  padding: 0.9rem 1rem;
  background: #000;
  color: #fff;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.95rem;
  font-weight: 700;
}

.filter-section {
  border-bottom: 1px solid var(--line);
}
.filter-section:last-child { border-bottom: none; }
.filter-section summary {
  cursor: pointer;
  list-style: none;
  padding: 0.85rem 1rem;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 700;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.filter-section summary::-webkit-details-marker { display: none; }
.filter-section summary::after {
  content: "\2212"; /* minus, open state */
  font-family: var(--font-body);
  color: var(--muted);
  font-weight: 400;
}
.filter-section:not([open]) summary::after { content: "+"; }

.filter-checklist {
  list-style: none;
  margin: 0;
  padding: 0 0 0.75rem;
}
.filter-check {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  text-decoration: none;
  color: #000;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}
.filter-check:hover { background: #f7f7f7; }
.filter-check.is-checked {
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
  background: #fbeceb;
}
.filter-count {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
}
.filter-check.is-checked .filter-count { color: var(--accent); }

.listing-main { min-width: 0; }

.listing-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.9rem;
  margin-bottom: 0.25rem;
}
.listing-count { margin: 0; color: var(--muted); font-size: 0.9rem; }

.sort-form { display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.sort-form label {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--muted);
}
.sort-form select {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.product-price-was {
  display: inline-block;
  margin-left: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
  text-decoration: line-through;
}
.product-price-save {
  display: block;
  margin-top: 0.2rem;
  color: var(--success-2);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 2rem 0 1rem;
}
.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.6rem;
  border: 1px solid var(--line);
  color: #000;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
}
.pagination a:hover { background: #f7f7f7; }
.pagination a.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

@media (max-width: 900px) {
  .listing-layout { grid-template-columns: 1fr; }
  .filter-sidebar { margin-bottom: 1rem; }
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 2.5rem;
  margin-top: 1rem;
  align-items: start;
}
@media (max-width: 640px) {
  .product-detail { grid-template-columns: 1fr; }
}
.breadcrumb { color: var(--muted); font-size: 0.9rem; margin-top: 1rem; }
.breadcrumb a { color: var(--muted); }

/* Section heading for pages that don't build their own hero/product-style
   h1 (cart, checkout, order confirmation, account order detail) — keeps
   them on the same Oswald-caps identity as the rest of the site instead of
   falling back to the browser's default bold serif-y h1. */
.page-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0.5rem 0 1rem;
}

/* --- Order Help pages: /order-status.php, /help.php, /contact.php --- */
.support-page { max-width: 760px; margin: 0 auto 3rem; }
.support-lookup-form, .support-contact-form { max-width: 560px; margin-bottom: 2rem; }
.support-divider { border: none; border-top: 1px solid var(--line); margin: 2rem 0; }
.support-page-footnote { margin-top: 2rem; }
.cms-page-body { color: var(--ink); line-height: 1.7; }
.admin-form-hint-inline { color: var(--muted); font-size: 0.8rem; font-weight: 400; text-transform: none; }

/* Jump links at the top of the Help & Info hub — mirrors a help-center
   page's category chips, letting a long page act like several short ones. */
.support-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin: 1.25rem 0 2rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
}
.support-toc a {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent);
  white-space: nowrap;
}
.support-toc a:hover { text-decoration: underline; }

.support-faq-item { margin-bottom: 1.75rem; scroll-margin-top: 1.5rem; }
.support-faq-item .section-subtitle { margin-bottom: 0.4rem; }
.support-faq-item p { margin: 0; color: var(--ink); }

.support-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0 2rem;
}
.support-contact-card {
  border: 1px solid var(--line);
  padding: 1.25rem;
}
.support-contact-card-label {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.85rem;
  margin: 0 0 0.4rem;
}
.support-contact-card p { margin: 0; }

.qty-stepper.qty-stepper-compact {
  width: fit-content;
}
.qty-stepper-compact input[type="number"] { width: 2.6rem; padding: 0.35rem 0.2rem; }
.qty-stepper-compact .qty-btn { width: 1.9rem; font-size: 1rem; }

/* --- Product detail page (product.php) ---------------------------------
   Brand line + price block + stock status + qty stepper follow the same
   measured-from-Partzilla conventions as the listing cards (square
   corners, Oswald caps for labels, Inter for body/price figures). */
.product-info h1 { margin: 0.15rem 0 0.4rem; font-size: 1.6rem; }
.product-brand {
  margin: 0;
  color: var(--accent);
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.product-info .product-meta { margin-bottom: 0; }

.product-price-block {
  margin: 0.9rem 0;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.product-price-block .product-price.large { margin-top: 0; }

.badge-kit {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.2rem 0.55rem;
  background: #000;
  color: #fff;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 700;
}

.stock-status {
  margin: 0 0 1rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
}
.stock-status.stock-in { color: var(--success); }
.stock-status.stock-discontinued { color: var(--muted); }
/* Low stock gets a filled urgency pill (not just colored text) — the kind
   of "almost gone" signal that actually catches the eye while scanning a
   page, same visual weight as the SAVE% badge next to it. */
.stock-status.stock-low {
  display: inline-block;
  color: #fff;
  background: #b45309;
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.add-to-cart-form {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.add-to-cart-form label {
  margin-bottom: 0;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--muted);
}
.qty-stepper {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  width: fit-content;
  margin-top: 0.35rem;
}
.qty-stepper input[type="number"] {
  width: 3.2rem;
  border: none;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
  -moz-appearance: textfield;
  padding: 0.5rem 0.3rem;
  font-family: var(--font-body);
  font-size: 1rem;
}
.qty-stepper input[type="number"]::-webkit-outer-spin-button,
.qty-stepper input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.qty-btn {
  background: #fff;
  color: #000;
  border: none;
  width: 2.4rem;
  font-size: 1.1rem;
  font-family: var(--font-body);
  cursor: pointer;
}
.qty-btn:hover { background: #f2f2f2; }

.product-description { margin: 1.5rem 0; }
.product-description h2,
.related-products h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1.1rem;
  margin: 0 0 0.6rem;
}
.product-description p { margin: 0; line-height: 1.6; }

.spec-table {
  width: 100%;
  max-width: 480px;
  border-collapse: collapse;
  margin: 1.5rem 0;
}
.spec-table th, .spec-table td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  font-weight: 400;
}
.spec-table th {
  width: 45%;
  color: var(--muted);
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
}

.related-products { margin: 2.5rem 0; }
.recently-viewed { margin: 2.5rem 0; }
.saved-for-later { margin: 2rem 0; }
.saved-for-later-card { display: flex; flex-direction: column; }
.saved-for-later-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.5rem; padding: 0 0.5rem; }
.saved-for-later-actions form { margin: 0; }

form label {
  display: block;
  margin-bottom: 1rem;
  font-weight: 600;
}
form input[type="text"], form input[type="email"], form input[type="number"], form textarea {
  display: block;
  width: 100%;
  max-width: 420px;
  margin-top: 0.35rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0;
  font-size: 1rem;
  font-weight: normal;
  font-family: var(--font-body);
}

.cart-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.cart-table th, .cart-table td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--line);
}
.cart-table th { font-family: var(--font-display); text-transform: uppercase; font-size: 0.8rem; color: var(--muted); }
.cart-thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: #f2f2f2;
  display: block;
}
.cart-table .part-cell { display: flex; align-items: center; gap: 0.75rem; }

.cart-summary { max-width: 320px; margin-top: 1rem; border: 1px solid var(--line); padding: 1rem 1.25rem; }
.cart-summary .total { font-weight: 700; font-size: 1.15rem; }
.cart-summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  font-family: var(--font-body);
}
.cart-summary-row.total {
  margin-top: 0.4rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-weight: 700;
  font-size: 1.2rem;
}
.cart-summary .button { display: block; width: 100%; text-align: center; margin-top: 0.75rem; }

.checkout-summary { margin-bottom: 1.5rem; }
.checkout-delivery-estimate { margin: 0.75rem 0 0; font-size: 0.9rem; }
.checkout-trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 0 0 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.checkout-trust-badges span { display: inline-flex; align-items: center; gap: 0.4rem; }
.checkout-trust-badges svg { flex: 0 0 auto; color: var(--success); }
.checkout-form { max-width: 480px; }

.section-subtitle {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1.05rem;
  margin: 2rem 0 0.6rem;
}

.payment-methods {
  border: 1px solid var(--line);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  max-width: 480px;
}
.payment-methods h2 {
  margin-top: 0;
  font-size: 1.05rem;
  font-family: var(--font-display);
  text-transform: uppercase;
}
#stripe-payment-element { margin-bottom: 1rem; }

.flash {
  background: var(--success-bg);
  border: 1px solid var(--success);
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
}
.flash.success { font-weight: 600; }

.form-error {
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
}

/* --- Header: account link (utility bar) --- */
.nav-account { display: flex; align-items: center; gap: 0.35rem; }

/* --- Customer account area (/account/*) --- */
.account-auth {
  max-width: 420px;
  margin: 1rem 0 3rem;
}
.account-auth-sub { color: var(--muted); font-size: 0.9rem; margin-top: -0.5rem; }
.account-auth-switch { margin-top: 1.5rem; font-size: 0.9rem; }

.account-form label {
  display: block;
  margin-bottom: 1rem;
  font-weight: 600;
}
.account-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}
@media (max-width: 480px) {
  .account-form-row { grid-template-columns: 1fr; }
}
.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400 !important;
}
.checkbox-label input { width: auto; margin: 0; }

.account-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 2.5rem;
  margin-top: 1rem;
}
@media (max-width: 800px) {
  .account-layout { grid-template-columns: 1fr; }
}

.account-nav {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  height: fit-content;
}
.account-nav a {
  padding: 0.8rem 1rem;
  color: #000;
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.account-nav a:last-child { border-bottom: none; }
.account-nav a.active {
  color: var(--accent);
  font-weight: 700;
  border-left: 3px solid var(--accent);
  padding-left: calc(1rem - 3px);
  background: #fbeceb;
}
@media (max-width: 800px) {
  .account-nav { flex-direction: row; flex-wrap: wrap; }
  .account-nav a { border-bottom: none; border-right: 1px solid var(--line); }
}

.account-main h1 { margin-top: 0; }
.account-intro { color: var(--muted); }

.account-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.account-card {
  border: 1px solid var(--line);
  padding: 1.1rem;
}
.account-card h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.9rem;
  color: #000;
}
.account-order-list { list-style: none; margin: 0 0 0.75rem; padding: 0; }
.account-order-list li { margin-bottom: 0.6rem; font-size: 0.9rem; }
.account-order-list a { font-weight: 700; text-decoration: none; }
.account-order-meta { display: block; color: var(--muted); font-size: 0.8rem; }
.account-address { font-size: 0.9rem; }
.account-address-phone { color: var(--muted); font-size: 0.85rem; margin: 0; }

.account-orders-table td, .account-orders-table th { font-size: 0.9rem; }
.account-order-summary-line { color: var(--muted); font-size: 0.9rem; }

.status-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  border: 1px solid var(--line);
}
.status-pending_payment { color: #92620a; border-color: #92620a; background: #fdf3e3; }
.status-paid, .status-delivered { color: var(--success); border-color: var(--success); background: var(--success-bg); }
.status-failed, .status-cancelled { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }
.status-refunded { color: var(--muted); border-color: var(--line); background: #f2f2f2; }
.status-unfulfilled { color: var(--muted); border-color: var(--line); background: #f2f2f2; }
.status-shipped { color: #1d4ed8; border-color: #1d4ed8; background: #e6edfd; }
.status-new { color: var(--accent); border-color: var(--accent); background: #fbe6e7; }
.status-read { color: var(--muted); border-color: var(--line); background: #f2f2f2; }

.address-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.address-card {
  position: relative;
  border: 1px solid var(--line);
  padding: 1rem;
  font-size: 0.9rem;
}
.address-card.is-default { border-color: var(--accent); }
.address-default-badge {
  position: absolute;
  top: -1px;
  right: -1px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
}
.address-label { font-weight: 700; margin: 0 0 0.3rem; }
.address-card-actions {
  display: flex;
  gap: 0.9rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.address-card-actions form { margin: 0; }
.address-card-actions .link-button { font-size: 0.85rem; }

.checkout-guest-note {
  background: #f7f7f7;
  border: 1px solid var(--line);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* --- Coupon form (cart.php) --- */
.coupon-form { display: flex; align-items: flex-end; gap: 0.75rem; flex-wrap: wrap; margin: 1.25rem 0; max-width: 420px; }
.coupon-form label { font-weight: 600; }
.coupon-form input[type="text"] { display: block; margin-top: 0.25rem; }

/* --- Order actions (account/order.php) --- */
.account-order-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* --- Star ratings (product.php) --- */
.review-stars { color: var(--accent); letter-spacing: 0.1em; }
.review-summary { display: flex; align-items: center; gap: 0.6rem; margin: 0.5rem 0 1.25rem; }
.review-summary .review-count { color: var(--muted); font-size: 0.9rem; }
.review-card { border-top: 1px solid var(--line); padding: 1rem 0; }
.review-card-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.3rem; }
.review-card-author { font-weight: 700; }
.review-card-date { color: var(--muted); font-size: 0.85rem; }
.review-card-title { font-weight: 600; margin: 0.2rem 0; }
.product-card-rating { color: var(--muted); font-size: 0.82rem; margin-top: 0.15rem; }

/* --- Wishlist --- */
.wishlist-button { margin-top: 0.75rem; }
