/* ESTA — bespoke Stripe-style checkout (Hebrew, Snow & Sage).
   Styles the classic WooCommerce checkout inside the bare template-checkout.php
   shell. Depends on tokens.css (var(--esta-*)). No WC template overrides, so the
   functional wrappers (.woocommerce-checkout-review-order-table, #payment) stay
   intact and AJAX update_checkout keeps working. */

body.esta-checkout-page,
body.esta-shell-page {
  margin: 0;
  background: var(--esta-bg-2);
  font-family: var(--esta-font);
  color: var(--esta-ink);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}
.esta-checkout-page *,
.esta-shell-page * { box-sizing: border-box; }

/* Focus is never invisible on a page where people are typing card details. */
.esta-checkout-page :focus-visible,
.esta-shell-page :focus-visible { outline: 2px solid var(--esta-focus); outline-offset: 2px; border-radius: 4px; }

/* ---- Top bar ---- */
.esta-co-top {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--esta-border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.esta-co-top__inner {
  max-width: 1080px;
  margin: 0 auto;
  height: 66px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.esta-co-back,
.esta-co-secure {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--esta-ink-soft);
  text-decoration: none;
  flex: 1;
}
.esta-co-secure { justify-content: flex-end; color: var(--esta-sage-deep); }
.esta-co-back { transition: color 0.2s; }
.esta-co-back:hover { color: var(--esta-ink); }
.esta-co-logo { display: inline-flex; align-items: center; gap: 9px; line-height: 1; text-decoration: none; }
.esta-co-logo__spine {
  width: 13px; height: 40px; flex-shrink: 0;
  background: var(--esta-sage);
  mask-repeat: no-repeat; mask-position: center; mask-size: contain;
  -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; -webkit-mask-size: contain;
}
.esta-co-logo__text { display: block; text-align: center; }
.esta-co-logo__mark { display: block; font-family: var(--esta-font-display); font-size: 22px; font-weight: 800; color: var(--esta-ink); letter-spacing: 3.5px; }
.esta-co-logo__sub { display: block; font-size: 8.5px; font-weight: 700; letter-spacing: 2.4px; text-transform: uppercase; color: var(--esta-sage); margin-top: 3px; }

/* Card marks under the pay button */
.esta-co-cards { display: inline-flex; gap: 6px; justify-content: center; }
.esta-co-cards svg { border-radius: 4px; box-shadow: var(--esta-shadow-xs); }

/* ---- Page wrap ---- */
.esta-co__inner { max-width: 1080px; margin: 0 auto; padding: 40px 24px 72px; }

/* Policy links above the form (esta_checkout_legal_links) */
.esta-co-docs { margin: 0 0 22px; font-size: 13px; line-height: 1.8; color: var(--esta-ink-soft); background: var(--esta-mint-2); border: 1px solid var(--esta-border); border-radius: var(--esta-r-md); padding: 10px 14px; }
.esta-co-docs a, .esta-co .woocommerce-privacy-policy-text a { color: var(--esta-sage-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* Empty cart (template-checkout.php) */
.esta-co-empty { min-height: 46vh; display: flex; align-items: center; justify-content: center; text-align: center; }
.esta-co-empty__msg h1 { font-family: var(--esta-font-display); font-size: 32px; font-weight: 800; color: var(--esta-ink); }
.esta-co-empty__msg p { margin: 12px 0 24px; font-size: 15px; color: var(--esta-ink-soft); }
.esta-co-empty__btn { display: inline-flex; align-items: center; justify-content: center; padding: 15px 34px; border-radius: var(--esta-r-pill); background: var(--esta-grad-sage); color: #fff !important; font-weight: 800; font-size: 16px; text-decoration: none; box-shadow: 0 12px 26px -10px rgba(20, 168, 90, 0.6); }
.esta-co-empty__loading { display: none; font-size: 15px; color: var(--esta-ink-soft); }
.esta-co-recovering .esta-co-empty__loading { display: block; }
.esta-co-recovering .esta-co-empty__msg { display: none; }
.esta-co .woocommerce { direction: rtl; }
.esta-co h1.entry-title, .esta-co .page-title { display: none; }

/* notices */
.esta-co .woocommerce-notices-wrapper:empty { display: none; }
.esta-co .woocommerce-error,
.esta-co .woocommerce-message,
.esta-co .woocommerce-info {
  border-radius: var(--esta-r-md);
  border: 1px solid var(--esta-border);
  border-inline-start: 3px solid var(--esta-sage);
  background: #fff;
  box-shadow: var(--esta-shadow-xs);
  font-size: 14px;
  list-style: none;
  margin: 0 0 18px;
  padding: 14px 18px;
}
.esta-co .woocommerce-error { border-inline-start-color: var(--esta-sale); }

/* hide the "returning customer / login" prompt — guest checkout, Stripe-clean */
.esta-co .woocommerce-form-login-toggle,
.esta-co form.login,
.esta-co .woocommerce-form--login { display: none !important; }

/* coupon toggle → slim subtle line */
.esta-co .woocommerce-form-coupon-toggle .woocommerce-info {
  border: 1px dashed var(--esta-border-strong);
  border-inline-start-width: 1px;
  text-align: center;
  color: var(--esta-ink-soft);
  background: transparent;
  box-shadow: none;
}
.esta-co .woocommerce-form-coupon-toggle .woocommerce-info a { color: var(--esta-sage-deep); font-weight: 700; }
.esta-co form.checkout_coupon {
  border: 1px solid var(--esta-border) !important;
  border-radius: var(--esta-r-lg);
  padding: 18px;
  background: #fff;
  box-shadow: var(--esta-shadow-xs);
}

/* ---- The two-panel layout ---- */
.esta-co form.checkout.woocommerce-checkout {
  display: grid;
  grid-template-columns: 1.12fr 0.9fr;
  gap: 30px;
  align-items: start;
}
.esta-co #customer_details { grid-column: 1; grid-row: 1 / span 2; min-width: 0; } /* right (RTL) */
.esta-co #order_review_heading { display: none; }
.esta-co #order_review { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 92px; min-width: 0; }

/* stack billing + notes vertically inside the form column */
.esta-co #customer_details .col-1,
.esta-co #customer_details .col-2 { width: 100%; float: none; padding: 0; }
.esta-co #customer_details > .clear { display: none; }

/* form card */
.esta-co .woocommerce-billing-fields {
  background: #fff;
  border: 1px solid var(--esta-border);
  border-radius: var(--esta-r-xl);
  box-shadow: var(--esta-shadow-sm);
  padding: 28px;
}
.esta-co .woocommerce-billing-fields > h3 {
  font-family: var(--esta-font-display);
  font-size: 21px;
  font-weight: 800;
  color: var(--esta-ink);
  margin: 0 0 20px;
}
.esta-co .woocommerce-billing-fields__field-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 16px;
}
.esta-co .woocommerce-additional-fields {
  background: #fff;
  border: 1px solid var(--esta-border);
  border-radius: var(--esta-r-xl);
  box-shadow: var(--esta-shadow-sm);
  padding: 24px 28px;
  margin-top: 20px;
}
.esta-co .woocommerce-additional-fields > h3 { font-family: var(--esta-font-display); font-size: 18px; font-weight: 800; margin: 0 0 14px; }

/* form rows.
   The classic Woo/Blocksy stylesheet still floats these and pins them to ~47%
   for its own two-column float layout; inside our grid that leaves half-width
   inputs, so the float sizing is unset and the cell does the placing. */
.esta-co .form-row {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  width: 100% !important;
  float: none !important;
}
.esta-co .form-row .woocommerce-input-wrapper { width: 100%; }
.esta-co .form-row-wide { grid-column: 1 / -1; }
.esta-co .form-row-first { grid-column: 1; }
.esta-co .form-row-last { grid-column: 2; }
.esta-co .form-row label {
  font-size: 13px;
  font-weight: 600;
  color: var(--esta-ink-soft);
  margin-bottom: 7px;
}
.esta-co .form-row label .required { color: var(--esta-sage); text-decoration: none; border: 0; margin-inline-start: 2px; }
.esta-co .form-row .optional { color: var(--esta-ink-faint); font-weight: 500; }

.esta-co .input-text,
.esta-co textarea,
.esta-co select,
.esta-co .select2-container .select2-selection {
  width: 100%;
  font-family: var(--esta-font);
  font-size: 15px;
  color: var(--esta-ink);
  background: #fff;
  border: 1.5px solid var(--esta-border-strong);
  border-radius: var(--esta-r-md);
  padding: 13px 15px;
  line-height: 1.4;
  transition: border-color 0.18s, box-shadow 0.18s;
  box-shadow: none;
}
.esta-co textarea { min-height: 92px; resize: vertical; }
.esta-co .input-text:focus,
.esta-co textarea:focus,
.esta-co select:focus {
  outline: none;
  border-color: var(--esta-sage);
  box-shadow: 0 0 0 3px rgba(20, 168, 90, 0.16);
}
.esta-co .input-text::placeholder { color: var(--esta-ink-faint); }
/* validation states */
.esta-co .woocommerce-invalid .input-text { border-color: #e7b4ae; }
.esta-co .woocommerce-validated .input-text { border-color: var(--esta-sage-soft); }

/* ---- Order review card ---- */
.esta-co #order_review {
  background: #fff;
  border: 1px solid var(--esta-border);
  border-radius: var(--esta-r-xl);
  box-shadow: var(--esta-shadow-md);
  padding: 24px;
}
.esta-co-sum-title { font-family: var(--esta-font-display); font-size: 20px; font-weight: 800; color: var(--esta-ink); margin-bottom: 18px; }

/* product hero */
.esta-co-hero { display: flex; flex-direction: column; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--esta-border); margin-bottom: 16px; }
.esta-co-hero__item { display: flex; align-items: flex-start; gap: 14px; }
.esta-co-hero__thumb { position: relative; flex-shrink: 0; width: 64px; height: 64px; border-radius: var(--esta-r-md); overflow: hidden; border: 1px solid var(--esta-border); background: var(--esta-mint-2); }
.esta-co-hero__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.esta-co-hero__qty {
  position: absolute; top: -8px; inset-inline-start: -8px;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--esta-grad-sage); color: #fff; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(20, 168, 90, 0.5); border: 2px solid #fff;
}
.esta-co-hero__info { flex: 1; min-width: 0; }
.esta-co-hero__name { font-size: 14.5px; font-weight: 700; color: var(--esta-ink); line-height: 1.3; }
.esta-co-hero__meta { font-size: 12.5px; color: var(--esta-ink-faint); margin-top: 3px; }
.esta-co-hero__meta p { margin: 0; }
.esta-co-hero__save { display: inline-block; margin-top: 6px; font-size: 11.5px; font-weight: 700; color: var(--esta-sage-deep); background: var(--esta-mint); padding: 3px 9px; border-radius: var(--esta-r-pill); }
.esta-co-hero__price { font-size: 15px; font-weight: 800; color: var(--esta-ink); white-space: nowrap; }

/* totals table — hide product rows, style totals */
.esta-co .woocommerce-checkout-review-order-table { width: 100%; border: none !important; margin: 0; background: transparent; font-size: 14.5px; }
.esta-co .woocommerce-checkout-review-order-table thead,
.esta-co .woocommerce-checkout-review-order-table .cart_item,
.esta-co .woocommerce-checkout-review-order-table .product-name,
.esta-co .woocommerce-checkout-review-order-table .woocommerce-Price-amount.includes_tax { display: none; }
.esta-co .woocommerce-checkout-review-order-table tfoot { display: block; }
.esta-co .woocommerce-checkout-review-order-table tfoot tr { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border: none; }
.esta-co .woocommerce-checkout-review-order-table tfoot tr th,
.esta-co .woocommerce-checkout-review-order-table tfoot tr td { border: none !important; padding: 0; text-align: start; font-weight: 600; color: var(--esta-ink-soft); background: transparent; }
.esta-co .woocommerce-checkout-review-order-table tfoot tr td { color: var(--esta-ink); font-weight: 700; }
.esta-co .woocommerce-checkout-review-order-table tfoot .order-total { border-top: 1px solid var(--esta-border); margin-top: 6px; padding-top: 16px; }
.esta-co .woocommerce-checkout-review-order-table tfoot .order-total th { font-family: var(--esta-font-display); font-size: 18px; color: var(--esta-ink); font-weight: 800; }
.esta-co .woocommerce-checkout-review-order-table tfoot .order-total td,
.esta-co .woocommerce-checkout-review-order-table tfoot .order-total .woocommerce-Price-amount { font-family: var(--esta-font-display); font-size: 24px; color: var(--esta-sage-deep); font-weight: 900; }
.esta-co .woocommerce-checkout-review-order-table tfoot .woocommerce-shipping-totals .woocommerce-Price-amount { color: var(--esta-sage-deep); }

/* ---- Payment ---- */
.esta-co #payment { background: transparent; border-radius: 0; margin-top: 18px; }
.esta-co #payment ul.payment_methods { border: none; padding: 0; margin: 0 0 14px; list-style: none; }
.esta-co #payment ul.payment_methods li { background: #fff; border: 1.5px solid var(--esta-border); border-radius: var(--esta-r-md); padding: 14px 16px; margin-bottom: 10px; }
.esta-co #payment ul.payment_methods li input[type="radio"]:checked + label { color: var(--esta-sage-deep); }
.esta-co #payment .woocommerce-notice,
.esta-co #payment > .woocommerce-info {
  background: var(--esta-mint-2);
  border: 1px solid var(--esta-border);
  border-inline-start: 3px solid var(--esta-sage);
  border-radius: var(--esta-r-md);
  padding: 16px 18px;
  font-size: 14px;
  color: var(--esta-ink-soft);
  box-shadow: none;
  margin: 0 0 16px;
}
.esta-co #payment .payment_box { background: var(--esta-bg-2); border-radius: var(--esta-r-md); font-size: 13px; }

/* terms */
.esta-co .woocommerce-terms-and-conditions-wrapper { font-size: 12.5px; color: var(--esta-ink-faint); margin-bottom: 14px; }

/* legal block above the pay button (esta_checkout_legal_block) */
.esta-co-legal { display: flex; flex-direction: column; gap: 12px; margin: 0 0 16px; }
.esta-co-legal__summary {
  margin: 0;
  background: var(--esta-bg-2);
  border: 1px solid var(--esta-border);
  border-radius: var(--esta-r-md);
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--esta-ink-soft);
}
.esta-co-legal a { color: var(--esta-sage-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.esta-co .esta-co-legal__check label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--esta-ink);
  cursor: pointer;
}
.esta-co .esta-co-legal__check input[type='checkbox'] { width: 18px; height: 18px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--esta-sage); }
.esta-co .esta-co-legal__check.woocommerce-invalid label { color: var(--esta-sale); }

/* ---- Place order button ---- */
.esta-co #place_order,
.esta-co .place-order button {
  width: 100%;
  background: var(--esta-grad-sage);
  color: #fff;
  border: none;
  border-radius: var(--esta-r-md);
  padding: 17px 24px;
  font-family: var(--esta-font);
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 26px -10px rgba(20, 168, 90, 0.6);
  transition: transform 0.18s, box-shadow 0.2s, filter 0.2s;
  float: none;
}
.esta-co #place_order:hover { transform: translateY(-2px); box-shadow: var(--esta-glow); filter: brightness(1.03); }
.esta-co .place-order { padding: 0; margin: 0; }
.esta-co .place-order .button-wrap { padding: 0; }

/* ---- Trust row under the button ---- */
.esta-co-trust { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.esta-co-trust__secure { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--esta-sage-deep); }
.esta-co-trust__badges { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.esta-co-trust__badges span { font-size: 12px; color: var(--esta-ink-faint); font-weight: 600; }

/* ---- Footer ---- */
.esta-co-foot { text-align: center; padding: 28px 24px 40px; color: var(--esta-ink-faint); font-size: 12.5px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.esta-co-foot__sep { opacity: 0.5; }

/* hide WC "ship to different address" toggle (single delivery address) */
.esta-co .woocommerce-shipping-fields > h3,
.esta-co #ship-to-different-address { display: none; }

/* single-country store → hide the country field (value still posts as IL) */
.esta-co #billing_country_field { display: none !important; }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .esta-co form.checkout.woocommerce-checkout { grid-template-columns: 1fr; gap: 22px; }
  .esta-co #customer_details { grid-column: 1; grid-row: auto; }
  .esta-co #order_review { grid-column: 1; grid-row: auto; position: static; }
  .esta-co .woocommerce-billing-fields { padding: 22px 20px; }
}
@media (max-width: 560px) {
  .esta-co__inner { padding: 24px 16px 56px; }
  .esta-co .woocommerce-billing-fields__field-wrapper { grid-template-columns: 1fr; }
  .esta-co .form-row-first, .esta-co .form-row-last { grid-column: 1; }
  .esta-co-top__inner { padding: 0 16px; }
  .esta-co-back span { display: none; }
}
