:root {
  --pal-navy: #102b56;
  --pal-blue: #2878d4;
  --pal-sky: #eaf6ff;
  --pal-yellow: #ffd338;
  --pal-green: #2e9f67;
  --pal-ink: #17243a;
  --pal-muted: #68758a;
  --pal-line: #dfe8f2;
  --pal-shadow: 0 18px 50px rgba(16, 43, 86, 0.12);
}

body.woocommerce-cart,
body.woocommerce-checkout,
body.woocommerce-order-received {
  color: var(--pal-ink);
  background:
    radial-gradient(circle at 11% 9%, rgba(255,255,255,.96) 0 28px, transparent 29px),
    radial-gradient(circle at 19% 8%, rgba(255,255,255,.96) 0 43px, transparent 44px),
    radial-gradient(circle at 29% 11%, rgba(255,255,255,.96) 0 33px, transparent 34px),
    radial-gradient(ellipse at 20% 15%, rgba(255,255,255,.96) 0 92px, transparent 94px),
    linear-gradient(180deg, #f8fcff, #eaf6ff 55%, #f8fbff);
  background-attachment: fixed;
}

body.woocommerce-cart::before,
body.woocommerce-checkout::before,
body.woocommerce-order-received::before {
  content: "";
  position: fixed;
  inset: 72px -7vw auto auto;
  width: 42vw;
  min-width: 260px;
  height: 150px;
  pointer-events: none;
  opacity: 0.48;
  z-index: 0;
  background:
    radial-gradient(circle at 28% 62%, #fff 0 32px, transparent 34px),
    radial-gradient(circle at 48% 48%, #fff 0 48px, transparent 50px),
    radial-gradient(circle at 69% 64%, #fff 0 36px, transparent 38px),
    radial-gradient(ellipse at 50% 72%, #fff 0 100px, transparent 102px);
  filter: drop-shadow(0 18px 28px rgba(85, 143, 195, 0.12));
  animation: pal-cloud-drift 16s ease-in-out infinite alternate;
}

@keyframes pal-cloud-drift {
  from { transform: translate3d(-8px, 0, 0); }
  to { transform: translate3d(12px, 8px, 0); }
}

.pal-purchase-progress {
  max-width: 760px;
  margin: 0 auto 24px;
  padding: 14px;
  border: 1px solid var(--pal-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(16, 43, 86, 0.08);
}

.pal-purchase-intro {
  max-width: 760px;
  margin: 0 auto 26px;
  text-align: right;
}

.pal-purchase-intro .pal-purchase-progress {
  margin-bottom: 18px;
}

.pal-purchase-intro > h1 {
  margin: 0;
  color: var(--pal-navy);
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.12;
}

.pal-purchase-intro > p {
  max-width: 650px;
  margin: 10px 0 0;
  color: var(--pal-muted);
  font-size: 16px;
  line-height: 1.7;
}

/* Retire the three legacy English Elementor headings on the current checkout template. */
body.woocommerce-checkout .elementor-element-8199bcb,
body.woocommerce-checkout .elementor-element-612f49c,
body.woocommerce-checkout .elementor-element-f8899e1 {
  display: none !important;
}

/* The legacy checkout page leaves an empty mobile hero and inherited spacing
   around the WooCommerce shortcode. Keep the global site header, but let the
   purchase intro become the page hero and keep the form in normal document flow. */
body.woocommerce-checkout .elementor-element-9fcda2c {
  display: none !important;
}

body.woocommerce-checkout .elementor-element-1d17c734,
body.woocommerce-checkout .elementor-element-2e9bd80e,
body.woocommerce-checkout .elementor-element-15ca6777,
body.woocommerce-checkout .elementor-element-15ca6777 > .elementor-widget-container {
  width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  position: static !important;
  transform: none !important;
}

body.woocommerce-checkout form.checkout,
body.woocommerce-checkout #order_review,
body.woocommerce-checkout #payment,
body.woocommerce-checkout .form-row.place-order {
  min-height: 0 !important;
  height: auto !important;
  position: static !important;
  transform: none !important;
  clear: both;
}

.pal-purchase-progress ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pal-purchase-progress li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--pal-muted);
  font-size: 13px;
}

.pal-purchase-progress li > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--pal-line);
  border-radius: 11px;
  background: #fff;
  color: var(--pal-muted);
  font-weight: 800;
}

.pal-purchase-progress li.is-complete > span,
.pal-purchase-progress li.is-current > span {
  border-color: var(--pal-blue);
  background: var(--pal-blue);
  color: #fff;
}

.pal-purchase-progress li.is-current {
  color: var(--pal-navy);
}

.woocommerce-cart main,
.woocommerce-checkout main,
.woocommerce-order-received main,
.wc-block-cart,
.wc-block-checkout {
  position: relative;
  z-index: 1;
}

.woocommerce-cart .woocommerce,
.woocommerce-checkout .woocommerce,
.woocommerce-order-received .woocommerce,
.wc-block-cart,
.wc-block-checkout {
  max-width: 1120px;
  margin-inline: auto;
}

.woocommerce-cart h1,
.woocommerce-checkout h1,
.woocommerce-order-received h1,
.woocommerce-cart h2,
.woocommerce-checkout h2,
.woocommerce-order-received h2,
.wc-block-cart h2,
.wc-block-checkout h2 {
  color: var(--pal-navy);
  letter-spacing: -0.02em;
}

.woocommerce-cart table.shop_table,
.woocommerce-checkout table.shop_table,
.woocommerce-checkout #payment,
.woocommerce-order-received .woocommerce-order,
.wc-block-cart-items,
.wc-block-components-sidebar,
.wc-block-components-order-summary,
.wc-block-components-checkout-step {
  border: 1px solid var(--pal-line) !important;
  border-radius: 22px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: var(--pal-shadow);
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.wc-block-components-text-input input,
.wc-block-components-combobox .wc-block-components-combobox-control input {
  min-height: 50px;
  border: 1.5px solid #cfdbe7 !important;
  border-radius: 14px !important;
  background: #fff !important;
  color: var(--pal-ink) !important;
}

.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 {
  border-color: var(--pal-blue) !important;
  box-shadow: 0 0 0 4px rgba(40, 120, 212, 0.1) !important;
  outline: none;
}

.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.wc-block-components-button:not(.is-link) {
  min-height: 50px;
  border: 0 !important;
  border-radius: 15px !important;
  background: var(--pal-yellow) !important;
  color: #081b38 !important;
  font-weight: 800 !important;
  box-shadow: 0 10px 24px rgba(214, 165, 0, 0.2);
}

.woocommerce .quantity .qty,
.wc-block-components-quantity-selector {
  border-radius: 12px !important;
  border-color: var(--pal-line) !important;
}

.woocommerce-checkout #payment div.payment_box {
  border-radius: 14px;
  background: var(--pal-sky);
  color: var(--pal-ink);
}

.woocommerce-order-received .woocommerce-notice--success,
.woocommerce-order-received .woocommerce-thankyou-order-received {
  padding: 18px;
  border-radius: 18px;
  background: #e7f7ef;
  color: #257952;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
}

.pal-order-resources {
  font-family: Heebo, Arial, sans-serif;
}

@media (max-width: 782px) {
  body.woocommerce-cart,
  body.woocommerce-checkout,
  body.woocommerce-order-received {
    background-attachment: scroll;
  }

  .woocommerce-cart .woocommerce,
  .woocommerce-checkout .woocommerce,
  .woocommerce-order-received .woocommerce,
  .wc-block-cart,
  .wc-block-checkout {
    width: auto;
    margin: 0 12px;
  }

  .woocommerce-cart table.shop_table,
  .woocommerce-checkout table.shop_table,
  .woocommerce-checkout #payment,
  .woocommerce-order-received .woocommerce-order,
  .wc-block-cart-items,
  .wc-block-components-sidebar,
  .wc-block-components-order-summary,
  .wc-block-components-checkout-step {
    border-radius: 18px !important;
  }

  .wc-block-cart__submit-container,
  .wc-block-checkout__actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
  }

  .pal-purchase-progress {
    margin: 0 0 18px;
    padding: 10px;
  }

  .pal-purchase-intro {
    margin: 0 12px 22px;
  }

  .pal-purchase-progress li {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    font-size: 11px;
  }

  /* The live theme disables WooCommerce's native responsive cart table.
     Rebuild every cart line as a readable card instead of allowing a
     six-column table to overflow the mobile viewport. */
  .woocommerce-cart .woocommerce-cart-form,
  .woocommerce-cart .cart-collaterals,
  .woocommerce-cart .cart_totals {
    width: 100% !important;
    float: none !important;
  }

  .woocommerce-cart table.shop_table.cart {
    display: block;
    width: 100% !important;
    overflow: visible;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none;
  }

  .woocommerce-cart table.shop_table.cart thead {
    display: none;
  }

  .woocommerce-cart table.shop_table.cart tbody {
    display: grid;
    gap: 12px;
  }

  .woocommerce-cart table.shop_table.cart tr.cart_item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 34px;
    grid-template-areas:
      "thumb name remove"
      "thumb price price"
      "thumb quantity subtotal";
    gap: 8px 12px;
    align-items: center;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--pal-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 12px 32px rgba(16, 43, 86, 0.09);
  }

  .woocommerce-cart table.shop_table.cart tr.cart_item > td,
  .woocommerce-cart table.shop_table.cart tr.cart_item > th {
    display: block;
    width: auto !important;
    min-width: 0;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    text-align: right !important;
  }

  .woocommerce-cart table.shop_table.cart td::before {
    display: none !important;
  }

  .woocommerce-cart table.shop_table.cart .product-thumbnail {
    display: block !important;
    grid-area: thumb;
    align-self: start;
  }

  .woocommerce-cart table.shop_table.cart .product-thumbnail img {
    display: block;
    width: 72px !important;
    height: 72px !important;
    margin: 0;
    border-radius: 14px;
    object-fit: contain;
    background: #fff;
  }

  .woocommerce-cart table.shop_table.cart .product-name {
    grid-area: name;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .woocommerce-cart table.shop_table.cart .product-name a {
    color: var(--pal-navy);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
  }

  .woocommerce-cart table.shop_table.cart .product-remove {
    grid-area: remove;
    justify-self: end;
    align-self: start;
  }

  .woocommerce-cart table.shop_table.cart .product-remove a {
    display: grid !important;
    width: 32px !important;
    height: 32px !important;
    place-items: center;
    border-radius: 10px;
    background: #fff1f3 !important;
    color: #a9324f !important;
    font-size: 22px !important;
    line-height: 1 !important;
  }

  .woocommerce-cart table.shop_table.cart .product-price {
    grid-area: price;
    color: var(--pal-muted);
    font-size: 14px;
  }

  .woocommerce-cart table.shop_table.cart .product-price::before {
    display: inline !important;
    content: "מחיר: ";
    font-weight: 700;
  }

  .woocommerce-cart table.shop_table.cart .product-quantity {
    grid-area: quantity;
  }

  .woocommerce-cart table.shop_table.cart .product-subtotal {
    grid-area: subtotal;
    justify-self: end;
    color: var(--pal-navy);
    font-size: 15px;
    font-weight: 900;
  }

  .woocommerce-cart table.shop_table.cart .product-subtotal::before {
    display: inline !important;
    content: "סה\"כ: ";
    color: var(--pal-muted);
    font-size: 12px;
    font-weight: 700;
  }

  .woocommerce-cart table.shop_table.cart tr.woosb-item-child {
    margin-inline-start: 18px;
    border-style: dashed;
    background: rgba(248, 252, 255, 0.96);
    box-shadow: none;
  }

  .woocommerce-cart table.shop_table.cart tr.woosb-item-child .product-remove:empty {
    display: none !important;
  }

  .woocommerce-cart table.shop_table.cart tr:not(.cart_item) {
    display: block;
  }

  .woocommerce-cart table.shop_table.cart td.actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 14px 0 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  .woocommerce-cart table.shop_table.cart td.actions .coupon {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .woocommerce-cart table.shop_table.cart td.actions .coupon input,
  .woocommerce-cart table.shop_table.cart td.actions .coupon button,
  .woocommerce-cart table.shop_table.cart td.actions > button {
    width: 100% !important;
    min-width: 0;
  }

  .woocommerce-cart .cart_totals {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--pal-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: var(--pal-shadow);
  }

  .woocommerce-cart .cart_totals table.shop_table {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none;
  }

  .woocommerce-cart .wc-proceed-to-checkout {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin: 0 -6px -6px;
    padding: 10px 6px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
  }

  .woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
    width: 100%;
    margin: 0;
    text-align: center;
  }

  .woocommerce-checkout form.checkout,
  .woocommerce-checkout #customer_details,
  .woocommerce-checkout #order_review,
  .woocommerce-checkout #payment,
  .woocommerce-checkout .col2-set,
  .woocommerce-checkout .col2-set .col-1,
  .woocommerce-checkout .col2-set .col-2 {
    width: 100% !important;
    float: none !important;
  }

  .woocommerce-checkout #customer_details,
  .woocommerce-checkout #order_review {
    margin: 0 0 18px !important;
  }

  .woocommerce-checkout table.woocommerce-checkout-review-order-table {
    width: 100% !important;
    table-layout: fixed;
    margin: 0 !important;
    overflow: hidden;
  }

  .woocommerce-checkout table.woocommerce-checkout-review-order-table th,
  .woocommerce-checkout table.woocommerce-checkout-review-order-table td {
    padding: 11px 10px !important;
    vertical-align: top;
    overflow-wrap: anywhere;
    line-height: 1.45;
  }

  .woocommerce-checkout table.woocommerce-checkout-review-order-table th:first-child,
  .woocommerce-checkout table.woocommerce-checkout-review-order-table td:first-child {
    width: 66%;
  }

  .woocommerce-checkout table.woocommerce-checkout-review-order-table th:last-child,
  .woocommerce-checkout table.woocommerce-checkout-review-order-table td:last-child {
    width: 34%;
    text-align: left;
    white-space: normal;
  }

  .woocommerce-checkout #payment {
    display: block !important;
    margin: 18px 0 0 !important;
    padding: 16px !important;
  }

  .woocommerce-checkout #payment ul.payment_methods,
  .woocommerce-checkout #payment .form-row.place-order {
    display: block !important;
    margin: 0 !important;
    padding: 12px 0 !important;
  }

  .woocommerce-checkout #payment ul.payment_methods li {
    display: block !important;
    min-height: 34px;
  }

  .woocommerce-checkout #payment #place_order {
    position: sticky;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 20;
    width: 100% !important;
    margin-top: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
