/* Design tokens (--stp-ink, --stp-yellow, --stp-line, …) are defined once in
 * stp-core/assets/css/stp-core.css, which loads on every page. */

/* ---- Persistent dark header ----
 * The Blocksy transparent header was disabled and the middle/bottom header
 * rows set to brand black (#0D0E10) in the customizer, so the dark header now
 * shows on every page. Menu links, cart/account icons, and the mobile
 * hamburger all inherit --theme-text-color; flip it to white on those rows. */
header.ct-header [data-row*="middle"],
header.ct-header [data-row*="bottom"] {
  --theme-text-color: #fff;
  --theme-link-initial-color: #fff;
  --theme-headings-color: #fff;
  --theme-icon-color: #fff; /* hamburger/cart/account SVGs fall back to black without this */
}
/* <button> doesn't inherit color (UA default is black) — set it outright. */
header.ct-header .ct-header-trigger { color: #fff; }

/* The search field is a white pill on the dark row — keep its text/placeholder
 * dark (the row-level white --theme-text-color would cascade in otherwise). */
header.ct-header .ct-search-box,
header.ct-header .ct-search-box input {
  --theme-text-color: #111827;
  color: #111827;
}

/* (The old mobile header-search margin compaction is gone: the search item
 * left the header entirely — it lives in the garage bar now.) */

/* The Greenshift dark hero rows carried 150-250px top padding to sit behind
 * the old transparent header overlay. The header is in-flow now: cap the
 * padding, and hide the row entirely where it has no content (homepage —
 * there it was purely the backdrop for the overlay). */
#gspb_row-id-gsbp-96b5086 { padding-top: 36px !important; padding-bottom: 30px !important; }
#gspb_row-id-gsbp-96b5086:not(:has(h1, h2, h3, .gspb_heading, p, form, img)) { display: none !important; }
/* The same block (content block 838) is also injected via a Blocksy hook after
 * the header (e.g. on /parts-for/ pages). Its only contents are the hidden
 * hero row plus an empty autop <p>, which left a ~24px white band above the
 * garage bar — the block was purely the old transparent-header backdrop, so
 * hide the hook copy outright. */
[data-block="hook:838"] { display: none !important; }

/* ---- Garage bar ---- */
.stp-garage-bar {
  background: var(--stp-charcoal); color: #f9fafb; font-size: 14px;
  border-bottom: 1px solid #26282c;
}
.stp-garage-inner {
  /* 1290+32 matches the hero band's container so the bar's contents line up
   * with the hero text edge (and the header container, home-hero.css). */
  max-width: 1290px; margin: 0 auto; padding: 8px 32px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* Product search, hosted in the bar (moved out of the Blocksy header).
 * Wide enough for a full YMM+part query ("2015 Chevrolet Silverado
 * Transmission"); plain GET /?s=…&post_type=product, same as before. */
.stp-bar-search {
  display: flex; align-items: center; margin-left: auto;
  flex: 0 1 460px; min-width: 300px;
  background: #fff; border-radius: var(--stp-rc); overflow: hidden;
}
.stp-bar-search input[type="search"] {
  flex: 1; min-width: 0; height: 40px; border: 0; background: transparent;
  padding: 0 4px 0 14px; font-size: 14.5px; color: var(--stp-ink);
}
.stp-bar-search input[type="search"]:focus-visible {
  outline: 2px solid var(--stp-yellow); outline-offset: -2px;
}
.stp-bar-search button {
  flex: none; width: 42px; height: 40px; border: 0; background: transparent;
  color: #4b5563; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
/* Blocksy gives submit buttons min-height 55px + 5px 25px padding, which made the open search 55px tall. */
.stp-garage-bar .stp-bar-search button { min-height: 0; padding: 0; }
.stp-bar-search button:hover { color: var(--stp-ink); }
.stp-bar-search button:focus-visible { outline: 2px solid var(--stp-yellow); outline-offset: -2px; }
/* Label and action buttons flow together on the left (no pushed-right actions). */
.stp-garage-label { display: inline-flex; align-items: center; gap: 8px; }
.stp-garage-label strong { color: var(--stp-yellow); }
.stp-gl-short { display: none; }
.stp-bar-search-toggle {
  display: none; flex: none; align-items: center; justify-content: center; width: 38px; height: 34px; padding: 0;
  background: transparent; color: #f9fafb; border: 1px solid #3a3c41; border-radius: var(--stp-rc); cursor: pointer;
}
.stp-bar-search-toggle:hover, .stp-garage-bar.is-search-open .stp-bar-search-toggle { background: #2a2e37; border-color: #6b6e74; }
.stp-bar-search-toggle:focus-visible { outline: 2px solid var(--stp-yellow); outline-offset: 2px; }
/* Tablet + desktop (Matt, 2026-10-01): the search is behind the magnifying-glass button here too and
 * opens inline, left of the button; the cart (Blocksy's header cart, moved in by stp-garage.js) sits
 * at the far right from 1000px. Button and cart are 40px tall like the search, so opening it doesn't
 * change the row height. */
@media (min-width: 783px) {
  .stp-bar-search { display: none; order: 8; }
  .stp-garage-bar.is-search-open .stp-bar-search { display: flex; }
  .stp-bar-search-toggle { display: inline-flex; order: 9; margin-left: auto; width: 40px; height: 40px; }
  .stp-garage-bar.is-search-open .stp-bar-search-toggle { margin-left: 0; }
  .stp-garage-bar--slim .stp-garage-inner { justify-content: flex-end; }
  /* No border here (Matt, 2026-10-01): a plain icon like the cart; hover/open keep the dark fill. */
  .stp-bar-search-toggle,
  .stp-bar-search-toggle:hover, .stp-garage-bar.is-search-open .stp-bar-search-toggle { border-color: transparent; }
}
/* Desktop: the icons line up under the header's phone/status block instead of running past it
 * (Matt, 2026-10-01). The header container is min(90vw, 1290px) + 32px padding, so its right content
 * edge sits 5vw + 32px in from the window below 1433px; the bar's (1290px max, centered) right padding
 * follows it, and the cart's margin pulls its icon (centered in a 40px box) back to the status text's
 * edge (the header block has an 8px margin, the text ~4px more). */
@media (min-width: 1000px) {
  .stp-garage-inner { padding-right: max(32px, calc(32px + 5vw - max(0px, (100vw - 1290px) / 2))); }
  .stp-bar-cart { margin-right: 12px; }
}
/* Hidden while still in the header (before the script moves it), so the top row doesn't jump. */
#header [data-device="desktop"] [data-id="cart"] { display: none; }
.stp-bar-cart { order: 10; flex: none; display: flex; align-items: center; margin-left: 4px; }
.stp-bar-cart .ct-cart-item {
  position: relative; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  color: #f9fafb; border-radius: var(--stp-rc);
}
.stp-bar-cart .ct-cart-item:hover { background: #2a2e37; color: #fff; }
.stp-bar-cart .ct-cart-item:focus-visible { outline: 2px solid var(--stp-yellow); outline-offset: 2px; }
.stp-bar-cart .ct-icon-container { position: relative; display: flex; }
/* Blocksy sets the cart's --theme-icon-color with [data-header*="type-1"] [data-id="cart"] .ct-cart-item
 * (still matches out here, gray on white); one more class beats it. */
body .stp-garage-bar .stp-bar-cart .ct-cart-item { --theme-icon-color: #f9fafb; --theme-icon-hover-color: #fff; }
.stp-bar-cart svg { width: 20px; height: 20px; }
.stp-bar-cart .ct-dynamic-count-cart {
  position: absolute; top: -8px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--stp-yellow); color: var(--stp-ink); font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
}
.stp-bar-cart .ct-dynamic-count-cart[data-count="0"] { display: none; }
/* Phones/tablets use the mobile header's cart, and the slim bar (search + cart only) is desktop-only. */
@media (max-width: 999.98px) {
  .stp-bar-cart, .stp-garage-bar--slim { display: none; }
}
.stp-garage-icon { flex: none; display: block; }
.stp-garage-action {
  background: transparent; color: #f9fafb; border: 1px solid #3a3c41;
  border-radius: var(--stp-rc); padding: 6px 12px; font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none; line-height: 1.4;
}
.stp-garage-action:hover { background: #2a2e37; }
.stp-garage-action:focus-visible { outline: 2px solid var(--stp-yellow); outline-offset: 2px; }
.stp-garage-primary { background: var(--stp-yellow); color: var(--stp-ink); border-color: var(--stp-yellow); }
.stp-garage-primary:hover { background: var(--stp-yellow-dark); }
.stp-garage-ghost { opacity: .75; }

/* ---- Finder (shop, shortcode + modal) ---- */
.stp-finder {
  background: #fff; border: 1px solid var(--stp-line);
  border-radius: var(--stp-r); padding: 20px;
  box-shadow: var(--stp-shadow);
}
.stp-finder-head { margin-bottom: 14px; }
.stp-finder-title {
  font-size: 18px; font-weight: 700; color: var(--stp-ink); line-height: 1.25;
  letter-spacing: -.01em;
}
.stp-finder-sub { margin-top: 3px; font-size: 13.5px; color: var(--stp-muted); }

.stp-finder-row {
  display: grid; gap: 10px;
  grid-template-columns: minmax(96px, .7fr) 1fr 1.2fr auto;
  align-items: stretch;
}
.stp-finder-field { position: relative; display: block; min-width: 0; }
.stp-finder-field::after {
  /* chevron */
  content: ""; position: absolute; right: 14px; top: 50%; width: 9px; height: 9px;
  border-right: 2px solid #4b5563; border-bottom: 2px solid #4b5563;
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.stp-finder-row select {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 44px; min-height: 44px; padding: 0 34px 0 12px;
  border: 1px solid var(--stp-line-2); border-radius: var(--stp-rc);
  font-size: 16px; font-weight: 500; background: #fff; color: var(--stp-ink);
  cursor: pointer;
}
.stp-finder-row select:hover:not(:disabled) { border-color: var(--stp-ink-3); }
.stp-finder-row select:focus-visible {
  outline: 2px solid var(--stp-ink); outline-offset: 1px; border-color: var(--stp-ink);
}
.stp-finder-row select:disabled {
  background: var(--stp-wash); color: #a3a5a9; cursor: not-allowed; font-weight: 500;
}
.stp-finder-field:has(select:disabled)::after { border-color: #c3c8d0; }
.stp-finder-btn {
  height: 44px; min-height: 44px; padding: 0 20px;
  background: var(--stp-yellow); color: var(--stp-ink);
  border: 0; border-radius: var(--stp-rc); font-size: 15px; font-weight: 700; cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease;
}
.stp-finder-btn:disabled { background: #e5e7eb; color: #9ca3af; cursor: not-allowed; }
.stp-finder-btn:not(:disabled):hover { background: var(--stp-yellow-dark); }
.stp-finder-btn:focus-visible { outline: 2px solid var(--stp-ink); outline-offset: 2px; }

/* Free-text "Other…" inputs share the select chrome, minus the chevron. */
.stp-finder-row input.stp-finder-text {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 44px; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--stp-line-2); border-radius: var(--stp-rc);
  font-size: 16px; font-weight: 500; background: #fff; color: var(--stp-ink);
}
.stp-finder-row input.stp-finder-text:focus-visible {
  outline: 2px solid var(--stp-ink); outline-offset: 1px; border-color: var(--stp-ink);
}
.stp-finder-field.is-text::after { display: none; }

/* ---- No-match / request-a-part panel ---- */
.stp-finder-nomatch {
  margin-top: 14px; padding: 14px 16px; border-radius: 10px;
  background: #fffbeb; border: 1px solid #fde68a; color: #713f12; font-size: 14.5px;
}
.stp-finder-nomatch-msg { line-height: 1.5; }
.stp-finder-nomatch-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.stp-finder-request {
  display: inline-block; background: var(--stp-ink); color: #fff;
  border-radius: var(--stp-rc); padding: 10px 18px; font-weight: 700; font-size: 15px; text-decoration: none;
}
.stp-finder-request:hover, .stp-finder-request:visited { background: #26282c; color: #fff; }
.stp-finder-call {
  display: inline-block; background: var(--stp-yellow); color: var(--stp-ink);
  border-radius: var(--stp-rc); padding: 10px 18px; font-weight: 700; font-size: 15px; text-decoration: none;
}
.stp-finder-call:hover, .stp-finder-call:visited { background: var(--stp-yellow-dark); color: var(--stp-ink); }

/* Request-a-part (mail) and call (phone) icons on every no-results button:
   the find-part box, the finder's no-match panel, vehicle + search results pages.
   Mask + currentColor, so the icon matches each button's text color. */
.stp-fp-request::before, .stp-finder-request::before, .stp-vp-reqbtn::before,
.stp-fp-call::before, .stp-finder-call::before, .stp-vp-callbtn::before {
  content: ""; display: inline-block; width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px;
  background: currentColor; -webkit-mask: var(--stp-ico) center / contain no-repeat; mask: var(--stp-ico) center / contain no-repeat;
}
.stp-fp-request, .stp-finder-request, .stp-vp-reqbtn {
  --stp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E");
}
.stp-fp-call, .stp-finder-call, .stp-vp-callbtn {
  --stp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4h4l2 5-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2'/%3E%3C/svg%3E");
}

/* ---- Modal ---- */
.stp-modal {
  position: fixed; inset: 0; background: rgba(17,24,39,.6); z-index: 99999;
  display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px;
}
.stp-modal.is-open { display: flex; }
.stp-modal-box {
  position: relative; background: #fff; border-radius: 14px; padding: 24px;
  width: 100%; max-width: 460px; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.stp-modal-close {
  position: absolute; top: 10px; right: 12px; border: 0; background: transparent;
  font-size: 26px; line-height: 1; cursor: pointer; color: #6b7280;
}
.stp-modal-finder .stp-finder { border: 0; box-shadow: none; padding: 0; }
.stp-modal-finder .stp-finder-row { grid-template-columns: 1fr; }

/* ---- Fits badge ---- */
.stp-fits-badge {
  margin: 12px 0; padding: 10px 14px; border-radius: 8px; font-size: 15px; font-weight: 600;
}
.stp-fits-yes { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.stp-fits-no  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.stp-fits-badge strong { font-weight: 800; }

/* Pill overlaid on the product gallery — green fits / red doesn't-fit. */
.woocommerce-product-gallery { position: relative; }
#stp-fits-pill {
  position: absolute; top: 10px; left: 10px; z-index: 10;
  color: #fff; font-size: 13px; font-weight: 700;
  padding: 6px 12px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.25);
  pointer-events: none; max-width: calc(100% - 70px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#stp-fits-pill.stp-pill-yes { background: #16a34a; }
#stp-fits-pill.stp-pill-no  { background: #dc2626; }

/* Fits badge overlaid top-left on browse/shop product-card images. */
.stp-card-fit-badge {
  position: absolute; top: 8px; left: 8px; z-index: 5;
  font-size: 11.5px; font-weight: 700; line-height: 1;
  padding: 4px 9px; border-radius: 999px; pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  max-width: calc(100% - 16px); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.stp-card-fit-yes { background: #16a34a; color: #fff; }
.stp-card-fit-no  { background: #e5e7eb; color: #6b7280; } /* muted grey, non-alarming */

/* ---- Shop/homepage finder wrapper ---- */
.stp-shop-finder { max-width: 760px; margin: 4px auto 28px; }

/* ---- Mobile ---- */
@media (max-width: 782px) {

  .stp-garage-label { flex: 1 1 100%; margin-bottom: 4px; }
  /* No vehicle set: short label with "Set vehicle" beside it (Matt, 2026-09-30). */
  .stp-garage-inner--unset .stp-garage-label { flex: 1 1 0; min-width: 0; margin-bottom: 0; line-height: 1.3; }
  .stp-garage-inner--unset .stp-gl-long { display: none; }
  .stp-garage-inner--unset .stp-gl-short { display: inline; }
  .stp-garage-inner--unset .stp-garage-action { flex: none; }
  .stp-garage-inner { padding: 8px 16px 10px; }
  /* Search is hidden until the magnifying-glass button opens it, below the My Garage line
   * (Matt, 2026-10-01). */
  .stp-bar-search { display: none; flex: 1 1 100%; order: 9; margin: 8px 0 0; min-width: 0; }
  .stp-garage-bar.is-search-open .stp-bar-search { display: flex; }
  .stp-bar-search-toggle { display: inline-flex; }

  .stp-finder { padding: 16px; }
  .stp-finder-row { grid-template-columns: 1fr 1fr; }
  .stp-finder-field-model, .stp-finder-btn { grid-column: 1 / -1; }
  .stp-shop-finder { margin: 8px auto 24px; }
}

/* "Remove this vehicle" under the picker when a vehicle is saved */
.stp-modal-clear { display: block; margin: 14px auto 0; padding: 4px 2px; border: 0; background: none; font: inherit; font-size: 14px;
  font-weight: 600; color: var(--stp-ink-2, #3b4048); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.stp-modal-clear:hover { color: var(--stp-ink, #16181c); }
