/* scitru-v3 product — PDP layout, sticky ATC, ingredient cards, benefits, usage,
   review summary, FAQ, cross-sell. Per ref3 product mockup. */

/* ---------- Breadcrumb ---------- */
.pdp-breadcrumb { background: var(--cream); padding: 14px 32px; font-size: 12.5px; color: var(--muted); }
.pdp-breadcrumb .woocommerce-breadcrumb { max-width: 1240px; margin: 0 auto; }
.pdp-breadcrumb a { color: var(--muted); }
.pdp-breadcrumb a:hover { color: var(--dark-green); }

/* ---------- PDP grid ---------- */
.pdp {
  padding: 56px 32px 20px; max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px;
}

/* Gallery: restyle WooCommerce's own gallery.
   min-width:0 is load-bearing: grid items default to min-width:auto, so
   without it this column stretches to the gallery image's intrinsic pixel
   width (whatever size it was uploaded at) instead of shrinking to the
   grid track — causing horizontal overflow on any viewport narrower than
   that image, which is exactly what broke mobile here. */
.pdp-gallery { min-width: 0; width: 100%; }
.pdp-gallery .woocommerce-product-gallery { position: relative; max-width: 100%; }
/* Do NOT cap the slide track's width. FlexSlider sets width:1200% inline and
   floats each slide so they form one horizontal filmstrip; a max-width here
   collapses that track to the visible width, the floats wrap into a vertical
   stack, and clicking any thumbnail slides sideways onto empty space instead
   of the next image. FlexSlider's own .flex-viewport does the clipping, so
   the rounded corners belong there. */
.pdp-gallery .flex-viewport { border-radius: var(--radius-lg); overflow: hidden; }
.pdp-gallery .woocommerce-product-gallery__wrapper { max-width: none; }
.pdp-gallery .woocommerce-product-gallery__image {
  background: radial-gradient(circle at 30% 20%, var(--mint-tint), #fafaf7 65%);
  border-radius: var(--radius-lg);
}
.pdp-gallery .woocommerce-product-gallery__image img { margin: 0 auto; }
.pdp-gallery .flex-control-thumbs { display: flex; gap: 12px; margin: 16px 0 0; padding: 0; list-style: none; }
.pdp-gallery .flex-control-thumbs li { width: 76px; }
.pdp-gallery .flex-control-thumbs img {
  border-radius: var(--radius-sm); border: 2px solid transparent; cursor: pointer;
  background: var(--steel-tint); transition: border-color 0.2s;
}
.pdp-gallery .flex-control-thumbs img.flex-active,
.pdp-gallery .flex-control-thumbs img:hover { border-color: var(--mint); }

/* Summary */
.pdp-info .cat { color: var(--steel); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.pdp-info h1 { font-size: 30px; line-height: 1.25; margin: 10px 0 12px; }
.rating-row { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.rating-row .star-rating { color: var(--mint); }
.rating-row .rcount { font-size: 13px; color: var(--muted); }

.price-row--pdp { font-size: 32px; margin-bottom: 8px; }
.price-row--pdp del { font-size: 16px; }
.save-tag { background: var(--mint-tint); color: var(--dark-green); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 100px; }

.shipping-note { font-size: 13px; color: var(--steel); margin-bottom: 24px; display: flex; align-items: center; gap: 6px; }
.desc { font-size: 14.5px; line-height: 1.7; color: #33403f; margin-bottom: 26px; }

.who-for { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.who-pill { background: var(--steel-tint); color: var(--steel); font-size: 12.5px; font-weight: 600; padding: 7px 14px; border-radius: 100px; }

/* WooCommerce ATC form → ref3 qty-row look */
.pdp-info form.cart { display: flex; gap: 14px; margin-bottom: 16px; align-items: stretch; flex-wrap: wrap; }
.pdp-info form.cart .quantity {
  display: flex; align-items: center;
  border: 1.5px solid var(--line); border-radius: 100px; overflow: hidden;
}
.pdp-info form.cart .quantity input.qty {
  width: 56px; height: 48px; text-align: center; border: none;
  font: inherit; font-weight: 600; -moz-appearance: textfield;
}
.pdp-info form.cart .quantity input.qty::-webkit-outer-spin-button,
.pdp-info form.cart .quantity input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pdp-info form.cart .single_add_to_cart_button {
  flex: 1; background: var(--mint); color: var(--dark-green);
  border: none; padding: 0 26px; border-radius: 100px;
  font-weight: 700; font-size: 15px; min-height: 48px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.pdp-info form.cart .single_add_to_cart_button:hover { transform: scale(1.02); box-shadow: 0 10px 24px rgba(116, 197, 161, 0.35); }

.trust-row { display: flex; gap: 22px; margin-top: 22px; flex-wrap: wrap; }
.trust-mini { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); font-weight: 500; }
.trust-mini .dot { width: 6px; height: 6px; }

/* ---------- Sticky ATC ---------- */
.sticky-atc {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--white); border-top: 1px solid var(--line);
  box-shadow: 0 -10px 30px rgba(5, 48, 55, 0.08);
  padding: 14px 32px; display: flex; align-items: center; justify-content: space-between;
  z-index: 70; transform: translateY(110%); transition: transform 0.35s var(--ease);
}
.sticky-atc.show { transform: translateY(0); }
.sticky-left { display: flex; align-items: center; gap: 14px; }
.sticky-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.sticky-left .name { font-size: 13.5px; font-weight: 600; color: var(--dark-green); }
.sticky-left .price { font-size: 13px; color: var(--muted); }
.sticky-atc .btn-primary { padding: 12px 26px; min-height: 44px; }

/* ---------- Ingredient cards (dark, photo flip-cards) ----------
   Front: real ingredient photo + name/dose tag. Back: description.
   Flips on hover (desktop) or a .is-flipped class toggle (touch, via
   main.js) — mirrors the production site's fx7k2 flip-card pattern,
   restyled to brand tokens instead of its plain black overlay. */
.ing-cards { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.ing-card { height: 240px; perspective: 1200px; cursor: pointer; }
.ing-card-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform 0.6s var(--ease);
  transform-style: preserve-3d; -webkit-transform-style: preserve-3d;
}
.ing-card:hover .ing-card-inner,
.ing-card:focus-visible .ing-card-inner,
.ing-card.is-flipped .ing-card-inner { transform: rotateY(180deg); }

.ing-card-front,
.ing-card-back {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.ing-card-front { background: rgba(255, 255, 255, 0.05); }
.ing-card-front img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.ing-card-front::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(5, 48, 55, 0.92) 100%);
}
.ing-card--no-photo .ing-card-front {
  display: flex; align-items: center; justify-content: center;
}
.ing-card--no-photo .ing-card-front::after { content: none; }
.ing-card--no-photo .mark {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--mint-tint); color: var(--dark-green);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 700; font-size: 14px;
}

.ing-card-tag {
  position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 1;
  /* Wraps rather than overflowing: on a two-up phone grid the name and the
     standardisation label cannot sit on one line, and without this the
     label ran past the card edge and collided with the name. */
  display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap;
}
.ing-card-toggle {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1; transition: background 0.2s, border-color 0.2s;
}
.ing-card:hover .ing-card-toggle { background: var(--mint); border-color: var(--mint); color: var(--dark-green); }
.ing-card-name { color: var(--white); font-family: var(--font-head); font-weight: 700; font-size: 14px; }
.ing-card-tag .pct { color: var(--mint); font-size: 11px; font-weight: 600; margin-left: auto; }

.ing-card-back {
  background: var(--dark-green); padding: 20px;
  display: flex; flex-direction: column; justify-content: space-between;
  transform: rotateY(180deg);
}
.ing-card-back p { color: rgba(255, 255, 255, 0.7); font-size: 12.5px; line-height: 1.6; margin: 0; }

/* Touch devices get no flip at all. There is no hover to drive it, a tap
   leaves the card stuck in :hover, and Safari renders both faces at once
   (backface culling fails on a face that also clips with overflow:hidden),
   which showed the front's label mirrored through the back. Stacking the
   photo above the description shows the same content with no 3D involved. */
@media (hover: none) {
  .ing-card { height: auto; perspective: none; cursor: default; }
  .ing-card-inner { transform: none !important; transform-style: flat; -webkit-transform-style: flat; }
  .ing-card-front,
  .ing-card-back {
    position: relative; inset: auto;
    backface-visibility: visible; -webkit-backface-visibility: visible;
    transform: none !important;
  }
  .ing-card-front { height: 150px; border-radius: var(--radius-md) var(--radius-md) 0 0; }
  /* Narrow cards: give the label its own line under the name. */
  .ing-card-tag .pct { margin-left: 0; flex-basis: 100%; }
  .ing-card-back {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border-top: 0; gap: 10px;
  }
  .ing-card-toggle { display: none; }
  /* The back repeats the name for the flipped state; stacked directly under
     the front that already shows it, it is both redundant and absolutely
     positioned, so it printed on top of the description. */
  .ing-card-back .ing-card-tag { display: none; }
}

/* ---------- Benefits (image + text rows, alternating sides) ---------- */
.benefit-rows { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 64px; }
.benefit-row {
  display: grid; grid-template-columns: 0.7fr 1fr; gap: 48px; align-items: center;
}
.benefit-row--reverse { grid-template-columns: 1fr 0.7fr; }
.benefit-row--reverse .benefit-visual { order: 2; }
.benefit-row--reverse .benefit-content { order: 1; }
.benefit-visual {
  aspect-ratio: 1 / 1; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-rest);
  background: linear-gradient(160deg, var(--steel-tint), #fff);
  display: flex; align-items: center; justify-content: center;
}
.benefit-visual img { width: 100%; height: 100%; object-fit: cover; }
.benefit-num { font-family: var(--font-head); font-weight: 700; font-size: 40px; color: var(--mint); }
.benefit-content h3 { font-size: 22px; margin-bottom: 8px; }
.benefit-content .combo { font-size: 13px; color: var(--steel); font-weight: 600; margin-bottom: 10px; display: block; }
.benefit-content p { font-size: 14.5px; color: var(--muted); line-height: 1.65; margin: 0; }

/* ---------- Usage (image + text row, photo replaces icon cards) ---------- */
.usage { background: var(--cream); }
.usage-row {
  max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: 0.85fr 1fr; gap: 56px; align-items: center;
}
.usage-visual {
  border-radius: var(--radius-lg); overflow: hidden;
  aspect-ratio: 4 / 5; box-shadow: var(--shadow-rest);
}
.usage-visual img { width: 100%; height: 100%; object-fit: cover; }
.usage-content h2 { font-size: 32px; margin: 10px 0 30px; }
.usage-detail { border-top: 1px solid var(--line); padding: 20px 0; }
.usage-detail:first-of-type { border-top: none; padding-top: 0; }
.usage-detail h3 { font-size: 15px; margin-bottom: 6px; }
.usage-detail p { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 0; }

/* ---------- Review summary ---------- */
.review-summary {
  max-width: 1240px; margin: 0 auto 48px;
  display: grid; grid-template-columns: 0.6fr 1.4fr; gap: 48px; align-items: center;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 40px; box-shadow: var(--shadow-rest);
}
.rs-score { text-align: center; border-right: 1px solid var(--line); padding-right: 40px; }
.rs-score .big { font-family: var(--font-head); font-weight: 700; font-size: 52px; color: var(--dark-green); }
.rs-score .star-rating { margin: 0 auto; color: var(--mint); }
.rs-count { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.rs-bars { display: flex; flex-direction: column; gap: 8px; }
.rs-bar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.rs-bar-track { flex: 1; height: 6px; background: var(--steel-tint); border-radius: 100px; overflow: hidden; }
.rs-bar-fill { height: 100%; background: var(--mint); border-radius: 100px; }

.review-list { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.review-card { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 24px; }
.review-card .star-rating { color: var(--mint); margin-bottom: 10px; }
.review-card p { font-size: 13.5px; color: #33403f; line-height: 1.6; margin: 0 0 14px; }
.review-meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.review-meta .name { font-weight: 600; color: var(--dark-green); }
.verified-chip { background: var(--mint-tint); color: var(--dark-green); font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 100px; }
.write-review {
  color: var(--mint); font-weight: 600; font-size: inherit; font-family: inherit;
  background: none; border: none; padding: 0; cursor: pointer;
}
.review-verify-note { font-size: 11.5px !important; color: var(--muted); margin: 10px 0 0 !important; }

/* ---------- Write-a-review form (WooCommerce's native comment_form()) ---------- */
.review-form-wrap {
  max-width: 640px; margin: 32px auto 0; padding: 32px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-rest);
}
.review-form-error {
  background: #fdecea; border: 1px solid #f4c7c3; color: #a5362a;
  border-radius: var(--radius-sm); padding: 14px 16px; font-size: 13px; line-height: 1.5;
  margin: 0 0 20px;
}
.review-form-wrap #reply-title,
.review-form-wrap .comment-reply-title {
  font-family: var(--font-head); font-size: 20px; color: var(--dark-green); margin-bottom: 20px; display: block;
}
.review-form-wrap .comment-form-rating,
.review-form-wrap .comment-form-author,
.review-form-wrap .comment-form-email,
.review-form-wrap .comment-form-comment {
  display: block; margin-bottom: 18px;
}
.review-form-wrap label {
  display: block; font-family: var(--font-head); font-weight: 700;
  font-size: 13px; color: var(--dark-green); margin-bottom: 8px;
}
.review-form-wrap .required { color: var(--steel); }
.review-form-wrap input[type="text"],
.review-form-wrap input[type="email"],
.review-form-wrap select,
.review-form-wrap textarea {
  width: 100%; font-family: var(--font-body); font-size: 14px; color: var(--black);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 16px; background: var(--white);
}
.review-form-wrap textarea { resize: vertical; min-height: 110px; }
.review-form-wrap input:focus,
.review-form-wrap select:focus,
.review-form-wrap textarea:focus {
  outline: none; border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-tint);
}
/* WooCommerce's own #respond input#submit rule (two ID selectors) outranks
   a single-ID override, so this needs !important — same fight as the
   MetForm submit button on the Contact page. */
.review-form-wrap #respond input#submit,
.review-form-wrap #submit {
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  background: var(--dark-green) !important; color: var(--white) !important;
  border: none !important; padding: 14px 30px !important; border-radius: 100px !important;
  font-family: var(--font-body) !important; font-weight: 600 !important; font-size: 14px !important; min-height: 48px !important;
  transition: background 0.2s, transform 0.2s var(--ease);
}
.review-form-wrap #respond input#submit:hover,
.review-form-wrap #submit:hover { background: #0a4550 !important; transform: scale(1.02); }

/* ---------- FAQ ---------- */
.faq { max-width: 840px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  width: 100%; text-align: left; background: none; border: none;
  font-weight: 600; color: var(--dark-green); font-size: 15px; font-family: var(--font-body);
  padding: 20px 0; min-height: 44px;
}
.faq-mark { transition: transform 0.2s var(--ease); }
.faq-item.open .faq-mark { transform: rotate(45deg); }
.faq-a { font-size: 13.5px; color: var(--muted); line-height: 1.65; max-width: 680px; display: none; padding-bottom: 20px; }
.faq-item.open .faq-a { display: block; }

/* ---------- Cross-sell ---------- */
.xsell { background: var(--cream); }
.xsell-grid { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.xcard {
  display: block; background: var(--white); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-rest);
  transition: transform 0.25s var(--ease);
}
.xcard:hover { transform: translateY(-5px); }
.xcard-media { height: 170px; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--steel-tint), #fff); }
.xcard-img { max-height: 130px; width: auto; }
.xcard-body { padding: 20px; }
.xcard-body h3 { font-size: 14.5px; margin-bottom: 8px; }
.xcard-body .price { font-family: var(--font-head); font-weight: 700; color: var(--dark-green); font-size: 16px; }
.xcard-body .price del { font-family: var(--font-body); font-weight: 400; font-size: 12px; color: #9aa5a4; }
.xcard-body .price ins { text-decoration: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .pdp { grid-template-columns: 1fr; gap: 32px; padding: 32px 20px; }
  .ing-cards { grid-template-columns: repeat(2, 1fr); }
  .review-list, .xsell-grid { grid-template-columns: 1fr; }
  .benefit-rows { gap: 40px; }
  .benefit-row,
  .benefit-row--reverse { grid-template-columns: 1fr; gap: 20px; }
  .benefit-row--reverse .benefit-visual { order: initial; }
  .benefit-row--reverse .benefit-content { order: initial; }
  .benefit-visual { max-width: 280px; }
  .usage-row { grid-template-columns: 1fr; gap: 28px; }
  .usage-visual { aspect-ratio: 16 / 10; }
  .review-summary { grid-template-columns: 1fr; gap: 24px; }
  .rs-score { border-right: none; border-bottom: 1px solid var(--line); padding-right: 0; padding-bottom: 24px; }
  .sticky-atc { padding: 12px 20px; }
}
