/* ESTA — theme the native WooCommerce cart / checkout / my-account pages to the
   "Snow & Sage" system so the handoff from the React storefront feels seamless.
   Depends on tokens.css (var(--esta-*)) enqueued before this file. */

body.woocommerce-cart,
body.woocommerce-checkout,
body.woocommerce-account,
body.woocommerce-page {
  background: var(--esta-bg);
  font-family: var(--esta-font);
  color: var(--esta-ink);
}

/* Hebrew storefront → keep Woo flows right-to-left. */
.woocommerce,
.woocommerce-page .entry-content,
.wc-block-checkout,
.wc-block-cart {
  direction: rtl;
  text-align: right;
}

/* Headings — display face to match the storefront (no negative tracking: these
   are Hebrew strings and Hebrew doesn't tuck like Latin does) */
body.woocommerce-page h1,
body.woocommerce-page h2,
body.woocommerce-page h3,
.wc-block-components-title {
  font-family: var(--esta-font-display) !important;
  color: var(--esta-ink) !important;
  font-weight: 800 !important;
}

/* Surfaces / cards */
.woocommerce table.shop_table,
.wc-block-components-sidebar,
.wc-block-components-panel,
.woocommerce-order,
.woocommerce-MyAccount-content,
ul.wc-block-components-checkout-order-summary__container,
.wc-block-checkout__sidebar,
.woocommerce form.checkout_coupon,
#order_review {
  background: var(--esta-card);
  border: 1px solid var(--esta-border);
  border-radius: var(--esta-r-xl) !important;
  box-shadow: var(--esta-shadow-sm);
}
.woocommerce table.shop_table th,
.woocommerce table.shop_table td { border-color: var(--esta-border); }

/* Primary buttons — sage gradient pills, matching the React CTAs */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce #place_order,
.woocommerce .wc-block-components-button,
.wc-block-components-button.contained,
.wp-block-button__link,
.woocommerce-MyAccount-content .button,
button.wc-block-cart__submit-button {
  background: var(--esta-grad-sage) !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--esta-r-pill) !important;
  font-family: var(--esta-font) !important;
  font-weight: 700 !important;
  padding: 14px 28px !important;
  box-shadow: 0 12px 26px -10px rgba(20, 168, 90, 0.6);
  transition: transform 0.18s, box-shadow 0.2s, filter 0.2s;
  text-decoration: none !important;
  display: inline-block;
  text-align: center;
}
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.woocommerce #place_order:hover,
.woocommerce .wc-block-components-button:hover,
.wc-block-components-button.contained:hover,
.wp-block-button__link:hover,
button.wc-block-cart__submit-button:hover {
  filter: brightness(1.03);
  transform: translateY(-2px);
  box-shadow: var(--esta-glow) !important;
}

/* Secondary / "continue shopping" buttons */
.woocommerce a.button.wc-backward,
.woocommerce .button.wc-backward {
  background: #fff !important;
  color: var(--esta-sage-deep) !important;
  border: 1px solid var(--esta-border-strong) !important;
  box-shadow: var(--esta-shadow-xs);
}

/* Prices / totals in sage */
.woocommerce-Price-amount,
.wc-block-components-product-price,
.wc-block-formatted-money-amount,
.woocommerce .order-total .woocommerce-Price-amount,
.wc-block-components-totals-item__value { color: var(--esta-sage-deep); font-weight: 700; }

/* Links */
.woocommerce a, .woocommerce-page a { color: var(--esta-sage); }
.woocommerce a:hover, .woocommerce-page a:hover { color: var(--esta-sage-deep); }

/* Form inputs — pill-ish, soft */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce-account .woocommerce form .woocommerce-Input,
.wc-block-components-text-input input,
.wc-block-components-select select,
.select2-container .select2-selection {
  border: 1px solid var(--esta-border-strong) !important;
  border-radius: var(--esta-r-md) !important;
  background: #fff !important;
  font-family: var(--esta-font) !important;
  color: var(--esta-ink) !important;
  padding: 13px 16px !important;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus,
.wc-block-components-text-input input:focus {
  outline: none !important;
  border-color: var(--esta-sage) !important;
  box-shadow: 0 0 0 3px rgba(20, 168, 90, 0.18) !important;
}
.wc-block-components-text-input.is-active label,
.wc-block-components-text-input input:focus + label { color: var(--esta-sage-deep) !important; }

/* My-account navigation */
.woocommerce-MyAccount-navigation ul {
  border: 1px solid var(--esta-border);
  border-radius: var(--esta-r-xl);
  overflow: hidden;
  background: var(--esta-card);
  box-shadow: var(--esta-shadow-xs);
  list-style: none;
  padding: 0;
}
.woocommerce-MyAccount-navigation ul li { border-bottom: 1px solid var(--esta-border); }
.woocommerce-MyAccount-navigation ul li:last-child { border-bottom: none; }
.woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-MyAccount-navigation ul li a:hover { background: var(--esta-mint); color: var(--esta-sage-deep); }
.woocommerce-MyAccount-navigation ul li a { display: block; padding: 14px 20px; font-weight: 700; }

/* Notices */
.woocommerce-message,
.woocommerce-info,
.wc-block-components-notice-banner {
  border-radius: var(--esta-r-md) !important;
  border-color: var(--esta-sage) !important;
  background: var(--esta-mint-2) !important;
}
.woocommerce-message::before, .woocommerce-info::before { color: var(--esta-sage); }

/* Quantity field */
.woocommerce .quantity .qty {
  border: 1.5px solid var(--esta-border-strong) !important;
  border-radius: var(--esta-r-pill) !important;
  color: var(--esta-ink);
  padding: 8px 10px !important;
}

/* =========================================================================
   The bare shell (template-woo-shell.php) — cart, my-account, thank-you.
   These pages used to render inside the parent theme; now they wear the same
   chrome as checkout, so everything below styles the shortcode content only.
   ========================================================================= */

.esta-shell { min-height: 62vh; }
.esta-shell__inner { max-width: 1080px; margin: 0 auto; padding: 40px 24px 80px; }
.esta-shell__inner > .woocommerce { direction: rtl; }
.esta-shell .woocommerce-notices-wrapper:empty { display: none; }
.esta-shell h1.entry-title { font-size: 34px; margin-bottom: 26px; }

/* ---- Cart ---- */
.esta-shell .woocommerce-cart-form { display: block; }
.esta-shell table.shop_table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  padding: 6px 10px;
  margin-bottom: 26px;
}
.esta-shell table.shop_table th {
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--esta-ink-faint);
  padding: 14px 12px;
  text-align: right;
  border-bottom: 1px solid var(--esta-border);
}
.esta-shell table.shop_table td {
  padding: 18px 12px;
  border-bottom: 1px solid var(--esta-border);
  vertical-align: middle;
  font-size: 14.5px;
}
.esta-shell table.shop_table tr:last-child td { border-bottom: none; }
/* Give the product name the room — the numeric columns only need their digits. */
.esta-shell .woocommerce-cart-form table.shop_table { table-layout: fixed; }
.esta-shell td.product-thumbnail, .esta-shell th.product-thumbnail { width: 96px; }
.esta-shell td.product-quantity, .esta-shell th.product-quantity { width: 120px; }
.esta-shell td.product-subtotal, .esta-shell th.product-subtotal { width: 120px; }
.esta-shell td.product-remove, .esta-shell th.product-remove { width: 56px; text-align: center; }
.esta-shell td.product-thumbnail img { width: 74px; height: 74px; object-fit: cover; border-radius: var(--esta-r-md); box-shadow: var(--esta-shadow-xs); }
.esta-shell td.product-name { line-height: 1.5; }
.esta-shell td.product-name a { color: var(--esta-ink); font-weight: 700; }
.esta-shell td.product-name a:hover { color: var(--esta-sage-deep); }
.esta-shell td.product-name .price { font-size: 13.5px; margin-top: 4px; }
.esta-shell .product-quantity .quantity input.qty { width: 74px; text-align: center; }
.esta-shell .product-remove a.remove {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--esta-bg-2); color: var(--esta-ink-faint) !important;
  font-size: 19px; line-height: 1; text-decoration: none;
  transition: background 0.18s, color 0.18s;
}
.esta-shell .product-remove a.remove:hover { background: #fbeceb; color: var(--esta-sale) !important; }
.esta-shell .cart .actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 6px 12px 16px; }
.esta-shell .cart .actions > .coupon { flex: 1 1 auto; width: auto !important; float: none !important; }
.esta-shell .coupon { display: flex; gap: 8px; flex-wrap: nowrap; align-items: center; }
.esta-shell .coupon .input-text {
  border: 1px solid var(--esta-border-strong) !important;
  border-radius: var(--esta-r-md) !important;
  padding: 11px 14px !important;
  font-size: 14px;
  min-width: 190px;
  background: #fff;
}
/* Coupon + update are housekeeping — only "checkout" gets the loud treatment. */
.esta-shell .cart .actions button[name='apply_coupon'],
.esta-shell .cart .actions button[name='update_cart'] {
  background: #fff !important;
  color: var(--esta-ink-soft) !important;
  border: 1px solid var(--esta-border-strong) !important;
  box-shadow: none !important;
  padding: 11px 20px !important;
  font-size: 14px !important;
}
.esta-shell .cart .actions button[name='apply_coupon']:hover,
.esta-shell .cart .actions button[name='update_cart']:hover {
  color: var(--esta-sage-deep) !important;
  border-color: var(--esta-sage-soft) !important;
  box-shadow: var(--esta-shadow-xs) !important;
  transform: none;
}
.esta-shell .cart .actions button[name='update_cart']:disabled { opacity: 0.45; }
.esta-shell .cart_totals {
  max-width: 420px;
  margin-inline-start: auto;
  background: var(--esta-card);
  border: 1px solid var(--esta-border);
  border-radius: var(--esta-r-xl);
  box-shadow: var(--esta-shadow-sm);
  padding: 26px 28px;
}
.esta-shell .cart_totals h2 { font-size: 19px; margin-bottom: 18px; }
.esta-shell .cart_totals table { width: 100%; border-collapse: collapse; }
.esta-shell .cart_totals th,
.esta-shell .cart_totals td { padding: 11px 0; font-size: 14.5px; text-align: right; border-bottom: 1px solid var(--esta-border); }
.esta-shell .cart_totals th { font-weight: 600; color: var(--esta-ink-soft); }
.esta-shell .cart_totals .order-total th,
.esta-shell .cart_totals .order-total td { border-bottom: none; padding-top: 16px; font-size: 17px; font-weight: 800; }
.esta-shell .cart_totals .order-total .woocommerce-Price-amount { font-size: 24px; font-weight: 900; }
.esta-shell .wc-proceed-to-checkout { margin-top: 20px; }
.esta-shell .wc-proceed-to-checkout a.checkout-button { display: block; width: 100%; text-align: center; font-size: 16px; padding: 16px 24px !important; }
.esta-shell .shipping-calculator-button { font-size: 13px; }

/* Empty cart — one calm card, not a warning notice inside another box.
   Woo nests `p.cart-empty.woocommerce-info` inside `.wc-empty-cart-message`
   and puts the CTA in a sibling `p.return-to-shop`, so the card is drawn on
   the wrapper and the notice chrome is stripped off the message itself. */
.esta-shell .wc-empty-cart-message {
  background: var(--esta-card);
  border: 1px solid var(--esta-border);
  border-radius: var(--esta-r-xl) var(--esta-r-xl) 0 0;
  box-shadow: var(--esta-shadow-sm);
  padding: 60px 24px 10px;
  margin: 0;
}
.esta-shell .cart-empty,
.esta-shell .wc-empty-cart-message .woocommerce-info {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  /* Blocksy shrink-wraps and floats notices; unset that so centring bites. */
  display: block !important;
  float: none !important;
  width: 100% !important;
  text-align: center !important;
  font-family: var(--esta-font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--esta-ink);
}
.esta-shell .cart-empty::before,
.esta-shell .wc-empty-cart-message .woocommerce-info::before { display: none !important; }
.esta-shell .return-to-shop {
  text-align: center;
  background: var(--esta-card);
  border: 1px solid var(--esta-border);
  border-top: none;
  border-radius: 0 0 var(--esta-r-xl) var(--esta-r-xl);
  box-shadow: var(--esta-shadow-sm);
  margin: 0 0 26px;
  padding: 22px 24px 60px;
}

/* ---- My account ---- */
.esta-shell .woocommerce-MyAccount-navigation { width: 260px; float: right; margin-inline-end: 28px; }
.esta-shell .woocommerce-MyAccount-content {
  width: auto;
  overflow: hidden;
  float: none;
  padding: 30px 32px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--esta-ink-soft);
}
.esta-shell .woocommerce-MyAccount-content p { margin: 0 0 14px; }
.esta-shell .woocommerce-MyAccount-content mark { background: var(--esta-mint); color: var(--esta-ink); padding: 0 4px; border-radius: 4px; }
.esta-shell .woocommerce-form-login,
.esta-shell .woocommerce-form-register,
.esta-shell .woocommerce-ResetPassword {
  max-width: 460px;
  margin: 0 auto;
  background: var(--esta-card);
  border: 1px solid var(--esta-border) !important;
  border-radius: var(--esta-r-xl);
  box-shadow: var(--esta-shadow-sm);
  padding: 32px !important;
}
.esta-shell .u-columns { display: grid; gap: 22px; }
.esta-shell .woocommerce-form-login .form-row { padding: 0; margin-bottom: 16px; }
.esta-shell .woocommerce-form__label-for-checkbox { font-size: 13.5px; color: var(--esta-ink-soft); }

/* ---- Thank-you ---- */
.esta-shell-page--thankyou .esta-shell__inner { max-width: 760px; }
.esta-shell .woocommerce-order { background: none; border: none; box-shadow: none; padding: 0; }
.esta-shell .woocommerce-thankyou-order-received,
.esta-shell p.woocommerce-notice--success { display: none; } /* replaced by esta-ty-hero */

.esta-ty-hero { text-align: center; padding: 18px 0 34px; }
.esta-ty-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 74px; height: 74px; border-radius: 50%;
  background: var(--esta-grad-sage); color: #fff;
  box-shadow: 0 18px 40px -14px rgba(20, 168, 90, 0.6);
  margin-bottom: 22px;
}
.esta-ty-title { font-family: var(--esta-font-display); font-size: 36px; font-weight: 800; color: var(--esta-ink); line-height: 1.15; }
.esta-ty-sub { font-size: 16px; line-height: 1.75; color: var(--esta-ink-soft); margin: 14px auto 0; max-width: 460px; }
.esta-ty-sub strong { color: var(--esta-ink); font-weight: 700; }
.esta-ty-chip {
  display: inline-block; margin-top: 20px;
  background: var(--esta-cream); border: 1px solid var(--esta-border-strong);
  border-radius: var(--esta-r-pill); padding: 9px 20px;
  font-size: 13.5px; font-weight: 700; color: var(--esta-ink);
}

/* Woo's own order overview list → a quiet fact row */
.esta-shell ul.woocommerce-order-overview {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 2px 18px;
  margin: 0 0 26px;
  padding: 22px 26px;
  background: var(--esta-card);
  border: 1px solid var(--esta-border);
  border-radius: var(--esta-r-xl);
  box-shadow: var(--esta-shadow-sm);
}
.esta-shell ul.woocommerce-order-overview li {
  border: none !important;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--esta-ink-faint);
  padding: 6px 0;
  margin: 0;
  float: none;
}
.esta-shell ul.woocommerce-order-overview li strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--esta-ink);
}

.esta-shell .woocommerce-order-details,
.esta-shell .woocommerce-customer-details {
  background: var(--esta-card);
  border: 1px solid var(--esta-border);
  border-radius: var(--esta-r-xl);
  box-shadow: var(--esta-shadow-sm);
  padding: 26px 28px;
  margin-bottom: 22px;
}
.esta-shell .woocommerce-order-details h2,
.esta-shell .woocommerce-customer-details h2,
.esta-ty-next h2,
.esta-ty-help h2 { font-family: var(--esta-font-display); font-size: 19px; font-weight: 800; color: var(--esta-ink); margin-bottom: 16px; }
/* The generic card treatment already wraps this block — don't box the table again. */
.esta-shell .woocommerce-order-details table.shop_table,
.esta-shell .woocommerce-customer-details table.shop_table {
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0 !important;
  box-shadow: none;
  background: none;
}
.esta-shell .woocommerce-order-details tfoot th { text-align: right; font-weight: 600; text-transform: none; letter-spacing: 0; font-size: 14.5px; color: var(--esta-ink-soft); }
.esta-shell .woocommerce-order-details tfoot tr:last-child th,
.esta-shell .woocommerce-order-details tfoot tr:last-child td { font-size: 17px; font-weight: 800; color: var(--esta-ink); }
.esta-shell .woocommerce-customer-details address { font-style: normal; line-height: 1.8; font-size: 14.5px; color: var(--esta-ink-soft); border: none; padding: 0; }

.esta-ty-next, .esta-ty-help {
  background: var(--esta-card);
  border: 1px solid var(--esta-border);
  border-radius: var(--esta-r-xl);
  box-shadow: var(--esta-shadow-sm);
  padding: 26px 28px;
  margin-bottom: 22px;
}
.esta-ty-steps { list-style: none; display: grid; gap: 16px; margin: 0; padding: 0; }
.esta-ty-steps li { display: flex; gap: 14px; align-items: flex-start; }
.esta-ty-steps__num {
  flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--esta-mint); color: var(--esta-sage-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800;
}
.esta-ty-steps__body strong { display: block; font-size: 15px; font-weight: 700; color: var(--esta-ink); }
.esta-ty-steps__body span { font-size: 14px; line-height: 1.7; color: var(--esta-ink-soft); }
.esta-ty-help { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.esta-ty-help h2 { margin-bottom: 6px; }
.esta-ty-help p { font-size: 14px; color: var(--esta-ink-soft); margin: 0; }
.esta-ty-mail { font-weight: 700; color: var(--esta-sage-deep) !important; font-size: 15px; }
.esta-ty-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 26px; }
.esta-ty-trust span {
  background: var(--esta-cream); border: 1px solid var(--esta-border-strong);
  border-radius: var(--esta-r-pill); padding: 8px 16px;
  font-size: 12.5px; font-weight: 700; color: var(--esta-ink-soft);
}
.esta-ty-back { text-align: center; }
.esta-ty-back .esta-co-btn,
.esta-shell a.esta-co-btn {
  display: inline-block;
  background: var(--esta-grad-sage);
  color: #fff !important;
  border-radius: var(--esta-r-pill);
  padding: 14px 34px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 10px 24px -10px rgba(20, 168, 90, 0.6);
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}
.esta-shell a.esta-co-btn:hover { transform: translateY(-2px); box-shadow: var(--esta-glow); }

@media (max-width: 780px) {
  .esta-shell__inner { padding: 28px 18px 64px; }
  .esta-shell .woocommerce-MyAccount-navigation { width: 100%; float: none; margin: 0 0 20px; }
  .esta-shell .cart_totals { max-width: none; }
  .esta-shell table.shop_table thead { display: none; }
  .esta-shell table.shop_table tr { display: grid; grid-template-columns: 74px 1fr auto; gap: 4px 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--esta-border); }
  .esta-shell table.shop_table td { border: none; padding: 0; }
  .esta-shell td.product-thumbnail { grid-row: span 3; }
  .esta-shell td.product-remove { grid-column: 3; grid-row: 1; }
  .esta-shell .cart .actions { flex-direction: column; align-items: stretch; }
  .esta-ty-title { font-size: 29px; }
  .esta-ty-help { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .esta-shell a.esta-co-btn:hover { transform: none; }
}
