/* Cart page and the fallback (non-CheckoutWC) checkout. Filled in Stage 2.
 * CheckoutWC replaces the checkout template entirely when it is active. */

/* Stage 2 — cart, checkout fallback, thank-you, and notices (append-only) */
.woocommerce-cart-form,
.cart-collaterals,
.vow-checkout,
.vow-order-confirmation {
  max-width: 62rem;
  margin-inline: auto;
}

.woocommerce-cart-form {
  overflow-x: auto;
  margin-bottom: 2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.shop_table {
  width: 100%;
  border-collapse: collapse;
  color: var(--ink-soft);
  font-size: .8125rem;
  text-align: left;
}

.shop_table th,
.shop_table td {
  padding: 1rem;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

.shop_table thead th {
  border-top: 0;
  color: var(--ink-muted);
  font-size: .625rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.shop_table .product-remove {
  width: 2.5rem;
  padding-right: 0;
  text-align: center;
}

.shop_table .remove {
  display: inline-grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-muted);
  font-size: 1.25rem;
}

.shop_table .remove:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.shop_table .product-thumbnail {
  width: 5.5rem;
}

.shop_table .product-thumbnail img {
  width: 4rem;
  height: 4rem;
  object-fit: cover;
  border-radius: .5rem;
  background: var(--paper);
}

.shop_table .product-name > a {
  color: var(--ink);
  font-weight: 600;
}

.shop_table .variation {
  margin: .35rem 0 0;
  color: var(--ink-muted);
  font-size: .6875rem;
}

.shop_table .quantity input,
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.coupon .input-text {
  min-height: 2.75rem;
  padding: .65rem .8rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.shop_table .quantity input {
  width: 4.5rem;
  text-align: center;
}

.shop_table .actions {
  text-align: right;
}

.shop_table .coupon {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  float: left;
}

.cart-collaterals {
  display: grid;
  width: 100%;
  justify-items: stretch;
}

.vow-cart-totals {
  width: min(100%, 30rem);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.vow-cart-totals h2,
.vow-checkout h3 {
  margin-bottom: 1rem;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.vow-cart-totals .shop_table th,
.vow-cart-totals .shop_table td {
  padding-inline: 0;
}

.vow-cart-totals .shop_table td {
  text-align: right;
}

.vow-cart-totals .order-total {
  color: var(--ink);
  font-size: 1rem;
}

.wc-proceed-to-checkout {
  padding-top: 1.25rem;
}

.wc-proceed-to-checkout .button {
  width: 100%;
}

.woocommerce-shipping-methods,
.woocommerce-order-overview,
.wc_payment_methods {
  margin: 0;
  padding: 0;
  list-style: none;
}

.vow-checkout__form {
  display: grid;
  gap: 2rem;
}

.vow-checkout__customer,
.vow-checkout__review,
.vow-order-confirmation {
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.vow-checkout__customer .col-1,
.vow-checkout__customer .col-2 {
  min-width: 0;
}

.woocommerce form .form-row {
  margin: 0 0 1rem;
}

.woocommerce form .form-row label {
  display: block;
  margin-bottom: .35rem;
  color: var(--ink-soft);
  font-size: .75rem;
  font-weight: 600;
}

.woocommerce form .form-row .required {
  color: var(--warning);
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
  width: 100%;
}

.woocommerce-checkout-review-order-table,
.woocommerce-table--order-details {
  margin-bottom: 1.5rem;
}

.wc_payment_method {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

#place_order {
  width: 100%;
  margin-top: 1rem;
}

.woocommerce-order-overview {
  display: grid;
  gap: .75rem;
  margin: 1.5rem 0;
}

.woocommerce-order-overview li {
  display: grid;
  gap: .25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: .6875rem;
  text-transform: uppercase;
}

.woocommerce-order-overview strong {
  color: var(--ink);
  font-size: .8125rem;
  text-transform: none;
}

.woocommerce-notices-wrapper {
  padding-top: 1rem;
}

.notice {
  margin: 0 0 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: .625rem;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: .8125rem;
  line-height: 1.55;
  list-style: none;
}

.notice--error {
  border-left-color: var(--warning);
  background: var(--warning-soft);
}

.notice a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: .18em;
}

.return-to-shop {
  text-align: center;
}

@media (max-width: 639px) {
  .shop_table thead {
    display: none;
  }

  .shop_table tr,
  .shop_table td {
    display: block;
  }

  .shop_table tr {
    padding: .75rem;
    border-top: 1px solid var(--line);
  }

  .shop_table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .5rem;
    border: 0;
  }

  .shop_table td[data-title]::before {
    content: attr(data-title);
    color: var(--ink-muted);
    font-size: .625rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  .shop_table .product-thumbnail,
  .shop_table .product-name,
  .shop_table .actions {
    width: auto;
    text-align: left;
  }

  .shop_table .actions,
  .shop_table .coupon {
    display: grid;
    float: none;
  }
}

/* Appended 2026-08-25 (design review 03): cohesive cart controls, quiet line-item
 * metadata, promo disclosure, shipping expectation, and compact grid through 899px. */
.vow-cart-item__strength {
  margin: .35rem 0 0;
  color: var(--ink-muted);
  font-size: .6875rem;
  font-weight: 400;
  line-height: 1.4;
}

.vow-cart-item__price-label {
  display: none;
}

.cart-quantity-control {
  display: inline-grid;
  grid-template-columns: 3rem 3rem 3rem;
  width: max-content;
  height: 3rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.cart-quantity-control button {
  display: grid;
  width: 3rem;
  height: 3rem;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
}

.cart-quantity-control .quantity {
  display: contents;
}

.shop_table .cart-quantity-control .quantity input {
  width: 3rem;
  min-height: 3rem;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  appearance: textfield;
}

.cart-quantity-control .quantity input::-webkit-inner-spin-button,
.cart-quantity-control .quantity input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.cart-quantity-control:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.cart-quantity-control button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}

.vow-cart-promo {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.vow-cart-promo summary {
  width: max-content;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: .75rem;
  font-weight: 600;
}

.vow-cart-promo[open] summary {
  margin-bottom: .75rem;
}

.vow-cart-promo__fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .6rem;
}

.vow-cart-promo__fields .input-text {
  width: 100%;
}

/* Woo's coupon error (moved into the live region by cart.js) reads as an error. */
.vow-cart-promo__feedback {
  grid-column: 1 / -1;
}

.vow-cart-promo__feedback:empty {
  margin-top: -.6rem;
}

.coupon-error-notice {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  margin: 0;
  color: var(--warning);
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1.45;
}

.coupon-error-notice::before {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  margin-top: .1rem;
  background: currentColor;
  content: "";
  -webkit-mask: url("../icons/alert-circle.svg") center / contain no-repeat;
  mask: url("../icons/alert-circle.svg") center / contain no-repeat;
}

.coupon .input-text.has-error,
#coupon_code.has-error {
  border-color: var(--warning);
  box-shadow: inset 0 0 0 1px var(--warning);
}

.vow-cart-coupon-submit {
  pointer-events: none;
}

.vow-shipping-expectation td {
  color: var(--ink-muted);
  font-size: .75rem;
}

@media (max-width: 899px) {
  .vow-cart-form {
    overflow-x: visible;
  }

  .cart-collaterals,
  .vow-cart-totals {
    width: 100%;
    max-width: none;
  }

  .vow-cart-form .shop_table,
  .vow-cart-form .shop_table tbody {
    display: block;
    width: 100%;
  }

  .vow-cart-form .shop_table thead {
    display: none;
  }

  .vow-cart-form .shop_table tr.cart_item {
    position: relative;
    display: grid;
    grid-template-areas:
      "thumbnail name remove"
      "thumbnail price price"
      "thumbnail quantity subtotal";
    grid-template-columns: 4.5rem minmax(0, 1fr) auto;
    gap: .75rem 1rem;
    padding: 1rem;
    border-top: 1px solid var(--line);
  }

  .vow-cart-form .shop_table tr.cart_item:first-child {
    border-top: 0;
  }

  .vow-cart-form .shop_table tr.cart_item > td {
    display: block;
    width: auto;
    padding: 0;
    border: 0;
    text-align: left;
  }

  .vow-cart-form .cart_item .product-thumbnail {
    grid-area: thumbnail;
    align-self: start;
  }

  .vow-cart-form .cart_item .product-name {
    grid-area: name;
    min-width: 0;
    align-self: center;
  }

  .vow-cart-form .cart_item .product-remove {
    grid-area: remove;
    align-self: start;
    justify-self: end;
  }

  .vow-cart-form .cart_item .product-price {
    display: flex;
    grid-area: price;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--ink-soft);
  }

  .vow-cart-form .cart_item .vow-cart-item__price-label {
    display: inline;
    color: var(--ink-muted);
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  .vow-cart-form .cart_item .product-quantity {
    grid-area: quantity;
    align-self: end;
  }

  .vow-cart-form .cart_item .product-subtotal {
    grid-area: subtotal;
    align-self: end;
    justify-self: end;
    color: var(--ink);
    font-weight: 600;
  }

  .vow-cart-form .cart_item td[data-title]::before {
    display: none;
    content: none;
  }

  .vow-cart-form .shop_table tr:not(.cart_item) {
    display: block;
    padding: 1rem;
    border-top: 1px solid var(--line);
  }

  .vow-cart-form .shop_table td.actions {
    display: flex;
    width: auto;
    justify-content: flex-end;
    padding: 0;
    border: 0;
    text-align: right;
  }
}

@media (max-width: 479px) {
  .vow-cart-promo__fields {
    grid-template-columns: 1fr;
  }
}

/* Appended 2026-08-25 (audit 06 polish): keep coupon feedback outside Woo's
 * replaceable totals node and tighten the narrowest cart layouts. */
.cart-collaterals > .vow-cart-promo {
  width: 100%;
  margin-bottom: 0;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.cart-collaterals > .vow-cart-promo + .vow-cart-totals {
  border-top: 0;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}

.vow-cart-reassurance {
  margin-bottom: 1rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.vow-cart-reassurance > svg {
  width: 2rem;
  height: 2rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.vow-cart-reassurance h2 {
  margin-bottom: .75rem;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.vow-cart-reassurance p {
  max-width: 34rem;
  color: var(--ink-muted);
  font-size: .8125rem;
  line-height: 1.65;
}

.vow-cart-reassurance .text-link {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
}

@media (min-width: 900px) {
  .cart-collaterals {
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 30rem);
    grid-template-rows: auto auto;
    column-gap: clamp(1.5rem, 4vw, 3rem);
    align-items: start;
  }

  .cart-collaterals > .vow-cart-reassurance {
    grid-column: 1;
    grid-row: 1 / span 2;
    margin-bottom: 0;
  }

  .cart-collaterals > .vow-cart-promo,
  .cart-collaterals > .vow-cart-totals {
    grid-column: 2;
  }
}

@media (max-width: 639px) {
  .vow-cart-totals .shop_table th {
    display: none;
  }

  .vow-cart-form .shop_table tr.cart_item {
    grid-template-areas:
      "thumbnail name"
      "thumbnail price"
      "quantity subtotal";
    grid-template-columns: 4rem minmax(0, 1fr);
    padding-top: 1.25rem;
  }

  .vow-cart-form .cart_item .product-name {
    padding-right: 2.75rem;
  }

  .vow-cart-form .cart_item .product-remove {
    position: absolute;
    top: .5rem;
    right: .5rem;
  }

  .vow-cart-totals .shipping td {
    display: grid;
    justify-items: stretch;
    gap: .5rem;
    text-align: left;
  }

  .vow-cart-totals .shipping td::before,
  .vow-cart-totals .shipping td > * {
    display: block;
    width: 100%;
  }

  .vow-cart-totals .shipping .shipping-calculator-button {
    display: inline-flex;
    width: auto;
    min-height: 2.75rem;
    align-items: center;
  }
}

@media (max-width: 479px) {
  .vow-cart-form .shop_table tr.cart_item {
    grid-template-columns: 3.5rem minmax(0, 1fr);
    column-gap: .625rem;
  }

  .vow-cart-form .cart_item .product-thumbnail img {
    width: 3.5rem;
    height: 3.5rem;
  }

  .vow-cart-form .cart-quantity-control {
    grid-template-columns: repeat(3, 2.75rem);
    height: 2.75rem;
  }

  .vow-cart-form .cart-quantity-control button {
    width: 2.75rem;
    height: 2.75rem;
  }

  .vow-cart-form .cart-quantity-control .quantity input {
    width: 2.75rem;
    min-height: 2.75rem;
  }
}

/* Classic checkout review: Woo's item-data rows (vial content, bulk pricing) read as quiet
 * "Label: value" lines, like the cart's strength line, instead of an indented list. */
.woocommerce-checkout-review-order-table dl.variation dt,
.woocommerce-checkout-review-order-table dl.variation dd,
.woocommerce-checkout-review-order-table dl.variation dd p {
  display: inline;
  margin: 0;
  font-weight: 400;
}

.woocommerce-checkout-review-order-table dl.variation dd::after {
  content: "";
  display: block;
}
