/* STX cart shell + classic cart skin.
 * Shell: body.stx-cart-page / .stx-woocommerce--cart-full (classic OR Cart block).
 * Table skin: body.stx-classic-cart only.
 * Colors are EXPLICIT — do not inherit dark storefront globals.
 */

body.stx-cart-page,
body.stx-classic-cart {
  --stx-cart-bg: #f4f5f7;
  --stx-cart-card: #ffffff;
  --stx-cart-ink: #17202a;
  --stx-cart-muted: #5f6975;
  --stx-cart-line: #d6dbe1;
  --stx-cart-blue: #1f628f;
  --stx-cart-blue-dark: #174b6e;
  --stx-cart-navy: #0d2137;
  --stx-cart-orange: #f57c00;
  --stx-cart-orange-dark: #db6e00;
  --stx-cart-max: 1440px;
  --stx-cart-gutter: 24px;
  overflow-x: clip;
}

/* ——— Full-width light shell (escapes glass-card / max-w-4xl) ——— */
body.stx-cart-page .stx-woocommerce.stx-woocommerce--cart-full,
body.stx-classic-cart .stx-woocommerce.stx-woocommerce--cart-full,
body.stx-cart-page .stx-cart-page-wrap,
body.stx-classic-cart .stx-cart-page-wrap,
.stx-woocommerce--cart-full,
.stx-cart-page-wrap {
  max-width: none !important;
  width: 100%;
  margin: 0;
  padding: 0;
  background: var(--stx-cart-bg, #f4f5f7);
  color: var(--stx-cart-ink, #17202a);
}

body.stx-cart-page .stx-woocommerce > .stx-container,
body.stx-classic-cart .stx-woocommerce > .stx-container {
  max-width: none;
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

body.stx-cart-page .stx-woocommerce.stx-woocommerce--cart-full,
body.stx-classic-cart .stx-woocommerce.stx-woocommerce--cart-full {
  padding-top: 0;
  padding-bottom: 2rem;
  background: var(--stx-cart-bg);
  color: var(--stx-cart-ink);
}

body.stx-cart-page .stx-cart-page-inner,
body.stx-classic-cart .stx-cart-page-inner {
  max-width: var(--stx-cart-max);
  width: 100%;
  margin: 0 auto;
  padding: 32px var(--stx-cart-gutter) 56px;
  box-sizing: border-box;
  background: transparent;
  color: var(--stx-cart-ink);
}

body.stx-cart-page .stx-cart-page-title,
body.stx-classic-cart .stx-cart-page-title {
  font-family: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  font-weight: 400;
  letter-spacing: 0.04em;
  font-size: clamp(2rem, 4vw, 2.75rem); /* ~32–44px */
  line-height: 1.1;
  margin: 0 0 1.25rem;
  color: var(--stx-cart-navy);
  text-transform: uppercase;
}

/* Escape legacy page.php glass-card / max-w-4xl if body class applied late. */
body.stx-cart-page section.max-w-4xl,
body.stx-classic-cart section.max-w-4xl,
body.stx-cart-page .glass-card,
body.stx-classic-cart .glass-card {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--stx-cart-ink) !important;
}

body.stx-cart-page .glass-card h1,
body.stx-classic-cart .glass-card h1,
body.stx-cart-page .glass-card .text-white,
body.stx-classic-cart .glass-card .text-white {
  color: var(--stx-cart-navy) !important;
}

/* Cart block empty / filled surfaces stay light inside the shell */
body.stx-cart-page .wp-block-woocommerce-cart,
body.stx-cart-page .wc-block-cart,
body.stx-cart-page .wc-block-components-sidebar-layout {
  color: var(--stx-cart-ink);
  max-width: 100%;
}

body.stx-cart-page .wc-block-cart__empty-cart__title,
body.stx-cart-page .wc-block-cart-items,
body.stx-cart-page .wc-block-components-product-name,
body.stx-cart-page .wc-block-components-totals-item__label,
body.stx-cart-page .wc-block-components-totals-footer-item {
  color: var(--stx-cart-ink);
}

body.stx-cart-page .wc-block-cart__submit-button,
body.stx-cart-page .wc-block-components-button:not(.is-link) {
  background: var(--stx-cart-orange) !important;
  border-color: var(--stx-cart-orange) !important;
  color: #fff !important;
  min-height: 48px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ——— Classic shortcode table cart ——— */
body.stx-classic-cart .stx-cart-page-inner > .woocommerce,
body.stx-classic-cart .stx-cart-page-inner .woocommerce-cart,
body.stx-classic-cart .woocommerce,
body.stx-classic-cart .woocommerce-cart {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  color: var(--stx-cart-ink);
  background: transparent;
}

body.stx-classic-cart .woocommerce-cart-form,
body.stx-classic-cart .cart-collaterals {
  max-width: 100%;
}

/* Two-column desktop: products ~65% / totals ~35% */
body.stx-classic-cart .woocommerce {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(280px, 1fr);
  gap: 32px;
  align-items: start;
}

body.stx-classic-cart .woocommerce-notices-wrapper,
body.stx-classic-cart .woocommerce-cart-form {
  grid-column: 1;
}

body.stx-classic-cart .cart-collaterals {
  grid-column: 2;
  grid-row: 1 / span 3;
}

/* Sticky totals: desktop only; capped so Estimated Total / CTA are not clipped */
@media (min-width: 1101px) {
  body.stx-classic-cart .cart-collaterals {
    position: sticky;
    top: calc(var(--stx-header-offset, 7.5rem) + 8px);
    max-height: calc(100dvh - var(--stx-header-offset, 7.5rem) - 24px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* If the panel is taller than the viewport, fall back to static flow */
  body.stx-classic-cart .cart-collaterals.is-stx-cart-tall {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

body.stx-classic-cart .woocommerce-cart-form__contents,
body.stx-classic-cart table.shop_table.cart {
  width: 100%;
  border-collapse: collapse;
  background: var(--stx-cart-card);
  border: 1px solid var(--stx-cart-line);
  border-radius: 2px;
}

body.stx-classic-cart table.shop_table.cart th {
  font-family: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  font-weight: 400;
  letter-spacing: 0.04em;
  font-size: 16px;
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--stx-cart-line);
  color: var(--stx-cart-ink);
  background: #eef1f4;
}

body.stx-classic-cart table.shop_table.cart td {
  padding: 16px;
  border-bottom: 1px solid var(--stx-cart-line);
  vertical-align: middle;
  color: var(--stx-cart-ink);
  background: var(--stx-cart-card);
}

body.stx-classic-cart table.shop_table.cart tr:last-child td {
  border-bottom: 0;
}

body.stx-classic-cart .product-thumbnail img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  display: block;
  background: #fff;
  border: 1px solid var(--stx-cart-line);
}

/* Linked name is the title; hide duplicate bare text / second link */
body.stx-classic-cart .product-name {
  font-size: 0;
  line-height: 0;
}

body.stx-classic-cart .product-name > a,
body.stx-classic-cart .product-name .variation,
body.stx-classic-cart .product-name dl,
body.stx-classic-cart .product-name .wc-item-meta,
body.stx-classic-cart .product-name .product-quantity {
  font-size: 15px;
  line-height: 1.35;
}

body.stx-classic-cart .product-name > a {
  color: var(--stx-cart-ink);
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}

body.stx-classic-cart .product-name a + a,
body.stx-classic-cart .product-name .stx-cart-name-dup {
  display: none !important;
}

body.stx-classic-cart .product-name > a:hover,
body.stx-classic-cart .product-name > a:focus-visible {
  color: var(--stx-cart-blue);
}

body.stx-classic-cart .product-remove a.remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 2px;
  border: 1px solid var(--stx-cart-line);
  background: #fff;
  color: var(--stx-cart-navy) !important;
  font-size: 22px;
  line-height: 1;
  text-decoration: none;
}

body.stx-classic-cart .product-remove a.remove:hover,
body.stx-classic-cart .product-remove a.remove:focus-visible {
  border-color: #c2410c;
  color: #c2410c !important;
  background: #fff7ed;
}

body.stx-classic-cart .product-quantity .qty,
body.stx-classic-cart .quantity .qty {
  width: 4.5rem;
  min-height: 44px;
  padding: 0 8px;
  border: 1px solid var(--stx-cart-line);
  border-radius: 2px;
  text-align: center;
  box-sizing: border-box;
  background: #fff;
  color: var(--stx-cart-ink);
  font-size: 16px;
  font-weight: 600;
}

body.stx-classic-cart .product-quantity .qty:focus,
body.stx-classic-cart .quantity .qty:focus {
  outline: 2px solid var(--stx-cart-blue);
  outline-offset: 2px;
}

body.stx-classic-cart .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 16px !important;
  background: var(--stx-cart-card);
  border: 1px solid var(--stx-cart-line);
  border-top: 0;
}

body.stx-classic-cart .coupon {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

body.stx-classic-cart details.stx-cart-coupon {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--stx-cart-line);
  border-radius: 2px;
  background: #fff;
  padding: 0;
}

body.stx-classic-cart details.stx-cart-coupon > summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--stx-cart-blue);
  min-height: 44px;
  display: flex;
  align-items: center;
}

body.stx-classic-cart details.stx-cart-coupon > summary::-webkit-details-marker {
  display: none;
}

body.stx-classic-cart details.stx-cart-coupon[open] > summary {
  border-bottom: 1px solid var(--stx-cart-line);
}

body.stx-classic-cart details.stx-cart-coupon .coupon {
  padding: 12px 14px 14px;
}

body.stx-classic-cart .coupon .input-text {
  min-height: 44px;
  min-width: 160px;
  padding: 0 12px;
  border: 1px solid var(--stx-cart-line);
  border-radius: 2px;
  box-sizing: border-box;
  background: #fff;
  color: var(--stx-cart-ink);
}

body.stx-classic-cart .button,
body.stx-classic-cart button.button,
body.stx-classic-cart a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 2px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  box-sizing: border-box;
}

body.stx-classic-cart .button[name="update_cart"],
body.stx-classic-cart button[name="update_cart"] {
  background: #fff;
  border-color: var(--stx-cart-ink);
  color: var(--stx-cart-ink);
}

body.stx-classic-cart .coupon .button {
  background: var(--stx-cart-blue);
  border-color: var(--stx-cart-blue);
  color: #fff !important;
  min-height: 44px;
}

body.stx-classic-cart .coupon .button:hover {
  background: var(--stx-cart-blue-dark);
  border-color: var(--stx-cart-blue-dark);
}

/* Proceed CTA — full-width orange, not muted gray */
body.stx-classic-cart .wc-proceed-to-checkout .checkout-button,
body.stx-classic-cart a.checkout-button {
  display: inline-flex;
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  background: var(--stx-cart-orange) !important;
  border: 2px solid var(--stx-cart-orange) !important;
  color: #fff !important;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}

body.stx-classic-cart .wc-proceed-to-checkout .checkout-button:hover,
body.stx-classic-cart a.checkout-button:hover,
body.stx-classic-cart .wc-proceed-to-checkout .checkout-button:focus-visible,
body.stx-classic-cart a.checkout-button:focus-visible {
  background: var(--stx-cart-orange-dark) !important;
  border-color: var(--stx-cart-orange-dark) !important;
  color: #fff !important;
}

body.stx-classic-cart .cart_totals {
  background: var(--stx-cart-card);
  border: 1px solid var(--stx-cart-line);
  border-radius: 2px;
  padding: 20px;
  max-width: 100%;
  box-sizing: border-box;
  color: var(--stx-cart-ink);
}

body.stx-classic-cart .cart_totals h2 {
  font-family: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  font-weight: 400;
  letter-spacing: 0.04em;
  font-size: 28px;
  margin: 0 0 14px;
  color: var(--stx-cart-navy);
  text-transform: uppercase;
}

body.stx-classic-cart .cart_totals table {
  width: 100%;
  border-collapse: collapse;
}

body.stx-classic-cart .cart_totals th,
body.stx-classic-cart .cart_totals td {
  padding: 10px 0;
  border-bottom: 1px solid var(--stx-cart-line);
  font-size: 14px;
  color: var(--stx-cart-ink);
  vertical-align: top;
  background: transparent;
}

body.stx-classic-cart .cart_totals th {
  font-weight: 600;
  text-align: left;
  width: 40%;
}

body.stx-classic-cart .cart_totals td {
  text-align: right;
}

body.stx-classic-cart .cart_totals .order-total th,
body.stx-classic-cart .cart_totals .order-total td {
  font-weight: 800;
  font-size: 16px;
  border-bottom: 0;
  padding-top: 14px;
  color: var(--stx-cart-navy);
}

/* Shipping radios — one clean list; method label includes cost */
body.stx-classic-cart .cart_totals #shipping_method,
body.stx-classic-cart .woocommerce-shipping-methods {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

body.stx-classic-cart .cart_totals #shipping_method li {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--stx-cart-line);
  background: #fff;
  border-radius: 2px;
}

body.stx-classic-cart .cart_totals #shipping_method label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.35;
  width: 100%;
  color: var(--stx-cart-ink);
  min-height: 44px;
}

body.stx-classic-cart .cart_totals #shipping_method .amount,
body.stx-classic-cart .cart_totals #shipping_method .woocommerce-Price-amount {
  margin-left: auto;
  font-weight: 700;
  white-space: nowrap;
}

/* Hide duplicate "Shipping" th / data-title echo — method label carries the row */
body.stx-classic-cart .cart_totals .woocommerce-shipping-totals > th {
  font-size: 0 !important;
  width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  color: transparent !important;
}

body.stx-classic-cart .cart_totals .woocommerce-shipping-totals > td {
  text-align: left;
  width: 100%;
}

body.stx-classic-cart .cart_totals .woocommerce-shipping-totals > td::before,
body.stx-classic-cart .cart_totals .woocommerce-shipping-totals > th::before {
  content: none !important;
  display: none !important;
}

body.stx-classic-cart .cart_totals .woocommerce-shipping-destination {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--stx-cart-muted);
}

body.stx-classic-cart .cart_totals .woocommerce-shipping-totals .shipping-calculator-button {
  color: var(--stx-cart-blue);
}

body.stx-classic-cart .cart_totals #shipping_method input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--stx-cart-orange);
}

body.stx-classic-cart .wc-proceed-to-checkout {
  margin-top: 16px;
}

body.stx-classic-cart .cross-sells {
  grid-column: 1 / -1;
  margin-top: 12px;
}

body.stx-classic-cart .stx-compliance-banner--spaced {
  grid-column: 1 / -1;
  margin: 24px 0 0;
  max-width: none;
}

body.stx-cart-page .stx-footer-cta,
body.stx-classic-cart .stx-footer-cta,
body.stx-cart-page .stx-footer-service-band,
body.stx-classic-cart .stx-footer-service-band,
body.stx-cart-page .stx-footer-newsletter-panel,
body.stx-classic-cart .stx-footer-newsletter-panel {
  display: none !important;
}

@media (max-width: 1100px) and (min-width: 768px) {
  body.stx-classic-cart .woocommerce {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.85fr);
    gap: 28px;
  }

  body.stx-classic-cart .cart-collaterals {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

/* Mobile / tablet: stack; card rows; no sticky; no horizontal scroll */
@media (max-width: 767px) {
  body.stx-cart-page,
  body.stx-classic-cart {
    --stx-cart-gutter: 16px;
  }

  body.stx-cart-page .stx-cart-page-inner,
  body.stx-classic-cart .stx-cart-page-inner {
    width: 100%;
    padding: 20px var(--stx-cart-gutter) 40px;
  }

  body.stx-cart-page .stx-cart-page-title,
  body.stx-classic-cart .stx-cart-page-title {
    font-size: 2rem;
  }

  body.stx-classic-cart .stx-cart-page-inner > .woocommerce,
  body.stx-classic-cart .woocommerce,
  body.stx-classic-cart .woocommerce-cart {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  body.stx-classic-cart .woocommerce {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  body.stx-classic-cart .woocommerce-notices-wrapper,
  body.stx-classic-cart .woocommerce-cart-form,
  body.stx-classic-cart .cart-collaterals {
    grid-column: auto;
    grid-row: auto;
    width: 100%;
  }

  body.stx-classic-cart .cart-collaterals {
    position: static;
    order: 2;
    max-height: none;
    overflow: visible;
  }

  body.stx-classic-cart .woocommerce-cart-form {
    order: 1;
  }

  body.stx-classic-cart table.shop_table.cart,
  body.stx-classic-cart table.shop_table.cart thead,
  body.stx-classic-cart table.shop_table.cart tbody,
  body.stx-classic-cart table.shop_table.cart th,
  body.stx-classic-cart table.shop_table.cart td,
  body.stx-classic-cart table.shop_table.cart tr {
    display: block;
    width: 100%;
  }

  body.stx-classic-cart table.shop_table.cart thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }

  body.stx-classic-cart table.shop_table.cart {
    border: 0;
    background: transparent;
  }

  body.stx-classic-cart table.shop_table.cart tr.woocommerce-cart-form__cart-item,
  body.stx-classic-cart table.shop_table.cart tr.cart_item {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    grid-template-areas:
      "thumb name remove"
      "thumb qty price"
      "meta meta meta";
    gap: 8px 12px;
    padding: 14px;
    margin-bottom: 12px;
    background: var(--stx-cart-card);
    border: 1px solid var(--stx-cart-line);
    border-radius: 2px;
    box-sizing: border-box;
  }

  body.stx-classic-cart table.shop_table.cart td {
    padding: 0;
    border: 0;
  }

  body.stx-classic-cart table.shop_table.cart td.product-thumbnail {
    grid-area: thumb;
  }

  body.stx-classic-cart table.shop_table.cart td.product-name {
    grid-area: name;
    min-width: 0;
  }

  body.stx-classic-cart table.shop_table.cart td.product-remove {
    grid-area: remove;
    justify-self: end;
  }

  body.stx-classic-cart table.shop_table.cart td.product-quantity {
    grid-area: qty;
  }

  body.stx-classic-cart table.shop_table.cart td.product-price,
  body.stx-classic-cart table.shop_table.cart td.product-subtotal {
    grid-area: price;
    text-align: right;
    font-weight: 600;
    align-self: center;
    font-size: 15px;
  }

  body.stx-classic-cart table.shop_table.cart td.product-price {
    display: none;
  }

  body.stx-classic-cart .product-thumbnail img {
    width: 64px;
    height: 64px;
  }

  body.stx-classic-cart table.shop_table.cart tr.woocommerce-cart-form__cart-item td.actions,
  body.stx-classic-cart table.shop_table.cart .actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px !important;
    margin-top: 4px;
    border: 1px solid var(--stx-cart-line);
  }

  body.stx-classic-cart .coupon {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  body.stx-classic-cart .coupon .input-text,
  body.stx-classic-cart .coupon .button,
  body.stx-classic-cart .button[name="update_cart"],
  body.stx-classic-cart button[name="update_cart"],
  body.stx-classic-cart .wc-proceed-to-checkout .checkout-button,
  body.stx-classic-cart a.checkout-button {
    width: 100%;
    min-width: 0;
  }

  body.stx-classic-cart .cart_totals {
    padding: 16px;
  }

  body.stx-classic-cart .cart_totals h2 {
    font-size: 24px;
  }

  body.stx-classic-cart .cart_totals th,
  body.stx-classic-cart .cart_totals td {
    display: block;
    width: 100%;
    text-align: left;
  }

  body.stx-classic-cart .cart_totals td {
    text-align: left;
    padding-top: 4px;
    padding-bottom: 12px;
  }

  body.stx-classic-cart .cart_totals .woocommerce-shipping-totals > th {
    display: none !important;
  }

  body.stx-classic-cart .cart_totals #shipping_method label {
    font-size: 14px;
  }
}

@media (max-width: 375px) {
  body.stx-classic-cart table.shop_table.cart tr.woocommerce-cart-form__cart-item,
  body.stx-classic-cart table.shop_table.cart tr.cart_item {
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-areas:
      "thumb name"
      "thumb remove"
      "qty qty"
      "price price"
      "meta meta";
  }

  body.stx-classic-cart table.shop_table.cart td.product-remove {
    justify-self: start;
  }

  body.stx-classic-cart table.shop_table.cart td.product-price,
  body.stx-classic-cart table.shop_table.cart td.product-subtotal {
    text-align: left;
  }

  body.stx-classic-cart .quantity .qty,
  body.stx-classic-cart .button,
  body.stx-classic-cart a.checkout-button {
    min-height: 44px;
  }

  body.stx-classic-cart a.checkout-button {
    min-height: 48px;
  }
}
