/* Refill plan dropdown styling */
.kanzu-refill-interval {
  /* margin: 20px 0; */
  display: flex;
  flex-direction: column;
  gap: 15px;
  flex-wrap: wrap;
}

.kanzu-refill-interval label {
  font-weight: 600;
  margin-bottom: 0;
  min-width: 100px;
}

.kanzu-refill-interval select {
  flex: 1;
  min-width: 200px;
  max-width: 800px;
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid #ddd;
  background-color: #fff;
}

/* On the product page, align with quantity and add-to-cart */
.single-product .cart {
  flex-wrap: wrap;
}

.single-product .kanzu-refill-interval {
  width: 100%;
  margin-bottom: 20px;
}

/* For a cleaner look, place it between quantity and add-to-cart button */
.woocommerce div.product form.cart .kanzu-refill-interval {
  order: 2;
}

.woocommerce div.product form.cart div.quantity {
  order: 1;
}

.woocommerce div.product form.cart .single_add_to_cart_button {
  order: 3;
}

/* ═══════════════════════════════════════
   CHECKOUT – redesigned
   ═══════════════════════════════════════ */

/* Required field asterisk – teal superscript, no underline */
.woocommerce-checkout abbr.required {
  color: #005670;
  text-decoration: none;
  font-size: 0.7em;
  vertical-align: super;
  margin-left: 2px;
  border-bottom: none;
}

/* Section card */
.woocommerce-checkout .woocommerce-billing-fields {
  background: #fff;
  border: 1px solid #e0e8ed;
  border-radius: 10px;
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
}

/* Section heading */
.woocommerce-checkout .woocommerce-billing-fields > h3 {
  font-size: 1.05em;
  font-weight: 700;
  color: #005670;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-bottom: 2px solid #e0e8ed;
  padding-bottom: 0.75rem;
  margin-top: 0;
  margin-bottom: 1.25rem;
}

/* Field labels */
.woocommerce-checkout .form-row label {
  font-size: 0.85em !important;
  font-weight: 600;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35em;
  display: block;
}

/* Inputs */
.woocommerce-checkout .form-row input.input-text,
.woocommerce-checkout .form-row select,
.woocommerce-checkout .form-row textarea {
  padding: 0.75em 1em;
  font-size: 1em;
  border: 1.5px solid #d0dae3;
  border-radius: 6px;
  background: #fafcfd;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  width: 100%;
  box-sizing: border-box;
}

.woocommerce-checkout .form-row input.input-text:focus,
.woocommerce-checkout .form-row select:focus,
.woocommerce-checkout .form-row textarea:focus {
  border-color: #005670;
  box-shadow: 0 0 0 3px rgba(0, 86, 112, 0.12);
  outline: none;
  background: #fff;
}

/* Side-by-side first / last name */
.woocommerce-billing-fields__field-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.25rem;
}

.woocommerce-billing-fields__field-wrapper .form-row-wide {
  grid-column: 1 / -1;
}

/* Override WooCommerce's default float + 47% so each name field fills its column */
.woocommerce-billing-fields__field-wrapper .form-row-first,
.woocommerce-billing-fields__field-wrapper .form-row-last {
  float: none !important;
  width: 100% !important;
}

/* Delivery method – card-style radio buttons
   WooCommerce outputs: input, label, input, label as siblings.
   We hide the raw inputs and use input:checked + label for state. */
.woocommerce-checkout .delivery-method-field .woocommerce-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

/* Hide the raw radio — keep it in the DOM for accessibility */
.woocommerce-checkout
  .delivery-method-field
  .woocommerce-input-wrapper
  input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Label = the full card */
.woocommerce-checkout .delivery-method-field .woocommerce-input-wrapper label {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.65em 0.9em;
  border: 1.5px solid #d0dae3;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95em;
  font-weight: 500;
  color: #2d3748;
  background: #fafcfd;
  transition:
    border-color 0.15s,
    background 0.15s;
  text-transform: none;
  letter-spacing: 0;
}

/* Custom radio circle via ::before on the label */
.woocommerce-checkout
  .delivery-method-field
  .woocommerce-input-wrapper
  label::before {
  content: "";
  width: 1.1em;
  height: 1.1em;
  border: 1.5px solid #b0bec8;
  border-radius: 50%;
  flex-shrink: 0;
  background: #fff;
  transition:
    border-color 0.15s,
    background 0.15s,
    box-shadow 0.15s;
}

.woocommerce-checkout
  .delivery-method-field
  .woocommerce-input-wrapper
  label:hover {
  border-color: #005670;
  background: #f0f7fa;
}

/* Checked state – adjacent sibling selector */
.woocommerce-checkout
  .delivery-method-field
  .woocommerce-input-wrapper
  input[type="radio"]:checked
  + label {
  border-color: #005670;
  background: #f0f7fa;
  color: #005670;
  font-weight: 600;
}

.woocommerce-checkout
  .delivery-method-field
  .woocommerce-input-wrapper
  input[type="radio"]:checked
  + label::before {
  border-color: #005670;
  background: #005670;
  box-shadow: inset 0 0 0 3px #f0f7fa;
}

/* Delivery area / PIN fields */
.woocommerce-checkout .delivery-area-field input,
.woocommerce-checkout .delivery-pin-field input {
  border-radius: 6px;
}

.woocommerce-checkout .delivery-area-field .select2-container {
  width: 100% !important;
}

.woocommerce-checkout
  .delivery-area-field
  .select2-container--default
  .select2-selection--single {
  height: auto;
  padding: 0.6em 1em;
  border: 1.5px solid #d0dae3;
  border-radius: 6px;
  background: #fafcfd;
}

/* Invalid state */
.woocommerce-checkout .delivery-area-field.woocommerce-invalid input,
.woocommerce-invalid.delivery-area-field input {
  border-color: #dc3232 !important;
}

.delivery-area-error {
  color: #dc3232;
  font-size: 0.88em;
  margin-top: 0.3em;
  display: none;
}

.delivery-area-error.show {
  display: block;
}

/* Initially hide delivery area and PIN (JS controls) */
#delivery_area_field,
#delivery_pin_field {
  display: none;
}

/* Hide coupon and additional notes */
.woocommerce-checkout .woocommerce-form-coupon-toggle,
.woocommerce-additional-fields {
  display: none !important;
}

/* Order review / place order section */
.woocommerce-checkout #order_review_heading {
  font-size: 1.05em;
  font-weight: 700;
  color: #005670;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Place order button */
.woocommerce-checkout #place_order {
  background: #005670;
  border-radius: 6px;
  font-size: 1em;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 1em 2em;
  width: 100%;
  transition: background 0.15s;
}

.woocommerce-checkout #place_order:hover {
  background: #003d52;
}

/* Responsive – stack on mobile */
@media (max-width: 600px) {
  .woocommerce-billing-fields__field-wrapper {
    grid-template-columns: 1fr;
  }

  .woocommerce-checkout .delivery-method-field .woocommerce-input-wrapper {
    grid-template-columns: 1fr;
  }

  .woocommerce-checkout .woocommerce-billing-fields {
    padding: 1.25rem 1.1rem;
  }
}

/* ── Cart item numbering (non-consultation items only) ── */
.woocommerce-cart-form .shop_table tbody,
.woocommerce-checkout-review-order-table tbody,
.woocommerce-checkout-review-order-table {
  counter-reset: cart-item-counter;
}

.woocommerce-cart-form .shop_table tr.cart_item:not(.kc-consultation-item),
.woocommerce-checkout-review-order-table
  tr.cart_item:not(.kc-consultation-item) {
  counter-increment: cart-item-counter;
}

/* Cart page: number sits before the thumbnail image */
.woocommerce-cart-form
  .shop_table
  tr.cart_item:not(.kc-consultation-item)
  td.product-thumbnail::before {
  content: counter(cart-item-counter) ".";
  font-weight: 700;
  font-size: 0.9em;
  color: #005670;
  display: inline-block;
  margin-right: 0.4em;
  vertical-align: middle;
}

/* Checkout review: no image column – number before the product name */
.woocommerce-checkout-review-order-table
  tr.cart_item:not(.kc-consultation-item)
  td.product-name::before {
  content: counter(cart-item-counter) ". ";
  font-weight: 700;
  color: #005670;
  margin-right: 0.1em;
}

/* Global Add to Cart button styling (all pages) */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.add_to_cart_button,
.woocommerce .single_add_to_cart_button {
  background-color: #002d70;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 14.5px;
  color: #fff;
  padding: 13px 25px;
  margin: 0;
  display: inline-block;
  border: none;
  line-height: 1;
}

.astra-shop-thumbnail-wrap .ast-on-card-button {
  padding: 10px !important;
  border-radius: 50%;
}

/* Hover state */
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce a.add_to_cart_button:hover,
.woocommerce .single_add_to_cart_button:hover {
  background-color: #001f4d;
  color: #fff;
}

.woocommerce-js div.product form.cart .button.single_add_to_cart_button {
  padding: 13px 25px !important;
}

/* ── Checkout: order summary loader while delivery fee/totals refresh ────── */

.nhl-order-review-loading {
  position: relative;
}

.nhl-order-review-loader {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.7);
}

.nhl-order-review-loader__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(0, 0, 0, 0.15);
  border-top-color: #333;
  border-radius: 50%;
  animation: nhl-order-review-spin 0.7s linear infinite;
}

@keyframes nhl-order-review-spin {
  to {
    transform: rotate(360deg);
  }
}
