/* Lumea Labs — WooCommerce-specific styles (async-loaded only on shop/product/cart/checkout)
 * Everything else (shop-grid, filter-panel, product-detail, dose-select, cart-drawer, etc.)
 * already lives in main.css — it was authored against the exact same class names this
 * theme's WooCommerce template overrides output, so no duplication is needed here. */

/* ── Variation form: real <select> kept in the DOM for WC's JS, hidden visually ──
   Not display:none — WC's jQuery still needs to read/write .val() on a rendered field. */
.variations select.dose-native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.variations table.variations,
.variations table.variations tbody,
.variations table.variations tr,
.variations table.variations td { display: block; width: 100%; }
.single_variation_wrap .woocommerce-variation-add-to-cart { display: contents; }
.single_variation_wrap .single_variation { display: none !important; } /* WC writes its own template here, unused — real UI is #priceRow / #doseBadge */
.woocommerce-variation-price,
.woocommerce-variation-availability { display: none; } /* re-rendered into .price-row / dose-badge by lumea-variations.js */

.dose-options button[disabled] { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }

/* WC's add-to-cart-variation.js toggles these as CSS classes (not the native
   disabled attribute) on .single_add_to_cart_button via onHide/onShow —
   #pdAddToCart intentionally has no native `disabled` attribute in the markup
   so it isn't stuck disabled forever once a default variation is selected. */
.single_add_to_cart_button.disabled,
.single_add_to_cart_button.wc-variation-selection-needed,
.single_add_to_cart_button.wc-variation-is-unavailable {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

/* ── Add-to-cart loading state ──────────────────────────────────────────── */
.btn-add-cart.is-loading,
.btn-add.is-loading,
.js-quick-add.is-loading { opacity: 0.6; pointer-events: none; }
.purchase-row .btn-add-cart { position: relative; }
.cart-item.is-loading { opacity: 0.5; pointer-events: none; }
.shop-grid.is-loading { opacity: 0.5; pointer-events: none; transition: opacity 0.15s ease; }

/* ── WooCommerce core notices (cart/checkout messages) restyled to match tokens ── */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
  list-style: none;
  margin: 0 0 24px;
  padding: 16px 20px;
  border-radius: 0;
  font-size: 13.5px;
  background: var(--cream);
  border: 1px solid var(--border-light);
  color: var(--ink);
}
.woocommerce-error { border-color: #C0604F; background: #FBEFEC; }
.woocommerce-message .button,
.woocommerce-error .button { margin-left: 12px; }

/* ── Order-received "log in to view this order" gate ──────────────────────
   When an order belongs to a registered account and the current visitor isn't
   logged in as that customer, WooCommerce core (not our thankyou.php override
   — it never even runs here) shows a generic "Thank you, order received"
   notice followed by a login form instead of the real order details. Showing
   both reads as redundant/confusing, so the success notice is hidden whenever
   a login form immediately follows it — leaving just the login prompt. */
.woocommerce-order-received p.woocommerce-notice--success:has(+ .woocommerce-info + form.woocommerce-form-login) {
  display: none;
}
/* Matches the .lum-auth bordered/rounded card used on the real My Account
   login/register page. This context has no "Login" <h2> of its own (WC core
   prints the notice + woocommerce_login_form() directly, bypassing our themed
   myaccount/form-login.php entirely), so one is added via ::before. */
.woocommerce-order-received .entry-content:has(> .woocommerce > form.woocommerce-form-login) {
  max-width: 420px;
  margin: 0 auto;
  padding: 80px 20px 120px;
}
.woocommerce-order-received .woocommerce-info { margin-top: 0; margin-bottom: 28px; }
.woocommerce-order-received form.woocommerce-form-login {
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 36px 32px;
  background: #fff;
}
.woocommerce-order-received form.woocommerce-form-login::before {
  content: "Login";
  display: block;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 24px;
  color: var(--ink);
  margin: 0 0 20px;
}

/* ── Cart, Checkout & My Account shortcode pages — contained, on-brand layout ──
   (order-received is excluded — its full-bleed hero needs the un-clamped,
   unpadded .entry-content that front-page.php's hero block also relies on) */
.woocommerce-cart .entry-content,
.woocommerce-checkout:not(.is-order-received) .entry-content,
.woocommerce-account .entry-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 48px 100px;
}
.woocommerce table.shop_table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 32px;
  font-size: 14px;
}
.woocommerce table.shop_table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 12px 10px;
  border-bottom: 1px solid var(--border-light);
}
.woocommerce table.shop_table th.product-total,
.woocommerce table.shop_table td.product-total,
.woocommerce table.shop_table tr.cart-subtotal td,
.woocommerce table.shop_table tr.order-total td,
.woocommerce table.shop_table tr.shipping td,
.woocommerce table.shop_table tr.woocommerce-shipping-totals td,
.woocommerce table.shop_table tfoot td {
  text-align: right;
}
.woocommerce table.shop_table td {
  padding: 16px 10px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.woocommerce td.product-name a { font-weight: 600; color: var(--ink); }
.woocommerce td.product-thumbnail img { width: 90px; height: 90px; object-fit: cover; }
.woocommerce td.product-remove a.remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--muted);
  font-size: 18px;
  text-decoration: none;
  border-radius: 50%;
}
.woocommerce td.product-remove a.remove:hover { color: var(--ink); background: var(--cream); }
.woocommerce td.product-quantity .quantity input.qty {
  width: 60px;
  padding: 10px;
  border: 1px solid var(--border-light);
  font-family: var(--font-sans);
  text-align: center;
}
.woocommerce-cart table.cart img { box-shadow: none; }
.woocommerce .cart-collaterals .cart_totals { max-width: 420px; margin-left: auto; }
.woocommerce .cart_totals table { width: 100%; font-size: 14px; }
.woocommerce .cart_totals table th,
.woocommerce .cart_totals table td { padding: 10px; border-bottom: 1px solid var(--border-light); }
.woocommerce .cart_totals .order-total .amount { font-size: 18px; font-family: var(--font-serif); }
.woocommerce a.checkout-button,
.woocommerce #place_order,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce-button.button {
  display: inline-block;
  background: var(--ink);
  color: var(--button-text);
  border: none;
  padding: 15px 32px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .2s ease;
}
.woocommerce a.checkout-button:hover,
.woocommerce #place_order:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce-button.button:hover,
.woocommerce a.wc-forward:not(.button):hover { opacity: 0.82; }
.woocommerce a.wc-forward:not(.button) {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 13px;
}
.woocommerce form .form-row {
  margin: 0 0 20px;
}
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row select,
.woocommerce form .form-row textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  font-family: var(--font-sans);
  font-size: 14px;
  background: #fff;
  color: var(--ink);
}
.woocommerce form .form-row label { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 6px; display: block; }
.woocommerce form .form-row .required { color: #C0604F; text-decoration: none; }

/* Password field's "show/hide" toggle — WC's own JS (frontend/woocommerce.js)
   appends an empty <button class="show-password-input"> into .password-input
   with zero default styling anywhere outside its twenty-seventeen theme
   integration, so on any other theme it renders as a tiny unstyled empty
   button sitting in normal flow (the stray "pill" between the password field
   and Remember-me). Position it as an eye-icon toggle inside the input. */
.woocommerce form .password-input { position: relative; display: block; }
.woocommerce form .password-input input.input-text { padding-right: 44px; }
.woocommerce form .show-password-input {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23766A59%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M1%2012s4-7%2011-7%2011%207%2011%207-4%207-11%207-11-7-11-7Z%22/%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%223%22/%3E%3C/svg%3E") center / 18px no-repeat;
  cursor: pointer;
  appearance: none;
}
.woocommerce form .show-password-input.display-password {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23766A59%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M17.94%2017.94A10.94%2010.94%200%200%201%2012%2019c-7%200-11-7-11-7a21.7%2021.7%200%200%201%205.06-5.94M9.9%204.24A10.4%2010.4%200%200%201%2012%204c7%200%2011%207%2011%207a21.6%2021.6%200%200%201-2.16%203.19m-6.72-1.07a3%203%200%201%201-4.24-4.24%22/%3E%3Cline%20x1%3D%221%22%20y1%3D%221%22%20x2%3D%2223%22%20y2%3D%2223%22/%3E%3C/svg%3E");
}

/* Select2 (Country/State dropdowns) — WC's own select2.css only covers
   behaviour/positioning, not brand styling, so without this it renders at
   its own ~24px default height instead of matching the other inputs'
   ~48px, which is what made "Street address" visually collide with the
   dropdown above it (no row had margin-bottom to compensate, either). */
.select2-container--default .select2-selection--single {
  height: 48px;
  border: 1px solid var(--border-light);
  border-radius: 0;
  background: #fff;
  display: flex;
  align-items: center;
  padding: 0 14px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  padding: 0;
  line-height: normal;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 46px;
  right: 10px;
}
.select2-dropdown {
  border: 1px solid var(--border-light);
  border-radius: 0;
  font-family: var(--font-sans);
  font-size: 14px;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: var(--ink);
}
.select2-search--dropdown .select2-search__field {
  border: 1px solid var(--border-light);
  padding: 8px 10px;
  font-family: var(--font-sans);
}
.select2-container .select2-selection--single { outline: none; }
/* ── Checkout — two-column layout: billing/shipping form (left) + sticky
   order summary card (right), matching the order-summary-card language
   already established on the thank-you page ─────────────────────────── */
.woocommerce-checkout form.checkout {
  display: grid;
  grid-template-columns: 1fr 400px;
  grid-template-rows: auto 1fr;
  gap: 12px 56px;
  align-items: start;
}
.woocommerce-checkout .col2-set {
  grid-column: 1;
  grid-row: 1 / span 2;
}
.woocommerce-checkout #order_review_heading {
  grid-column: 2;
  grid-row: 1;
  max-width: none;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink);
}
.woocommerce-checkout #order_review {
  grid-column: 2;
  grid-row: 2;
  max-width: none;
  margin: 0;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 28px;
  position: sticky;
  top: 24px;
}
.woocommerce-checkout #order_review table.shop_table { margin-bottom: 20px; font-size: 13.5px; }
.woocommerce-checkout #order_review table.shop_table th,
.woocommerce-checkout #order_review table.shop_table td { padding: 12px 0; }
.woocommerce-checkout #order_review .order-total .amount { font-family: var(--font-serif); font-size: 20px; }

.woocommerce-billing-fields h3,
.woocommerce-shipping-fields h3,
.woocommerce-additional-fields h3 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 24px;
}
.woocommerce-billing-fields__field-wrapper,
.woocommerce-shipping-fields__field-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
}
.woocommerce-billing-fields__field-wrapper .form-row,
.woocommerce-shipping-fields__field-wrapper .form-row { flex: 1 1 100%; }
.woocommerce-billing-fields__field-wrapper .form-row-first,
.woocommerce-billing-fields__field-wrapper .form-row-last,
.woocommerce-shipping-fields__field-wrapper .form-row-first,
.woocommerce-shipping-fields__field-wrapper .form-row-last {
  flex: 1 1 calc(50% - 10px);
}

/* Payment methods — plain <ul> to a set of bordered cards matching .payid-card */
ul.wc_payment_methods {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
ul#shipping_method,
.woocommerce-shipping-methods {
  list-style: none;
  margin: 0;
  padding: 0;
}
li.wc_payment_method {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 16px 18px;
  background: var(--cream);
}
li.wc_payment_method label {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.payment_box {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.payment_box p { margin: 0; }
.woocommerce-terms-and-conditions-wrapper { margin-bottom: 18px; }
.woocommerce-privacy-policy-text p { font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.woocommerce-privacy-policy-text a { text-decoration: underline; color: var(--ink-soft); }
.woocommerce-checkout #place_order { width: 100%; }

@media (max-width: 900px) {
  .woocommerce-checkout form.checkout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .woocommerce-checkout .col2-set,
  .woocommerce-checkout #order_review_heading,
  .woocommerce-checkout #order_review {
    grid-column: 1;
  }
  .woocommerce-checkout #order_review_heading { grid-row: 2; margin-top: 32px; margin-bottom: 16px; }
  .woocommerce-checkout #order_review { grid-row: 3; position: static; }
}

/* ── My Account ─────────────────────────────────────────────────────────── */
/* .entry-content's direct children are <h1 class="page-heading"> and a
   <div class="woocommerce"> (WC's own shortcode_wrapper()) — the nav +
   content pair live INSIDE that .woocommerce div, not as direct children
   of .entry-content, so :has() must target the .woocommerce wrapper
   itself. The heading is already a separate block-level sibling, so it's
   full-width for free — no grid-column spanning trick needed. Grid
   degrades to a normal single-column block when there's no nav (the
   logged-out Login/Register view has no .woocommerce-MyAccount-navigation
   in its .woocommerce wrapper). */
.woocommerce-account .entry-content { display: block; }
.woocommerce-account .entry-content > .page-heading { margin-bottom: 32px; }
.woocommerce-account .entry-content .woocommerce:has(> .woocommerce-MyAccount-navigation) {
  display: grid;
  grid-template-columns: 220px 1fr;
  column-gap: 60px;
  align-items: start;
}
.woocommerce-account .woocommerce-MyAccount-navigation { grid-column: 1; position: sticky; top: 110px; }
.woocommerce-account .woocommerce-MyAccount-content { grid-column: 2; min-width: 0; }
.woocommerce-MyAccount-navigation ul { list-style: none; margin: 0; padding: 0; }
.woocommerce-MyAccount-navigation li { border-top: 1px solid var(--border-light); }
.woocommerce-MyAccount-navigation li:last-child { border-bottom: 1px solid var(--border-light); }
.woocommerce-MyAccount-navigation a {
  display: block;
  padding: 14px 4px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.woocommerce-MyAccount-navigation li.is-active a { color: var(--ink); font-weight: 700; }
.woocommerce-MyAccount-navigation a:hover { color: var(--ink); }

.woocommerce-MyAccount-content h2,
.woocommerce-MyAccount-content h3,
.woocommerce-Address-title h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 22px;
  color: var(--ink);
  margin: 0 0 16px;
}
.woocommerce-MyAccount-content p { font-size: 14px; line-height: 1.7; color: var(--ink-soft); margin-bottom: 16px; }
.woocommerce-MyAccount-content a:not(.button) { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* Login / Register — single-panel toggle (see woocommerce/myaccount/form-login.php
   override + main.js's [data-lum-auth] handler). Only one of .lum-auth-panel is
   visible at a time (the other carries [hidden]), so this stays a narrow,
   centered card instead of the old side-by-side two-column layout. */
.lum-auth {
  max-width: 420px;
  margin: 0 auto;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 36px 32px;
  background: #fff;
}
.lum-auth-panel[hidden] { display: none; }
.woocommerce-form-login h2,
.woocommerce-form-register h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 24px;
  color: var(--ink);
  margin: 0 0 20px;
}
.woocommerce-form-login__rememberme { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); margin-bottom: 18px; }
.woocommerce-form__input-checkbox { width: 15px; height: 15px; margin: 0; accent-color: var(--ink); }
.woocommerce-LostPassword { margin-top: 16px; font-size: 13px; }
.woocommerce-LostPassword a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.lum-auth-switch {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
  font-size: 13.5px;
  color: var(--ink-soft);
}
.lum-auth-toggle {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-left: 4px;
}

/* Lost password — WC core's form-lost-password.php has no <h2> of its own (the
   page's <h1> already reads "Lost password" via wc_page_endpoint_title()) and
   no width constraint, so left untouched it stretched to the full 1100px
   .entry-content and looked like plain unstyled text next to a huge input. */
.woocommerce-ResetPassword.lost_reset_password { max-width: 420px; }
.woocommerce-ResetPassword.lost_reset_password > p:first-child {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 24px;
}

/* Account details — "Password change" fieldset ships with zero classes from
   WC core, relying entirely on the browser's default UA fieldset/legend
   rendering (inconsistent across browsers — reported as "no border" on at
   least one). Explicit styling removes that dependency. */
.woocommerce-EditAccountForm fieldset {
  border: 1px solid var(--border-light);
  padding: 28px 24px 8px;
  margin: 0 0 24px;
}
.woocommerce-EditAccountForm legend {
  padding: 0 10px;
  margin-left: -10px;
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--ink);
}

/* Addresses */
.woocommerce-Addresses.col2-set { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.woocommerce-Address header.woocommerce-Address-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.woocommerce-Address header.woocommerce-Address-title h2 { margin: 0; font-size: 18px; }
.woocommerce-Address header.woocommerce-Address-title a.edit { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.woocommerce-Address address { font-style: normal; font-size: 14px; line-height: 1.8; color: var(--ink-soft); }

/* Orders table actions + pagination */
.woocommerce-orders-table__cell-order-actions .button { padding: 8px 16px; font-size: 10.5px; margin-right: 6px; }
.woocommerce-Pagination { display: flex; gap: 12px; margin-top: 20px; }

@media (max-width: 780px) {
  .woocommerce-account .entry-content .woocommerce:has(> .woocommerce-MyAccount-navigation) {
    grid-template-columns: 1fr;
    row-gap: 34px;
  }
  .woocommerce-account .woocommerce-MyAccount-navigation { grid-column: 1; position: static; width: 100%; }
  .woocommerce-account .woocommerce-MyAccount-content { grid-column: 1; }
  .u-columns.col2-set { flex-direction: column; gap: 34px; }
  .woocommerce-Addresses.col2-set { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 700px) {
  .woocommerce-cart .entry-content,
  .woocommerce-checkout:not(.is-order-received) .entry-content,
  .woocommerce-account .entry-content { padding: 40px 20px 70px; }
  .woocommerce table.shop_table, .woocommerce table.shop_table tbody, .woocommerce table.shop_table tr { display: block; }
  .woocommerce table.shop_table thead { display: none; }
  .woocommerce table.shop_table td { display: flex; justify-content: space-between; border-bottom: none; }
  .woocommerce table.shop_table tr.cart-subtotal,
  .woocommerce table.shop_table tr.shipping,
  .woocommerce table.shop_table tr.woocommerce-shipping-totals,
  .woocommerce table.shop_table tr.order-total {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
  }
  .woocommerce table.shop_table tr.cart-subtotal th,
  .woocommerce table.shop_table tr.shipping th,
  .woocommerce table.shop_table tr.woocommerce-shipping-totals th,
  .woocommerce table.shop_table tr.order-total th {
    flex: 0 0 auto;
  }
  .woocommerce table.shop_table tr.cart-subtotal td,
  .woocommerce table.shop_table tr.shipping td,
  .woocommerce table.shop_table tr.woocommerce-shipping-totals td,
  .woocommerce table.shop_table tr.order-total td {
    display: block;
    text-align: right;
    flex: 0 0 auto;
  }
}
