/* ============================================================
   birchivy — Product page (PDP)
   Styles layered on WooCommerce's native single-product classes.
   Loaded AFTER birchivy.css (tokens, header, footer, cart, .btn,
   .review, .card, .assure, .qty, .reveal all inherited from there).
   ============================================================ */

/* ---- Breadcrumb ---- */
.woocommerce-breadcrumb {
  max-width: var(--container); margin: 0 auto; padding: 22px 48px 0;
  font-size: 0.8rem; color: var(--muted); letter-spacing: 0.02em;
}
.woocommerce-breadcrumb a { color: var(--muted); transition: color .25s var(--ease); }
.woocommerce-breadcrumb a:hover { color: var(--accent-ink); }
.woocommerce-breadcrumb .sep { margin: 0 8px; opacity: 0.6; }

/* ---- Product layout (div.product) ---- */
div.product.pdp {
  max-width: var(--container); margin: 0 auto; padding: 30px 48px 0;
  display: grid; grid-template-columns: 1.06fr 0.94fr; gap: clamp(2rem, 4.5vw, 5rem);
  align-items: start;
}

/* ---- Gallery (.woocommerce-product-gallery) ---- */
.woocommerce-product-gallery { position: sticky; top: 92px; }
.pdp-gallery { display: grid; grid-template-columns: 76px 1fr; gap: 16px; }
.pdp-gallery__thumbs { display: flex; flex-direction: column; gap: 12px; }
.pdp-thumb {
  position: relative; padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--paper-2); aspect-ratio: 1; cursor: pointer;
  transition: border-color .3s var(--ease);
}
.pdp-thumb image-slot { width: 100%; height: 100%; pointer-events: none; }
.pdp-thumb.is-active { border-color: var(--ink); }
.pdp-thumb::after { content: ''; position: absolute; inset: 0; background: rgba(250,249,245,0.35); transition: opacity .3s; }
.pdp-thumb.is-active::after, .pdp-thumb:hover::after { opacity: 0; }

.woocommerce-product-gallery__wrapper { margin: 0; position: relative; }
.woocommerce-product-gallery__image {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--paper-2); aspect-ratio: 4 / 5;
}
.woocommerce-product-gallery__image image-slot { width: 100%; height: 100%; }
.onsale {
  position: absolute; top: 16px; left: 16px; z-index: 3; margin: 0; white-space: nowrap;
  background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 100px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.pdp-gallery__hint {
  position: absolute; bottom: 14px; right: 14px; z-index: 3;
  background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(4px);
  border-radius: 100px; padding: 7px 13px; font-size: 0.72rem; color: var(--ink-soft);
  display: flex; align-items: center; gap: 6px;
}
.pdp-gallery__hint svg { width: 14px; height: 14px; }

/* ---- Summary (.summary.entry-summary) ---- */
.summary.entry-summary { display: flex; flex-direction: column; }
.summary .eyebrow { margin-bottom: 0.9rem; }
/* Hide the native WooCommerce rating row — we show a compact version instead. */
.woocommerce-product-rating { display: none; }
.product_title.entry-title {
  font-family: var(--display); font-weight: 500; line-height: 1.02; letter-spacing: -0.015em;
  font-size: clamp(2.1rem, 3.6vw, 3rem); margin: 0 0 0.5rem;
}
.pdp-artist { font-size: 0.98rem; color: var(--muted); margin: 0 0 1rem; }
.pdp-artist b { font-family: var(--display); font-style: italic; font-weight: 500; color: var(--ink-soft); font-size: 1.15rem; }

.woocommerce-product-rating { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 1.4rem; }
.star-rating { color: var(--accent); letter-spacing: 1.5px; font-size: 0.95rem; }
.woocommerce-review-link { font-size: 0.86rem; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.woocommerce-review-link:hover { color: var(--accent-ink); }

/* price */
p.price { margin: 0 0 0.3rem; display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; }
p.price del { color: var(--muted); font-size: 1.2rem; text-decoration-thickness: 1px; }
p.price ins { text-decoration: none; }
p.price .amount { font-family: var(--display); font-size: 2.5rem; font-weight: 500; color: var(--ink); }
.pdp-save {
  background: var(--accent-tint); color: var(--accent-ink); font-size: 0.74rem; font-weight: 700;
  letter-spacing: 0.04em; padding: 5px 11px; border-radius: 100px; text-transform: uppercase; white-space: nowrap;
}

/* compact review summary under title */
.pdp-review-compact {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 1rem;
  text-decoration: none; transition: color .25s var(--ease);
}
.pdp-review-compact:hover { color: var(--accent-ink); }
.pdp-review-compact__stars { color: var(--accent); letter-spacing: 1.5px; font-size: 0.95rem; }
.pdp-review-compact__text strong { color: var(--ink); font-weight: 600; }

/* installments / BNPL */
.pdp-installments { font-size: 0.86rem; color: var(--ink-soft); margin: 0 0 1.5rem; }
.pdp-installments b { font-weight: 600; }
.pdp-installments .chip { display: inline-block; background: var(--paper-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 7px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; margin-left: 2px; }

.woocommerce-product-details__short-description { color: var(--ink-soft); font-size: 1.04rem; margin: 0 0 1.8rem; padding-bottom: 1.8rem; border-bottom: 1px solid var(--line); max-width: 46ch; }

/* ---- Variations form ---- */
.variations_form { display: flex; flex-direction: column; gap: 1.6rem; }
.variations { display: flex; flex-direction: column; gap: 1.6rem; margin: 0; }
.variation-row .label { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.7rem; }
.variation-row .label > span:first-child { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600; color: var(--ink); }
.variation-row .label .selected-val { font-size: 0.9rem; color: var(--muted); font-style: italic; font-family: var(--display); font-size: 1.05rem; }

/* size options */
.size-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.size-btn {
  text-align: left; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); cursor: pointer; transition: border-color .25s var(--ease), background .25s var(--ease);
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.size-btn:hover { border-color: var(--ink-soft); }
.size-btn.is-active { border-color: var(--ink); background: var(--paper-2); }
.size-btn .nm { font-weight: 600; font-size: 0.95rem; }
.size-btn .dim { font-size: 0.8rem; color: var(--muted); display: block; margin-top: 2px; }
.size-btn .pr { font-size: 0.86rem; color: var(--ink-soft); white-space: nowrap; }

/* frame swatches */
.frame-opts { display: flex; gap: 14px; flex-wrap: wrap; }
.frame-swatch { display: flex; flex-direction: column; align-items: center; gap: 7px; background: none; border: none; padding: 0; cursor: pointer; width: 64px; }
.frame-swatch .chip {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line);
  box-shadow: inset 0 0 0 4px var(--card), 0 0 0 1px transparent; transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
.frame-swatch.is-active .chip { box-shadow: inset 0 0 0 4px var(--card), 0 0 0 2px var(--ink); }
.frame-swatch:hover .chip { transform: translateY(-2px); }
.frame-swatch .nm { font-size: 0.74rem; color: var(--ink-soft); text-align: center; line-height: 1.2; }
.frame-swatch.is-active .nm { color: var(--ink); font-weight: 600; }

/* stock / urgency */
.pdp-urgency { display: flex; align-items: center; gap: 0.6rem; font-size: 0.86rem; color: var(--ink-soft); }
.pdp-urgency .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage) 28%, transparent); }
.pdp-urgency b { font-weight: 600; color: var(--ink); }

/* add to cart row */
.single_variation_wrap { display: flex; flex-direction: column; gap: 1rem; }
.woocommerce-variation-add-to-cart { display: flex; gap: 12px; align-items: stretch; }
.quantity { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 100px; padding: 0 6px; background: var(--card); }
.quantity button { width: 38px; height: 52px; background: none; border: none; color: var(--ink); font-size: 1.1rem; display: grid; place-items: center; }
.quantity button:hover { color: var(--accent); }
.quantity input.qty { width: 34px; height: 52px; text-align: center; border: none; background: none; font-family: inherit; font-size: 1rem; font-weight: 600; -moz-appearance: textfield; }
.quantity input.qty::-webkit-outer-spin-button, .quantity input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.single_add_to_cart_button {
  flex: 1; border: none; border-radius: 100px; background: var(--ink); color: var(--paper);
  font-size: 0.86rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 0.6em;
  transition: background .35s var(--ease), transform .35s var(--ease);
}
.single_add_to_cart_button:hover { background: var(--accent); transform: translateY(-2px); }
.single_add_to_cart_button.added { background: var(--sage); }
.pdp-buy-row { display: flex; gap: 12px; }
.pdp-wish-btn { width: 56px; flex: none; border: 1px solid var(--line); border-radius: 100px; background: var(--card); display: grid; place-items: center; color: var(--ink); transition: .25s var(--ease); }
.pdp-wish-btn:hover { border-color: var(--ink); color: var(--accent); }
.pdp-wish-btn svg { width: 20px; height: 20px; }
.pdp-wish-btn.is-wished { color: var(--accent); border-color: var(--accent); }

/* trust under CTA */
.pdp-trust { list-style: none; margin: 0.4rem 0 0; padding: 1.4rem 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem 1.4rem; }
.pdp-trust li { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.86rem; color: var(--ink-soft); }
.pdp-trust svg { width: 18px; height: 18px; color: var(--accent-ink); flex: none; margin-top: 1px; }
.pdp-trust b { color: var(--ink); font-weight: 600; }

.pdp-delivery { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.3rem; font-size: 0.9rem; color: var(--ink-soft); background: var(--tint-sage); border-radius: var(--radius); padding: 12px 16px; }
.pdp-delivery svg { width: 18px; height: 18px; color: var(--accent-ink); flex: none; }
.pdp-delivery b { color: var(--ink); font-weight: 600; }

/* product meta */
.product_meta { margin-top: 1.6rem; font-size: 0.82rem; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.product_meta a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }
.product_meta a:hover { color: var(--accent-ink); }

/* ---- Tabs (.woocommerce-tabs) ---- */
.woocommerce-tabs { max-width: var(--container); margin: clamp(4rem, 8vh, 6.5rem) auto 0; padding: 0 48px; }
.wc-tabs { display: flex; gap: 2rem; list-style: none; margin: 0 0 2.4rem; padding: 0 0 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.wc-tabs li a {
  display: block; padding: 0 0 16px; font-size: 0.84rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); position: relative; cursor: pointer; transition: color .25s var(--ease);
}
.wc-tabs li.active a, .wc-tabs li a:hover { color: var(--ink); }
.wc-tabs li a::after { content: ''; position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--accent); transition: width .3s var(--ease); }
.wc-tabs li.active a::after { width: 100%; }
.woocommerce-Tabs-panel { display: none; max-width: 760px; animation: faqIn .4s var(--ease); }
.woocommerce-Tabs-panel.is-open { display: block; }
.woocommerce-Tabs-panel h3 { font-family: var(--display); font-weight: 500; font-size: 1.6rem; margin: 0 0 1rem; }
.woocommerce-Tabs-panel p { color: var(--ink-soft); font-size: 1.04rem; margin: 0 0 1.1rem; }
.woocommerce-Tabs-panel ul.specs { list-style: none; margin: 0; padding: 0; column-gap: 3rem; }
.woocommerce-Tabs-panel ul.specs li { display: flex; justify-content: space-between; gap: 1.5rem; padding: 13px 0; border-bottom: 1px solid var(--line-soft); font-size: 0.95rem; max-width: 460px; }
.woocommerce-Tabs-panel ul.specs li span:first-child { color: var(--muted); }
.woocommerce-Tabs-panel ul.specs li span:last-child { color: var(--ink); font-weight: 500; text-align: right; }

/* ---- Reviews summary ---- */
.review-overview { display: grid; grid-template-columns: auto 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; margin-bottom: 3rem; }
.review-overview__score { text-align: center; }
.review-overview__score .n { font-family: var(--display); font-size: 4.5rem; line-height: 0.9; }
.review-overview__score .stars { color: var(--accent); letter-spacing: 2px; display: block; margin: 8px 0 6px; }
.review-overview__score .c { font-size: 0.84rem; color: var(--muted); }
.review-bars { display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.review-bar { display: grid; grid-template-columns: 48px 1fr 38px; align-items: center; gap: 12px; font-size: 0.82rem; color: var(--muted); }
.review-bar .track { height: 6px; border-radius: 100px; background: var(--line); overflow: hidden; }
.review-bar .track i { display: block; height: 100%; background: var(--accent); border-radius: 100px; }

/* ---- Size visualizer tab ---- */
.sizeviz { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 1.2rem; }
.sizeviz__item { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); align-items: center; }
.sizeviz__item:last-child { border-bottom: none; }
.sizeviz__label { font-weight: 600; font-size: 0.95rem; color: var(--ink); }
.sizeviz__desc { font-size: 0.9rem; color: var(--ink-soft); }
@media (max-width: 600px) {
  .sizeviz__item { grid-template-columns: 1fr; gap: 0.3rem; padding: 14px 16px; }
}

/* ---- Sticky add-to-cart bar ---- */
.pdp-stickybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: saturate(150%) blur(12px);
  border-top: 1px solid var(--line); box-shadow: 0 -8px 30px rgba(35,39,30,0.07);
  transform: translateY(110%); transition: transform .45s var(--ease);
}
.pdp-stickybar.show { transform: translateY(0); }
.pdp-stickybar__in { max-width: var(--container); margin: 0 auto; padding: 12px 48px; display: flex; align-items: center; gap: 18px; }
.pdp-stickybar__img { width: 48px; height: 58px; border-radius: 3px; overflow: hidden; background: var(--paper-2); flex: none; }
.pdp-stickybar__img image-slot { width: 100%; height: 100%; pointer-events: none; }
.pdp-stickybar__meta { display: flex; flex-direction: column; line-height: 1.3; }
.pdp-stickybar__meta .t { font-weight: 600; font-size: 0.95rem; }
.pdp-stickybar__meta .v { font-size: 0.8rem; color: var(--muted); }
.pdp-stickybar__price { margin-left: auto; font-family: var(--display); font-size: 1.5rem; }
.pdp-stickybar .single_add_to_cart_button { flex: 0 0 auto; padding: 0 2rem; height: 50px; }

/* ---- Section wrappers reused ---- */
.pdp-section { max-width: var(--container); margin: 0 auto; padding: clamp(4rem, 8vh, 6.5rem) 48px; }

/* ---- Lightbox ---- */
.bi-lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(32, 35, 28, 0.92); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .35s var(--ease);
}
.bi-lightbox.open { opacity: 1; pointer-events: auto; }
.bi-lightbox__imgwrap {
  max-width: 92vw; max-height: 88vh;
  display: flex; align-items: center; justify-content: center;
}
.bi-lightbox__imgwrap img {
  max-width: 100%; max-height: 88vh; object-fit: contain;
  border-radius: var(--radius); box-shadow: 0 24px 80px rgba(0,0,0,0.35);
}
.bi-lightbox__close {
  position: absolute; top: 20px; right: 28px;
  background: none; border: none; color: var(--paper);
  font-size: 2.6rem; line-height: 1; cursor: pointer;
  opacity: .7; transition: opacity .2s;
}
.bi-lightbox__close:hover { opacity: 1; }
.bi-lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(250,249,245,0.15); border: 1px solid rgba(250,249,245,0.2);
  color: var(--paper); width: 48px; height: 48px; border-radius: 50%;
  font-size: 1.6rem; display: grid; place-items: center; cursor: pointer;
  transition: background .2s, transform .2s;
}
.bi-lightbox__nav:hover { background: rgba(250,249,245,0.3); transform: translateY(-50%) scale(1.05); }
.bi-lightbox__prev { left: 24px; }
.bi-lightbox__next { right: 24px; }
.bi-lightbox__counter {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  color: var(--paper); font-size: .82rem; letter-spacing: .05em;
  background: rgba(32,35,28,0.5); padding: 6px 14px; border-radius: 100px;
}
@media (max-width: 600px) {
  .bi-lightbox__nav { width: 40px; height: 40px; font-size: 1.3rem; }
  .bi-lightbox__prev { left: 10px; }
  .bi-lightbox__next { right: 10px; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1000px) {
  div.product.pdp { grid-template-columns: 1fr; gap: 2.4rem; padding: 24px 24px 0; }
  .woocommerce-product-gallery { position: static; }
  .summary.entry-summary { max-width: 620px; }
  .woocommerce-breadcrumb, .woocommerce-tabs, .pdp-section { padding-left: 24px; padding-right: 24px; }
  .review-overview { grid-template-columns: 1fr; gap: 1.6rem; }
  .review-overview__score { text-align: left; }
}
@media (max-width: 600px) {
  .pdp-gallery { grid-template-columns: 1fr; }
  .pdp-gallery__thumbs { flex-direction: row; order: 2; }
  .pdp-thumb { width: 64px; }
  .size-opts { grid-template-columns: 1fr; }
  .pdp-trust { grid-template-columns: 1fr; }
  .pdp-stickybar__in { padding: 10px 18px; gap: 12px; }
  .pdp-stickybar__img, .pdp-stickybar__meta { display: none; }
  .pdp-stickybar__price { font-size: 1.3rem; }
  .pdp-stickybar .single_add_to_cart_button { flex: 1; }
  .wc-tabs { gap: 1.2rem; }
}

@media (max-width: 900px) {
  /* Sticky bar sits above the mobile bottom nav so both are usable */
  .pdp-stickybar { bottom: 64px; }
}
