/* =====================================================================
   Optibike | G2 Altus PDP Enhancement
   File: opx-pdp-enhance.css
   Scope: single product pages only (body.single-product)
   Theme: Blocksy 2.1.51 + WooCommerce + STAGGS configurator

   v2 - server-rendered. Markup now comes from inc/opx-pdp-render.php.

   CHANGES FROM v1:
   - Removed .opx-gallery-grid (the JS slider fallback is gone).
   - Removed .opx-affirm-empty (Affirm renders correctly; the "-" in the
     static capture was just its pre-init placeholder).
   - .opx-price-note is now a span appended to price_html, so it needs
     display:block and an explicit font-weight to escape p.price.
   - Added rules for the sticky bar's [hidden] builder button and for
     wp_get_attachment_image output classes.
   ===================================================================== */

:root {
  --opx-blue: #0657a2;
  --opx-blue-dark: #003f88;
  --opx-ink: #191a1b;
  --opx-gray: #5c6066;
  --opx-line: #e3e6e9;
  --opx-bg: #f5f6f8;
  --opx-radius: 14px;
}

/* ---------- layout: 50/50 gallery + sticky summary ---------- */
.single-product .product-entry-wrapper {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}
.single-product .summary.entry-summary { position: sticky; top: 96px; }

@media (max-width: 999px) {
  .single-product .product-entry-wrapper { grid-template-columns: 1fr; gap: 28px; }
  .single-product .summary.entry-summary { position: static; }
}

/* ---------- gallery ---------- */
.woocommerce-product-gallery { opacity: 1 !important; }
.woocommerce-product-gallery img { border-radius: var(--opx-radius); }

.single-product .woocommerce-product-gallery {
  width: 100% !important;
  max-width: none !important;
  float: none !important;
}
.single-product .woocommerce-product-gallery .flexy,
.single-product .woocommerce-product-gallery__wrapper,
.single-product .woocommerce-product-gallery__image,
.single-product .woocommerce-product-gallery__image a { width: 100% !important; }
.single-product .woocommerce-product-gallery__image img {
  width: 100% !important;
  height: auto !important;
}
/* Thumbnail strip: force a single row of 6, matching the mockup. The
   gap total is 5 gaps x 10px = 50px, divided across 6 columns. */
.single-product .flex-control-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 0 !important;
  padding: 0;
}
.single-product .flex-control-thumbs li {
  width: calc((100% - 50px) / 6) !important;
  float: none !important;
  margin: 0 !important;
}
.single-product .flex-control-thumbs img { width: 100%; border-radius: 8px; }
.single-product .summary.entry-summary {
  width: 100% !important;
  max-width: none !important;
  float: none !important;
}

/* ---------- title block ---------- */
.opx-kicker {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--opx-blue);
  margin: 0 0 6px;
}
.single-product h1.product_title {
  font-size: clamp(30px, 3.2vw, 42px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -.01em;
  margin: 0 0 4px;
  color: var(--opx-ink);
}
.opx-tagline { font-size: 16px; color: var(--opx-gray); margin: 2px 0 10px; }
.single-product .woocommerce-product-rating { margin: 0 0 14px; }

/* ---------- performance chips ---------- */
.opx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}
.opx-chips li {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 14px;
  border: 1px solid var(--opx-line);
  border-radius: 10px;
  background: var(--opx-bg);
}
.opx-chips b { font-size: 15px; font-weight: 800; color: var(--opx-ink); line-height: 1.1; }
.opx-chips span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--opx-gray);
}

/* ---------- price + financing ---------- */
.single-product .summary p.price {
  font-size: 34px;
  font-weight: 800;
  color: var(--opx-ink);
  margin: 2px 0 0;
}
.opx-price-note { display: block; font-size: 13px; font-weight: 400; color: var(--opx-gray); margin: 2px 0 8px; }
.single-product .summary .affirm-as-low-as {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--opx-blue-dark);
  background: #eef4fb;
  border: 1px solid #d4e2f2;
  border-radius: 10px;
  padding: 9px 14px;
  margin: 0 0 16px !important;
}
/* ---------- CTAs (scoped to the main buy box only) ---------- */
.ct-product-add-to-cart .quantity { display: none !important; }
.ct-product-add-to-cart form.cart { display: flex; flex-direction: column; gap: 10px; }
.ct-product-add-to-cart .single_add_to_cart_button {
  width: 100%;
  padding: 18px 24px !important;
  font-size: 17px !important;
  font-weight: 700;
  border-radius: 12px !important;
  background: var(--opx-blue) !important;
  border: none;
  box-shadow: 0 6px 18px rgba(6, 87, 162, .28);
  transition: transform .12s ease, box-shadow .12s ease;
}
.ct-product-add-to-cart .single_add_to_cart_button:hover {
  background: var(--opx-blue-dark) !important;
  transform: translateY(-1px);
}
.ct-product-add-to-cart a.staggs-configure-product-button {
  width: 100%;
  text-align: center;
  padding: 16px 24px !important;
  font-size: 16px !important;
  font-weight: 700;
  border-radius: 12px !important;
  background: #fff !important;
  color: var(--opx-blue-dark) !important;
  border: 2px solid var(--opx-blue-dark) !important;
  box-shadow: none;
}
.ct-product-add-to-cart a.staggs-configure-product-button:hover { background: #eef4fb !important; }
.opx-cta-caption { font-size: 12.5px; color: var(--opx-gray); text-align: center; margin: -2px 0 0; }

/* ---------- trust icons row ---------- */
.opx-trust {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.opx-trust li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 12px 12px 14px;
  border: 1px solid var(--opx-line);
  border-radius: 10px;
  background: #fff;
}
.opx-trust svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--opx-blue);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.opx-trust b { font-size: 12.5px; font-weight: 700; color: var(--opx-ink); line-height: 1.25; }
.opx-trust span { font-size: 11.5px; color: var(--opx-gray); line-height: 1.4; }
@media (max-width: 760px) { .opx-trust { grid-template-columns: 1fr 1fr; } }

/* ---------- build-time box ---------- */
.opx-buildbox {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--opx-bg);
  border: 1px solid var(--opx-line);
  border-radius: var(--opx-radius);
  padding: 14px 16px;
  margin: 16px 0 0;
}
.opx-buildbox svg { flex: none; margin-top: 2px; }
.opx-buildbox b { display: block; font-size: 14px; color: var(--opx-ink); }
.opx-buildbox span { font-size: 13px; color: var(--opx-gray); line-height: 1.45; }

/* ---------- existing "Why Optibike?" info block ---------- */
.ct-product-additional-info {
  border: 1px solid var(--opx-line);
  border-radius: var(--opx-radius);
  padding: 18px 20px;
  margin-top: 18px;
}
.ct-product-additional-info .ct-module-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--opx-ink);
}
.ct-product-additional-info ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin: 10px 0 0;
}
.ct-product-additional-info .ct-label { font-size: 13.5px; color: var(--opx-ink); }
.ct-product-additional-info svg { fill: var(--opx-blue); }
@media (max-width: 560px) { .ct-product-additional-info ul { grid-template-columns: 1fr; } }

/* Meta: stack each row (SKU / Categories / Tags / Brand) on its own line
   with a bold uppercase label. The label is a leading text node inside
   each span, so we bold the span and reset its value children (links and
   the .sku value) back to normal weight. */
.single-product .product_meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--opx-gray);
  opacity: 1;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.single-product .product_meta > span { font-weight: 700; color: var(--opx-ink); }
.single-product .product_meta > span a,
.single-product .product_meta .sku { font-weight: 400; }
.single-product .product_meta .sku { color: var(--opx-gray); }
.single-product .product_meta a { color: var(--opx-blue); }

/* ---------- short description ---------- */
.woocommerce-product-details__short-description {
  font-size: 15px;
  line-height: 1.6;
  color: #3a3e43;
  border-top: 1px solid var(--opx-line);
  margin-top: 20px;
  padding-top: 18px;
}

/* ---------- injected sections shell ---------- */
.opx-section { max-width: 1180px; margin: 64px auto; padding: 0 24px; }
.opx-section-h {
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--opx-ink);
  margin: 0 0 8px;
  text-wrap: pretty;
}
.opx-section-sub { font-size: 16px; color: var(--opx-gray); margin: 0 0 28px; max-width: 640px; }

/* ---------- story blocks ---------- */
.opx-story-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 30px;
  align-items: center;
  margin: 0 0 48px;
}
.opx-story-block:nth-child(even) { direction: rtl; }
.opx-story-block > * { direction: ltr; }
.opx-story-block img {
  width: 100%;
  border-radius: var(--opx-radius);
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.opx-story-block h3 {
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 800;
  color: var(--opx-ink);
  margin: 0 0 10px;
  letter-spacing: -.01em;
}
.opx-story-block p { font-size: 16px; line-height: 1.65; color: #3a3e43; margin: 0; }
.opx-story-stat {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--opx-blue);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
@media (max-width: 820px) {
  .opx-story-block { grid-template-columns: 1fr; gap: 16px; margin-bottom: 36px; }
}

/* ---------- comparison table ---------- */
.opx-compare-wrap { overflow-x: auto; border: 1px solid var(--opx-line); border-radius: var(--opx-radius); }
.opx-compare { width: 100%; border-collapse: collapse; min-width: 640px; }
.opx-compare th,
.opx-compare td { padding: 14px 18px; text-align: left; font-size: 14.5px; border-bottom: 1px solid var(--opx-line); }
.opx-compare tr:last-child td { border-bottom: none; }
.opx-compare thead th {
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--opx-gray);
  background: var(--opx-bg);
}
.opx-compare td:first-child { font-weight: 600; color: var(--opx-ink); width: 30%; }
.opx-compare .opx-col-altus { background: #eef4fb; font-weight: 700; color: var(--opx-blue-dark); }
.opx-compare thead .opx-col-altus { color: var(--opx-blue-dark); }

/* ---------- specs table restyle ---------- */
.woocommerce-product-attributes th {
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--opx-gray) !important;
}
.woocommerce-product-attributes td { font-size: 14.5px; color: var(--opx-ink); }

/* ---------- FAQ accordions ---------- */
.opx-faq details { border: 1px solid var(--opx-line); border-radius: 12px; margin: 0 0 10px; background: #fff; }
.opx-faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 18px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--opx-ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.opx-faq summary::-webkit-details-marker { display: none; }
.opx-faq summary::after { content: "+"; font-size: 20px; font-weight: 400; color: var(--opx-blue); flex: none; }
.opx-faq details[open] summary::after { content: "\2013"; }
.opx-faq details > p { padding: 0 18px 16px; margin: 0; font-size: 14.5px; line-height: 1.6; color: #3a3e43; }

/* ---------- newsletter (Hustle embed) ---------- */
/* Visual design (dark panel, gold button) comes from the Hustle module's
   own palette; this wrapper only handles page placement. */
.opx-newsletter { max-width: 1320px; margin: 0 auto 64px; padding: 0 24px; }

/* ---------- sticky purchase bar ---------- */
/* TEMP: hidden by default for the PageSense CRO test. The variation
   re-enables it with `.opx-sticky { display: block !important; }`.
   Remove this display:none once the test concludes. */
.opx-sticky { display: none; }
.opx-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: #fff;
  border-top: 1px solid var(--opx-line);
  box-shadow: 0 -8px 30px rgba(20, 25, 35, .12);
  padding: 10px 20px calc(10px + env(safe-area-inset-bottom));
  transform: translateY(110%);
  transition: transform .25s ease;
}
.opx-sticky.opx-on { transform: translateY(0); }
.opx-sticky-in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 16px; }
.opx-sticky img { width: 52px; height: 40px; object-fit: cover; border-radius: 8px; flex: none; }
.opx-sticky-name { min-width: 0; }
.opx-sticky-name b {
  display: block;
  font-size: 14.5px;
  color: var(--opx-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.opx-sticky-name span { font-size: 12.5px; color: var(--opx-gray); }
.opx-sticky-price { margin-left: auto; text-align: right; flex: none; }
.opx-sticky-price b { display: block; font-size: 18px; color: var(--opx-ink); }
.opx-sticky-price span { font-size: 11.5px; color: var(--opx-blue-dark); font-weight: 600; }
.opx-sticky-cta { flex: none; display: flex; gap: 8px; }
.opx-sticky-cta a,
.opx-sticky-cta button {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.opx-sticky-atc { background: var(--opx-blue); border: none; color: #fff; }
.opx-sticky-atc:hover { background: var(--opx-blue-dark); }
.opx-sticky-build { background: #fff; border: 2px solid var(--opx-blue-dark); color: var(--opx-blue-dark); }
.opx-sticky-cta [hidden] { display: none !important; }
/* price_html arrives wrapped in WooCommerce span/bdi markup */
.opx-sticky-price b .woocommerce-Price-amount { font-size: 18px; font-weight: 700; }
.opx-sticky-price b del { display: none; }

@media (max-width: 760px) {
  .opx-sticky img,
  .opx-sticky-name { display: none; }
  .opx-sticky-in { gap: 10px; }
  .opx-sticky-price { margin-left: 0; text-align: left; }
  .opx-sticky-cta { margin-left: auto; flex: 1; justify-content: flex-end; }
  .opx-sticky-cta .opx-sticky-atc { flex: 1; text-align: center; }
  .opx-sticky-build { display: none; }
}

/* mobile hit targets */
@media (max-width: 760px) {
  .ct-product-add-to-cart .single_add_to_cart_button,
  .ct-product-add-to-cart a.staggs-configure-product-button { min-height: 52px; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .opx-sticky,
  .ct-product-add-to-cart .single_add_to_cart_button { transition: none; }
}

.single-product section.related.products {
    padding-bottom: 100px;
	max-width: 1180px;
  	margin: 64px auto;
  	padding: 0 24px;
}

.single-product section.up-sells.products {
	max-width: 1180px;
  	padding: 0 24px;
    margin: 64px auto;
}