/*
 * PARAVANA shop pages on the shared design system (round 12, staging, 2026-11-20). PLAN.md step 4.
 * Product detail, cart, checkout and order-received pages use the v74 tokens from pv-design-tokens.css
 * (DS12 dark / DS13 light), the Nunito / Nunito Sans roles (DS07-DS09), 7 px controls with a 2 px focus
 * ring (DS16) and labeled finish swatches (DS17). Loaded after pv-shop-contrast.css, which stays in place.
 * Stripe's own payment iframe is not styled here.
 */

body.single-product,
body.woocommerce-cart,
body.woocommerce-checkout,
body.woocommerce-order-received {
  --sp-bg: var(--pv-l-bg);
  --sp-surface: var(--pv-l-surface);
  --sp-raised: var(--pv-l-raised);
  --sp-edge: var(--pv-l-edge);
  --sp-ink: var(--pv-l-ink);
  --sp-muted: var(--pv-l-muted);
  --sp-accent: var(--pv-l-accent);
  --sp-accent-ink: var(--pv-l-accent-ink);
  --sp-well: #e7deca;
  --sp-link: var(--pv-l-accent);
}
html[data-bx-mode="dark"] body.single-product,
html[data-bx-mode="dark"] body.woocommerce-cart,
html[data-bx-mode="dark"] body.woocommerce-checkout,
html[data-bx-mode="dark"] body.woocommerce-order-received {
  --sp-bg: var(--pv-d-bg);
  --sp-surface: var(--pv-d-surface);
  --sp-raised: var(--pv-d-raised);
  --sp-edge: var(--pv-d-edge);
  --sp-ink: var(--pv-d-ink);
  --sp-muted: var(--pv-d-muted);
  --sp-accent: var(--pv-d-accent);
  --sp-accent-ink: var(--pv-d-accent-ink);
  --sp-well: #363328;
  --sp-link: var(--pv-d-accent);
}

/* ---------- Shared: type, links, inputs, buttons, focus ---------- */
:is(body.single-product, body.woocommerce-cart, body.woocommerce-checkout) :is(#primary, .site-content) {
  font-family: var(--pv-font-text);
}
:is(body.single-product, body.woocommerce-cart, body.woocommerce-checkout) :is(#primary, .site-content) :is(input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"], input[type="search"], select, textarea):not(.pv-swatches-select):not(.qty):not(.wc-block-components-quantity-selector__input) {
  border: 1px solid var(--sp-edge) !important;
  border-radius: 7px !important;
  background-color: var(--sp-surface) !important;
  color: var(--sp-ink) !important;
  font-family: var(--pv-font-text);
}
:is(body.single-product, body.woocommerce-cart, body.woocommerce-checkout) :is(#primary, .site-content) :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--sp-accent) !important;
  outline-offset: 2px !important;
  box-shadow: none !important;
}
/* Primary actions: v74 accent pair (light olive on cream 9:1, dark sand on near-black 10:1) */
:is(body.single-product, body.woocommerce-cart, body.woocommerce-checkout) :is(#primary, .site-content) :is(
  .single_add_to_cart_button,
  .wc-block-cart__submit-button,
  .wc-block-components-checkout-place-order-button,
  .wc-block-components-button.contained,
  .checkout-button,
  #place_order,
  .woocommerce-message .button
) {
  background: var(--sp-accent) !important;
  border: 1px solid var(--sp-accent) !important;
  border-radius: 7px !important;
  color: var(--sp-accent-ink) !important;
  font-family: var(--pv-font-ui) !important;
  font-weight: 700 !important;
  min-height: 43px;
  opacity: 1;
  text-decoration: none !important;
}
:is(body.single-product, body.woocommerce-cart, body.woocommerce-checkout) :is(#primary, .site-content) :is(.single_add_to_cart_button, .wc-block-cart__submit-button, .wc-block-components-checkout-place-order-button) :is(span, div) {
  color: inherit !important;
}
:is(body.single-product, body.woocommerce-cart, body.woocommerce-checkout) :is(#primary, .site-content) .single_add_to_cart_button:is(.disabled, :disabled) {
  opacity: 0.55 !important;
  cursor: not-allowed;
}

/* ---------- Product detail ---------- */
body.single-product .product_title {
  font-family: var(--pv-font-ui);
  font-weight: 700;
  color: var(--sp-ink) !important;
  line-height: 1.2;
}
body.single-product .summary p.price,
body.single-product .summary .woocommerce-variation-price .price {
  font-family: var(--pv-font-text) !important;
  font-weight: 650;
  font-size: 1.5rem !important;
  font-variant-numeric: tabular-nums;
  color: var(--sp-ink) !important;
}
body.single-product .summary .price :is(.amount, bdi, span) { color: inherit !important; }
body.single-product .summary .woocommerce-product-details__short-description,
body.single-product .summary .woocommerce-variation-description { color: var(--sp-ink); }
body.single-product .product_meta,
body.single-product .product_meta :is(span, a) { color: var(--sp-muted) !important; font-size: 0.92rem; }
body.single-product .product_meta a { text-decoration: underline; text-underline-offset: 3px; }

/* Gallery: the whole photo in a warm well, never cropped (DS15) */
body.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image,
body.single-product .woocommerce-product-gallery .flex-viewport {
  background: var(--sp-well);
  border-radius: 14px;
}
body.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--sp-well);
  border-radius: 14px;
}
body.single-product .woocommerce-product-gallery__trigger { background: var(--sp-surface) !important; color: var(--sp-ink) !important; border: 1px solid var(--sp-edge); }

/* Variation choices: labeled swatches (v74 .swatch); the real select stays in the form, visually hidden */
body.single-product table.variations,
body.single-product table.variations :is(tbody, tr, th, td) { display: block; border: 0 !important; padding: 0 !important; background: transparent !important; }
body.single-product table.variations tr { margin: 0 0 14px; }
body.single-product table.variations th.label label {
  display: block; margin: 0 0 7px; font-family: var(--pv-font-text); font-weight: 700; color: var(--sp-ink) !important;
}
body.single-product select.pv-swatches-select {
  position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0 !important; padding: 0 !important; margin: -1px !important;
}
.pv-swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.pv-swatch {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 39px; padding: 5px 11px;
  border: 1px solid var(--sp-edge); border-radius: 7px;
  background: transparent; color: var(--sp-ink);
  font-family: var(--pv-font-ui); font-size: 0.95rem; font-weight: 600; line-height: 1.2;
  cursor: pointer;
}
.pv-swatch:hover { border-color: var(--sp-accent); background: transparent; color: var(--sp-ink); }
.pv-swatch[aria-pressed="true"] { outline: 2px solid var(--sp-accent); outline-offset: 1px; background: var(--sp-raised); }
.pv-swatch[aria-disabled="true"] { opacity: 0.5; text-decoration: line-through; cursor: not-allowed; }
.pv-swatch__chip { width: 18px; height: 18px; border-radius: 3px; border: 1px solid var(--sp-edge); flex: 0 0 auto; }
body.single-product .reset_variations { display: inline-block; margin-top: 8px; color: var(--sp-link) !important; font-size: 0.92rem; text-decoration: underline; }

/* Quantity + Add to cart row */
body.single-product form.cart .quantity :is(input, button, .minus, .plus) { color: var(--sp-ink) !important; background: var(--sp-surface) !important; }
body.single-product form.cart .quantity { border-color: var(--sp-edge) !important; border-radius: 7px; }
body.single-product .single_variation_wrap .woocommerce-variation-availability { color: var(--sp-muted); }

/* R6 "Your words" box on the shared input style */
body.single-product .pv-commission-words label { color: var(--sp-ink); font-family: var(--pv-font-text); }
body.single-product .pv-commission-words abbr.required { color: var(--sp-ink); text-decoration: none; }
body.single-product .pv-commission-words textarea { padding: 10px 12px !important; line-height: 1.5; }
body.single-product .pv-commission-words__note { color: var(--sp-muted); }

/* Description / Additional information tabs */
body.single-product .woocommerce-tabs ul.tabs li a { font-family: var(--pv-font-ui); color: var(--sp-ink) !important; }
body.single-product .woocommerce-tabs ul.tabs li.active a { color: var(--sp-ink) !important; border-bottom: 2px solid var(--sp-accent) !important; }
body.single-product .woocommerce-tabs ul.tabs li.active::after,
body.single-product .woocommerce-tabs ul.tabs li.active::before { border-bottom-color: var(--sp-accent) !important; }
body.single-product .woocommerce-tabs .panel { background: var(--sp-surface) !important; border: 1px solid var(--sp-edge) !important; border-radius: 14px; color: var(--sp-ink); }
body.single-product .woocommerce-tabs .panel :is(h2, p, th, td, li) { color: var(--sp-ink) !important; }
body.single-product .woocommerce-tabs .panel table.shop_attributes :is(th, td) { border-color: var(--sp-edge) !important; background: transparent !important; }

/* ---------- Cart and checkout (WooCommerce blocks) ---------- */
:is(body.woocommerce-cart, body.woocommerce-checkout) .wp-block-woocommerce-cart,
:is(body.woocommerce-cart, body.woocommerce-checkout) .wp-block-woocommerce-checkout { color: var(--sp-ink); font-family: var(--pv-font-text); }
:is(body.woocommerce-cart, body.woocommerce-checkout) :is(.wc-block-cart-items, .wc-block-components-sidebar .wc-block-components-panel, .wp-block-woocommerce-cart-totals-block, .wc-block-components-order-summary, .wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block) {
  background: var(--sp-surface) !important;
  border-color: var(--sp-edge) !important;
  border-radius: 14px;
}
:is(body.woocommerce-cart, body.woocommerce-checkout) :is(.wc-block-cart-items th, .wc-block-cart-items td, .wc-block-components-totals-item, .wc-block-components-panel__button, .wc-block-components-product-metadata, .wc-block-components-product-details, .wc-block-components-title, .wc-block-components-checkout-step__title, .wc-block-components-checkout-step__description, .wc-block-components-order-summary-item__description, label) {
  color: var(--sp-ink) !important;
}
:is(body.woocommerce-cart, body.woocommerce-checkout) :is(.wc-block-cart-items, .wc-block-cart-items th, .wc-block-cart-items td, .wc-block-components-totals-wrapper, .wc-block-components-panel) { border-color: var(--sp-edge) !important; }
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-product-name {
  font-family: var(--pv-font-ui) !important; font-weight: 700; color: var(--sp-ink) !important; text-decoration: none !important;
}
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-product-name:hover { text-decoration: underline !important; }
:is(body.woocommerce-cart, body.woocommerce-checkout) :is(.wc-block-components-formatted-money-amount, .wc-block-components-product-price, .wc-block-components-totals-item__value) {
  font-family: var(--pv-font-text); font-weight: 650; font-variant-numeric: tabular-nums; color: var(--sp-ink) !important;
}
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-totals-footer-item :is(.wc-block-components-totals-item__label, .wc-block-components-totals-item__value) { font-size: 1.2rem; }
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-product-metadata,
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-product-metadata * { color: var(--sp-muted) !important; }
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-product-details__name { font-weight: 700; color: var(--sp-ink) !important; }
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-cart-item__image img,
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-order-summary-item__image img { background: var(--sp-well); object-fit: contain; aspect-ratio: 1; border-radius: 7px; }
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-quantity-selector { border-color: var(--sp-edge) !important; border-radius: 7px !important; background: var(--sp-surface) !important; }
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-quantity-selector :is(input, button) { color: var(--sp-ink) !important; background: transparent !important; }
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-cart-item__remove-link { color: var(--sp-ink) !important; }
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-text-input :is(input, label),
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-blocks-components-select :is(select, label),
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-textarea { color: var(--sp-ink) !important; }
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-text-input input,
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-blocks-components-select select,
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-textarea {
  background: var(--sp-surface) !important; border: 1px solid var(--sp-edge) !important; border-radius: 7px !important;
}
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-text-input.is-active label,
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-text-input label { color: var(--sp-muted) !important; }
:is(body.woocommerce-cart, body.woocommerce-checkout) :is(.wc-block-components-radio-control__option, .wc-block-components-radio-control-accordion-option) { color: var(--sp-ink) !important; border-color: var(--sp-edge) !important; }
:is(body.woocommerce-cart, body.woocommerce-checkout) :is(.wc-block-components-radio-control__input, .wc-block-components-checkbox__input) {
  border-color: var(--sp-edge) !important; background: var(--sp-surface) !important;
}
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-radio-control__input:checked::before { background: var(--sp-accent) !important; }
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-checkbox__mark { fill: var(--sp-accent) !important; }
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-checkout-step__container,
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-checkout-step__heading { color: var(--sp-ink); }
/* Terms and legal links stay visible and underlined */
:is(body.woocommerce-cart, body.woocommerce-checkout) :is(.wc-block-checkout__terms, .wc-block-components-checkout-policies, .wc-block-checkout__terms a, .wc-block-components-checkout-policies a) { color: var(--sp-ink) !important; }
:is(body.woocommerce-cart, body.woocommerce-checkout) :is(.wc-block-checkout__terms a, .wc-block-components-checkout-policies a, .wc-block-components-checkout-return-to-cart-button) {
  color: var(--sp-link) !important; text-decoration: underline !important; text-underline-offset: 3px;
}
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-panel__button:hover { background: transparent !important; }

/* ---------- Order received (receipt) ---------- */
body.woocommerce-order-received .woocommerce-order { color: var(--sp-ink); font-family: var(--pv-font-text); }
body.woocommerce-order-received :is(.woocommerce-thankyou-order-details, .woocommerce-order-overview, .wc-block-order-confirmation-summary) {
  background: var(--sp-surface) !important; border: 1px solid var(--sp-edge) !important; border-radius: 14px; color: var(--sp-ink) !important;
}
body.woocommerce-order-received :is(table, th, td, h2, h3, li, strong, address, p, .amount) { color: var(--sp-ink) !important; border-color: var(--sp-edge) !important; }
body.woocommerce-order-received .amount { font-variant-numeric: tabular-nums; font-weight: 650; }
body.woocommerce-order-received .woocommerce-order a:not(.button) { color: var(--sp-link) !important; text-decoration: underline; text-underline-offset: 3px; }
/* Floating labels: a field's own placeholder showed through its label ("Phone (optional)" over "Enter phone number…").
 * Hide the placeholder until the field is active, so only one of them is ever visible. */
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-text-input:not(.is-active) input::placeholder { color: transparent !important; }
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-text-input.is-active input::placeholder { color: var(--sp-muted) !important; opacity: 1; }
:is(body.single-product, body.woocommerce-cart, body.woocommerce-checkout) :is(#primary, .site-content) ::placeholder { color: var(--sp-muted); opacity: 1; }
/* Quantity stepper: one border on the theme's container, none on the number inside it */
body.single-product form.cart .quantity input.qty { border: 0 !important; background: transparent !important; color: var(--sp-ink) !important; box-shadow: none !important; }
body.single-product form.cart .quantity { border: 1px solid var(--sp-edge) !important; background: var(--sp-surface) !important; }
/* Product with no approved photo yet: the same lettered warm well as the Marketplace cards (R11), never the grey placeholder graphic */
body.single-product .pv-mp-letter--single {
  display: grid; place-items: center; width: 100%; aspect-ratio: 1; padding: 24px; box-sizing: border-box; border-radius: 14px;
  background: radial-gradient(ellipse at 25% 0%, #56523d, #34352a 62%); color: #e7dec8;
  font: 700 clamp(1.4rem, 3vw, 2.1rem)/1.25 var(--pv-font-ui, "Nunito", Arial, sans-serif); text-align: center;
}
body.woocommerce-order-received .woocommerce-customer-details address { border: 0 !important; background: transparent !important; padding: 0 !important; }
body.woocommerce-order-received .woocommerce-order-details__title { padding: 12px 16px 0; }
:is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-quantity-selector__input { border: 0 !important; background: transparent !important; color: var(--sp-ink) !important; box-shadow: none !important; }

/* Round 16: the order-received "verify your email" step uses the same accent button (was coral, 3.87:1). */
:is(body.woocommerce-checkout, body.woocommerce-order-received) :is(#primary, .site-content) form.woocommerce-verify-email :is(button, .button) { background: var(--sp-accent) !important; border: 1px solid var(--sp-accent) !important; color: var(--sp-accent-ink) !important; border-radius: 7px !important; font-family: var(--pv-font-ui); font-weight: 700; }
