/* ============================================================
   CART & CHECKOUT — classic shortcode styling
   Targets WooCommerce's stable, long-documented classic CSS
   classes (form-checkout.php / cart.php), NOT the newer block
   markup, since WooCommerce itself warns the block internals
   may change without notice.
   ============================================================ */

/* ---------- shared page wrapper ---------- */
.woocommerce-cart .entry-content,
.woocommerce-checkout .entry-content,
.woocommerce-cart main#main-content,
.woocommerce-checkout main#main-content {
  max-width: 1300px;
  margin: 0 auto;
  padding: 40px 64px 90px;
}
.woocommerce-cart h1.entry-title,
.woocommerce-checkout h1.entry-title,
.woocommerce-cart .page-title,
.woocommerce-checkout .page-title {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: clamp(32px, 4vw, 46px);
  margin-bottom: 36px;
}

/* ---------- notices ---------- */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  list-style: none;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--maroon);
  background: var(--ivory-deep);
  font-size: 14px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.woocommerce-message .button,
.woocommerce-error .button {
  background: var(--ink);
  color: var(--ivory);
  padding: 10px 20px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.woocommerce-message .button:hover,
.woocommerce-error .button:hover { background: var(--maroon); }

/* ============================================================
   CART TABLE
   ============================================================ */
table.shop_table.cart {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 40px;
}
table.shop_table.cart thead th {
  text-align: left;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(26,20,16,0.5);
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
table.shop_table.cart tbody td {
  padding: 24px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 14.5px;
}
table.shop_table.cart tbody td.product-remove { width: 40px; text-align: center; }
table.shop_table.cart tbody td.product-remove a {
  color: rgba(26,20,16,0.4);
  font-size: 20px;
  text-decoration: none;
  transition: color 0.2s;
}
table.shop_table.cart tbody td.product-remove a:hover { color: var(--maroon); }
table.shop_table.cart td.product-thumbnail img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  display: block;
}
table.shop_table.cart td.product-name a {
  color: var(--ink);
  text-decoration: none;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 16px;
}
table.shop_table.cart td.product-name a:hover { color: var(--maroon); }
table.shop_table.cart .variation {
  font-size: 12.5px;
  color: rgba(26,20,16,0.5);
  margin-top: 6px;
}
table.shop_table.cart .variation p { margin: 2px 0; }
table.shop_table.cart td.product-price,
table.shop_table.cart td.product-subtotal {
  font-family: 'Fraunces', serif;
  font-size: 15px;
}

/* quantity stepper input */
.quantity .qty {
  width: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--ivory);
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  text-align: center;
}

/* update cart / coupon row */
.cart_totals .actions,
.cart-collaterals ~ p.form-row,
table.shop_table.cart + .actions,
.woocommerce-cart-form .actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  flex-wrap: wrap;
  gap: 16px;
}
.woocommerce-cart-form .coupon {
  display: flex;
  gap: 10px;
  align-items: center;
}
.woocommerce-cart-form .coupon input#coupon_code {
  padding: 13px 16px;
  border: 1px solid var(--line);
  background: var(--ivory);
  font-family: 'Jost', sans-serif;
  font-size: 13.5px;
  width: 200px;
}
.woocommerce-cart-form .coupon input#coupon_code:focus { border-color: var(--maroon); outline: none; }

/* generic buttons across cart/checkout */
.woocommerce-cart .button,
.woocommerce-checkout .button,
#place_order,
.checkout-button,
button.checkout,
input#place_order {
  background: var(--ink) !important;
  color: var(--ivory) !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 16px 30px !important;
  font-size: 13px !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  font-family: 'Jost', sans-serif !important;
  transition: background 0.3s !important;
  box-shadow: none !important;
  height: auto !important;
}
.woocommerce-cart .button:hover,
.woocommerce-checkout .button:hover,
#place_order:hover,
button.checkout:hover {
  background: var(--maroon) !important;
}
.woocommerce-cart a.button.wc-forward,
a.shipping-calculator-button {
  background: none !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
  padding: 15px 28px !important;
}
.woocommerce-cart a.button.wc-forward:hover {
  border-color: var(--maroon) !important;
  color: var(--maroon) !important;
}

/* ---------- cart totals sidebar ---------- */
.cart_totals,
.cross-sells {
  border: 1px solid var(--line);
  padding: 28px;
  margin-top: 0;
}
.cart_totals h2,
.cross-sells h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 22px;
  margin-bottom: 20px;
}
.cart_totals table.shop_table {
  width: 100%;
}
.cart_totals table.shop_table th,
.cart_totals table.shop_table td {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.cart_totals table.shop_table th { color: rgba(26,20,16,0.55); font-weight: 400; text-align: left; }
.cart_totals table.shop_table .order-total th,
.cart_totals table.shop_table .order-total td {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  border-bottom: none;
  padding-top: 18px;
}
.cart_totals .woocommerce-shipping-methods { list-style: none; margin: 0; padding: 0; }
.cart_totals .woocommerce-shipping-methods li { font-size: 13.5px; margin-bottom: 6px; }

/* ============================================================
   CHECKOUT PAGE
   ============================================================ */
form.woocommerce-checkout #customer_details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
}
.woocommerce-billing-fields h3,
.woocommerce-shipping-fields h3,
.woocommerce-additional-fields h3,
#order_review_heading {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 20px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.woocommerce-checkout .form-row { margin-bottom: 18px; }
.woocommerce-checkout .form-row label {
  display: block;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: rgba(26,20,16,0.6);
  margin-bottom: 6px;
}
.woocommerce-checkout .form-row .required {
  color: var(--maroon);
  text-decoration: none;
}
.woocommerce-checkout input[type="text"],
.woocommerce-checkout input[type="email"],
.woocommerce-checkout input[type="tel"],
.woocommerce-checkout input[type="password"],
.woocommerce-checkout textarea,
.woocommerce-checkout select,
.select2-container .select2-selection--single {
  width: 100%;
  padding: 13px 16px !important;
  border: 1px solid var(--line) !important;
  background: var(--ivory) !important;
  font-family: 'Jost', sans-serif !important;
  font-size: 14px !important;
  color: var(--ink) !important;
  border-radius: 0 !important;
  height: auto !important;
  box-shadow: none !important;
}
.woocommerce-checkout input:focus,
.woocommerce-checkout textarea:focus,
.woocommerce-checkout select:focus {
  border-color: var(--maroon) !important;
  outline: none !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 44px !important;
  padding-left: 0 !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 46px !important;
}

/* order review table on checkout */
#order_review {
  border: 1px solid var(--line);
  padding: 28px;
  align-self: start;
}
table.woocommerce-checkout-review-order-table {
  width: 100%;
  margin-bottom: 20px;
}
table.woocommerce-checkout-review-order-table th,
table.woocommerce-checkout-review-order-table td {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  text-align: left;
}
table.woocommerce-checkout-review-order-table thead th {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(26,20,16,0.5);
  font-weight: 500;
}
table.woocommerce-checkout-review-order-table .product-name {
  font-family: 'Fraunces', serif;
  font-style: italic;
}
table.woocommerce-checkout-review-order-table .order-total th,
table.woocommerce-checkout-review-order-table .order-total td {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  border-bottom: none;
}

/* payment methods */
#payment {
  background: var(--ivory-deep) !important;
  border: 1px solid var(--line) !important;
  border-radius: 0 !important;
  padding: 24px !important;
}
#payment ul.payment_methods {
  border-bottom: 1px solid var(--line) !important;
  padding-bottom: 16px;
  margin-bottom: 16px;
  list-style: none;
}
#payment ul.payment_methods li {
  padding: 10px 0;
  font-size: 14px;
}
#payment .payment_box {
  background: var(--ivory) !important;
  border: 1px solid var(--line);
  padding: 16px;
  font-size: 13.5px;
  margin-top: 10px;
}
#payment .payment_box::before { display: none !important; }

/* place order button, full width */
#place_order { width: 100%; margin-top: 10px !important; }

/* order notes */
.woocommerce-additional-fields textarea { min-height: 90px; }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .woocommerce-cart .entry-content,
  .woocommerce-checkout .entry-content,
  .woocommerce-cart main#main-content,
  .woocommerce-checkout main#main-content {
    padding: 30px 20px 60px;
  }
  form.woocommerce-checkout #customer_details {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  table.shop_table.cart thead { display: none; }
  table.shop_table.cart tbody tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "remove thumb price"
      "remove name price"
      "remove qty price";
    gap: 6px 14px;
    align-items: center;
    padding: 16px 0;
  }
  table.shop_table.cart td { padding: 4px 0; border-bottom: none; }
  table.shop_table.cart tbody tr { border-bottom: 1px solid var(--line); }
  .woocommerce-cart-form .actions { flex-direction: column; align-items: stretch; }
  .woocommerce-cart-form .coupon { flex-direction: column; align-items: stretch; }
  .woocommerce-cart-form .coupon input#coupon_code { width: 100%; }
}
