/*
 * Product + Checkout extended styles — trampolineholes2026
 * Loaded only on is_product() and is_checkout() pages, after main.css.
 * Uses the same design tokens (--brand-*, --text, --border, etc.) as main.css.
 */

/* ============================================================
   Shared helpers
   ============================================================ */

.th-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 700;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease,
              transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.18s ease;
  text-decoration: none !important;
}

.th-btn--primary,
a.th-btn--primary {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff !important;
}

.th-btn--primary:hover,
a.th-btn--primary:hover {
  background: var(--brand-700);
  border-color: var(--brand-700);
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(178, 42, 37, 0.28);
}

.th-btn--ghost,
a.th-btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text) !important;
}

.th-btn--ghost:hover,
a.th-btn--ghost:hover {
  border-color: var(--brand-600);
  color: var(--brand-600) !important;
  transform: translateY(-1px);
}

/* ============================================================
   Product page — top layout (gallery + buy box)
   ============================================================ */

.th-product {
  /* reset WC default padding */
  padding-top: 0;
}

/* Grid item containment — without min-width:0 a grid child can grow
   past its track, causing the gallery to overflow the layout. */
.th-product__gallery,
.th-product__buy {
  min-width: 0;
}

/* Gallery spacing — breathing room above and between the two columns */
.th-product__gallery {
  padding-top: 0.5rem;
}

.th-product__gallery .woocommerce-product-gallery {
  width: 100%;
  max-width: 100%;
  overflow: hidden; /* belt-and-suspenders clip */
}

/* ── FlexSlider base styles (stripped with WC default styles) ──────────
   WC's woocommerce.css normally supplies these; since we blank it out we
   must restore the critical layout rules or the slider overflows. */
.th-single-gallery .slides,
/* Reset pager dots and direction nav but NOT flex-control-thumbs
   (thumbs need their own margin-top for the gap below the main image) */
.th-single-gallery .flex-control-paging,
.th-single-gallery .flex-direction-nav {
  margin: 0;
  padding: 0;
  list-style: none;
}
.th-single-gallery .flex-control-thumbs {
  list-style: none;
  padding: 0;
}

.th-single-gallery .flex-viewport {
  overflow: hidden;
  position: relative;
}

.th-single-gallery .slides > li {
  display: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.th-single-gallery .slides > li:first-child {
  display: block;
}

/* Main image: fill width, reasonable max height, no distortion */
.th-single-gallery .woocommerce-product-gallery__image img {
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: cover;
  display: block;
}

/* ── Eyebrow ── */
.th-product__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-600);
  margin: 0 0 0.75rem;
}

.th-product__eyebrow a {
  color: inherit;
  text-decoration: none;
}

.th-product__eyebrow-sep {
  opacity: 0.4;
}

/* ── Title ── */
.th-product__title {
  font-size: clamp(1.45rem, 3.5vw, 2rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  margin: 0 0 0.75rem;
}

/* ── Rating row ── */
.th-product__rating {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.th-product__rating .star-rating {
  font-size: 0.85rem;
  color: #f59e0b;
}

.th-product__rating-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
}

.th-product__rating-meta:hover {
  color: var(--brand-600);
  text-decoration: underline;
}

/* ── Price row ── */
.th-product__price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
}

.th-product__price {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.th-product__price .woocommerce-Price-amount {
  color: var(--text);
}

.th-product__price ins {
  text-decoration: none;
  color: var(--text);
}

.th-product__price del {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0.7;
}

.th-product__save {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  background: #dcfce7;
  color: #166534;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

.th-product__price-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.th-product__price-sub i {
  color: var(--logo-cyan-500, #06b6d4);
  font-size: 0.8rem;
}

/* ── Add-to-cart wrapper ── */
.th-product__addtocart {
  margin-bottom: 1rem;
}

.th-product__addtocart .single_add_to_cart_button {
  width: 100%;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  font-size: 1.05rem;
}

/* ── Feature bullets ── */
.th-product__bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.th-product__bullets li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}

.th-product__bullets li i {
  color: var(--brand-600);
  font-size: 0.75rem;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

/* ── After summary (related, upsells) ── */
.th-product__after {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Reviews wrapper ── */
.th-product__reviews .woocommerce-Reviews-title {
  display: none; /* our section heading replaces it */
}

/* ============================================================
   Trust pills row
   ============================================================ */

.th-trust-row {
  list-style: none;
  padding: 0;
  margin: 0;
}

.th-trust-row li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
  padding: 0.6rem 0.4rem;
  background: var(--surface-muted, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  line-height: 1.3;
}

.th-trust-row li i {
  font-size: 1rem;
  color: var(--brand-600);
}

/* ============================================================
   Install path picker (inline choice — not a WC option)
   ============================================================ */

.th-install-picker {
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 0.9rem;
  padding: 0.75rem;
  margin: 0 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.th-install-picker__legend {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
  margin-bottom: 0.35rem;
  float: none;
  width: 100%;
}

.th-install-picker__opt {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.6rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.th-install-picker__opt:has(input:checked) {
  background: #fef2f2;
  border-color: var(--brand-600);
}

.th-install-picker__opt input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.th-install-picker__bullet {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 9999px;
  border: 2px solid var(--border, #e2e8f0);
  transition: border-color 0.15s ease, background 0.15s ease;
  position: relative;
}

.th-install-picker__bullet::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 9999px;
  background: var(--brand-600);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.th-install-picker__opt:has(input:checked) .th-install-picker__bullet {
  border-color: var(--brand-600);
}

.th-install-picker__opt:has(input:checked) .th-install-picker__bullet::after {
  opacity: 1;
}

.th-install-picker__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.th-install-picker__body strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.th-install-picker__body small {
  font-size: 0.76rem;
  color: var(--text-muted, #64748b);
  line-height: 1.4;
}

.th-install-picker__price {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

.th-install-picker__opt:has(input:checked) .th-install-picker__price {
  color: var(--brand-600);
}

/* Phone link shown on the Utah picker option instead of a price */
.th-install-picker__phone {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-600);
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}
.th-install-picker__phone:hover {
  color: var(--brand-700);
  text-decoration: underline;
}

/* Utah callout strip under the install cards */
.th-install-utah-callout {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  margin-top: 1.25rem;
  padding: 0.875rem 1.125rem;
  background: var(--logo-red-50, #fef2f2);
  border: 1px solid rgba(178, 42, 37, 0.15);
  border-radius: 0.75rem;
  font-size: 0.875rem;
  color: var(--brand-700, #92231f);
}

.th-install-utah-callout i:first-child {
  color: var(--brand-600);
  flex-shrink: 0;
}

.th-install-utah-callout span {
  font-weight: 600;
}

.th-install-utah-callout__sep {
  opacity: 0.4;
  font-weight: 400 !important;
}

.th-install-utah-callout__phone {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 800;
  color: var(--brand-600);
  text-decoration: none;
  margin-left: auto;
  white-space: nowrap;
}
.th-install-utah-callout__phone:hover {
  color: var(--brand-700);
  text-decoration: underline;
}

@media (max-width: 479px) {
  .th-install-utah-callout__phone {
    margin-left: 0;
    width: 100%;
  }
}

/* ============================================================
   Product page sections (specs, reviews, FAQ, box)
   ============================================================ */

.th-pp-section {
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--border, #e2e8f0);
}

.th-pp-section--alt {
  background: var(--surface-muted, #f8fafc);
}

.th-pp-section__head {
  margin-bottom: 1.75rem;
}

.th-pp-eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-600);
  margin-bottom: 0.4rem;
}

.th-pp-section__title {
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 800;
  color: var(--text);
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.th-pp-section__sub {
  font-size: 0.9rem;
  color: var(--text-muted, #64748b);
  margin: 0;
  line-height: 1.6;
}

/* ── Specs table ── */
.th-spec-table {
  column-gap: 2rem;
}

.th-spec-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border, #e2e8f0);
  align-items: baseline;
}

.th-spec-row:first-child {
  border-top: 1px solid var(--border, #e2e8f0);
}

.th-spec-row dt {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
}

.th-spec-row dd {
  font-size: 0.83rem;
  color: var(--text);
  margin: 0;
}

/* ── What's in the box ── */
.th-box-grid {
  list-style: none;
  padding: 0;
  margin: 0;
}

.th-box-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  padding: 1rem 0.75rem;
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.75rem;
}

.th-box-item__img {
  width: 2.5rem;
  height: 2.5rem;
  background: #fef2f2;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-600);
  font-size: 1rem;
}

.th-box-item__name {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.th-box-item__meta {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  line-height: 1.3;
}

/* ── FAQ accordion ── */
.th-faq__lede {
  font-size: 0.88rem;
  color: var(--text-muted, #64748b);
  line-height: 1.6;
  margin: 0.75rem 0 1.25rem;
}

.th-faq__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.th-faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.th-faq-item {
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.th-faq-item:first-child {
  border-top: 1px solid var(--border, #e2e8f0);
}

.th-faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  list-style: none;
  user-select: none;
}

.th-faq-item summary::-webkit-details-marker {
  display: none;
}

.th-faq-item__icon {
  flex-shrink: 0;
  color: var(--brand-600);
  font-size: 0.8rem;
  width: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.th-faq-item__icon .fa-minus {
  display: none;
}

.th-faq-item[open] .th-faq-item__icon .fa-plus {
  display: none;
}

.th-faq-item[open] .th-faq-item__icon .fa-minus {
  display: block;
}

.th-faq-item__body {
  padding: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--text-muted, #64748b);
  line-height: 1.7;
}

.th-faq-item__body p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   Sticky mobile Add-to-cart bar
   ============================================================ */

.th-sticky-atc {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: #fff;
  border-top: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.1);
  padding: 0.75rem 0;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

.th-sticky-atc.is-visible {
  transform: translateY(0);
}

.th-sticky-atc__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.th-sticky-atc__info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.th-sticky-atc__thumb {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.4rem;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-muted, #f8fafc);
}

.th-sticky-atc__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.th-sticky-atc__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.th-sticky-atc__name {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.th-sticky-atc__price {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--brand-600);
}

.th-sticky-atc .th-btn--primary {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Hide sticky bar on large screens (buy box stays in view) */
@media (min-width: 1024px) {
  .th-sticky-atc {
    display: none;
  }
}

/* ============================================================
   Reduced-motion overrides
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .th-btn,
  .th-sticky-atc,
  .th-install-picker__opt,
  .th-install-picker__bullet,
  .th-install-picker__bullet::after {
    transition: none !important;
    transform: none !important;
  }
}
