/**
 * WooCommerce core-page presentation.
 *
 * This layer deliberately contains presentation only. It supports both the
 * classic templates and WooCommerce Cart/Checkout blocks without changing
 * checkout, gateway, shipping, tax, or account behaviour.
 */

body.woocommerce-cart,
body.woocommerce-checkout,
body.woocommerce-account {
  background: var(--ecms-warm-white, #fbfaf8);
}

body.woocommerce-cart .site-main--shop,
body.woocommerce-checkout .site-main--shop,
body.woocommerce-account .site-main--shop {
  padding-block: clamp(2.25rem, 5vw, 5rem);
}

body.woocommerce-cart .woocommerce,
body.woocommerce-checkout .woocommerce,
body.woocommerce-account .woocommerce {
  min-width: 0;
}

body.woocommerce-cart .woocommerce h1,
body.woocommerce-checkout .woocommerce h1,
body.woocommerce-account .woocommerce h1,
body.woocommerce-cart .entry-title,
body.woocommerce-checkout .entry-title,
body.woocommerce-account .entry-title {
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  line-height: 1;
  letter-spacing: -.05em;
}

/* Shared controls and protected WooCommerce states. */
body.woocommerce-page .woocommerce form .form-row {
  margin-bottom: 1rem;
  padding: 0;
}

body.woocommerce-page .woocommerce form .form-row label {
  margin-bottom: .4rem;
  color: var(--ecms-black, #0d0e10);
  font-weight: 800;
  line-height: 1.4;
}

body.woocommerce-page .woocommerce form .form-row .required {
  color: var(--ecms-red-dark, #a50f16);
}

body.woocommerce-page .woocommerce form .input-text,
body.woocommerce-page .woocommerce form select,
body.woocommerce-page .select2-container .select2-selection--single {
  width: 100%;
  min-height: 52px;
  border: 1px solid #c8cdd1;
  border-radius: 12px;
  background: #fff;
  color: var(--ecms-black, #0d0e10);
}

body.woocommerce-page .select2-container .select2-selection--single {
  display: flex;
  align-items: center;
}

body.woocommerce-page .select2-container--default .select2-selection--single .select2-selection__arrow {
  top: 50%;
  right: .6rem;
  transform: translateY(-50%);
}

body.woocommerce-page .woocommerce form .input-text:focus,
body.woocommerce-page .woocommerce form select:focus,
body.woocommerce-page .select2-container--focus .select2-selection--single {
  border-color: var(--ecms-red, #d71920);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(215, 25, 32, .12);
}

body.woocommerce-page .woocommerce form .woocommerce-invalid .input-text,
body.woocommerce-page .woocommerce form .input-text[aria-invalid="true"] {
  border-color: #b4232d;
  background: #fff8f8;
}

body.woocommerce-page .woocommerce-error,
body.woocommerce-page .woocommerce-info,
body.woocommerce-page .woocommerce-message {
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem 1rem 3.25rem;
  border: 1px solid var(--ecms-line, #dedbd6);
  border-top: 0;
  border-left: 5px solid var(--ecms-red, #d71920);
  border-radius: 14px;
  background: #fff;
  color: var(--ecms-black, #0d0e10);
  box-shadow: 0 10px 30px rgba(15, 16, 18, .06);
}

body.woocommerce-page .woocommerce-error:focus-visible,
body.woocommerce-page .woocommerce-info:focus-visible,
body.woocommerce-page .woocommerce-message:focus-visible {
  outline: 3px solid rgba(215, 25, 32, .22);
  outline-offset: 3px;
}

body.woocommerce-page .woocommerce a.button,
body.woocommerce-page .woocommerce button.button,
body.woocommerce-page .woocommerce input.button,
body.woocommerce-page .wc-block-components-button {
  min-height: 50px;
  border-radius: 999px;
  font-weight: 850;
}

/* Checkout: two clear desktop regions that collapse without reordering forms. */
body.woocommerce-checkout form.checkout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .8fr);
  column-gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}

body.woocommerce-checkout form.checkout > #customer_details {
  grid-column: 1;
  grid-row: 1 / span 3;
  width: 100%;
}

body.woocommerce-checkout form.checkout > #order_review_heading,
body.woocommerce-checkout form.checkout > #order_review {
  grid-column: 2;
  width: 100%;
}

body.woocommerce-checkout form.checkout > #order_review_heading {
  margin: 0;
  padding: 1.5rem 1.5rem .75rem;
  border: 1px solid var(--ecms-line, #dedbd6);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: #fff;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1.2;
}

body.woocommerce-checkout form.checkout > #order_review {
  padding: 0 1.5rem 1.5rem;
  border: 1px solid var(--ecms-line, #dedbd6);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: #fff;
  box-shadow: var(--ecms-card-shadow, 0 24px 70px rgba(15, 16, 18, .09));
}

body.woocommerce-checkout #customer_details .col-1,
body.woocommerce-checkout #customer_details .col-2 {
  float: none;
  width: 100%;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--ecms-line, #dedbd6);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 42px rgba(15, 16, 18, .06);
}

body.woocommerce-checkout #customer_details .col-2 {
  margin-top: 1.25rem;
}

body.woocommerce-checkout #customer_details h3 {
  margin: 0 0 1.25rem;
  color: var(--ecms-black, #0d0e10);
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  line-height: 1.2;
}

body.woocommerce-checkout table.shop_table {
  margin: 0 0 1.25rem;
  border: 0;
  border-collapse: collapse;
}

body.woocommerce-checkout table.shop_table th,
body.woocommerce-checkout table.shop_table td {
  padding: .9rem .25rem;
  border-color: var(--ecms-line, #dedbd6);
  overflow-wrap: anywhere;
}

body.woocommerce-checkout table.shop_table th:last-child,
body.woocommerce-checkout table.shop_table td:last-child {
  text-align: right;
}

body.woocommerce-checkout #payment {
  margin-top: 1.25rem;
  border: 1px solid var(--ecms-line, #dedbd6);
  border-radius: 16px;
  background: var(--ecms-paper, #f4f3f1);
}

body.woocommerce-checkout #payment ul.payment_methods {
  padding: 1rem;
  border-bottom-color: var(--ecms-line, #dedbd6);
}

body.woocommerce-checkout #payment ul.payment_methods > li {
  margin: 0;
  padding: .9rem;
  border-radius: 12px;
  background: #fff;
}

body.woocommerce-checkout #payment ul.payment_methods > li + li {
  margin-top: .75rem;
}

body.woocommerce-checkout #payment .payment_box {
  width: auto;
  margin: .75rem 0 0;
  border-radius: 10px;
  font-size: .94rem;
  line-height: 1.55;
}

body.woocommerce-checkout #payment .place-order {
  padding: 1rem;
}

body.woocommerce-checkout #payment .woocommerce-privacy-policy-text,
body.woocommerce-checkout #payment .woocommerce-terms-and-conditions-wrapper {
  color: #4d5459;
  font-size: .9rem;
  line-height: 1.65;
}

body.woocommerce-checkout #place_order {
  float: none;
  width: 100%;
  min-height: 56px;
  margin-top: .75rem;
  background: var(--ecms-red, #d71920);
  color: #fff;
  font-size: 1.02rem;
}

/* Checkout block parity. */
body.woocommerce-checkout .wc-block-checkout {
  max-width: none;
}

body.woocommerce-checkout .wc-block-checkout__main,
body.woocommerce-checkout .wc-block-checkout__sidebar {
  min-width: 0;
}

body.woocommerce-checkout .wc-block-components-checkout-step,
body.woocommerce-checkout .wc-block-checkout__sidebar .wc-block-components-sidebar-layout__sidebar {
  border-color: var(--ecms-line, #dedbd6);
  border-radius: 18px;
}

body.woocommerce-checkout .wc-block-components-checkout-step {
  margin-bottom: 1rem;
  padding: clamp(1rem, 2vw, 1.5rem);
  background: #fff;
}

/* Cart: preserve the familiar table while improving scanability. */
body.woocommerce-cart table.shop_table {
  border: 1px solid var(--ecms-line, #dedbd6);
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  box-shadow: 0 14px 42px rgba(15, 16, 18, .06);
}

body.woocommerce-cart table.shop_table th,
body.woocommerce-cart table.shop_table td {
  padding: 1rem;
  border-color: var(--ecms-line, #dedbd6);
}

body.woocommerce-cart .quantity .qty {
  width: 5.25rem;
  min-height: 48px;
}

body.woocommerce-cart .cart-collaterals .cart_totals {
  width: min(100%, 480px);
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--ecms-line, #dedbd6);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--ecms-card-shadow, 0 24px 70px rgba(15, 16, 18, .09));
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
  width: 100%;
  min-height: 56px;
  margin-bottom: 0;
  background: var(--ecms-red, #d71920);
  color: #fff;
  font-size: 1rem;
}

body.woocommerce-cart .cart-empty,
body.woocommerce-cart .wc-block-cart__empty-cart__title {
  margin: 0;
  padding: clamp(2.5rem, 7vw, 5rem) 1.25rem 1.25rem;
  border: 1px solid var(--ecms-line, #dedbd6);
  border-bottom: 0;
  border-left: 5px solid var(--ecms-red, #d71920);
  border-radius: 20px 20px 0 0;
  background: #fff;
  color: var(--ecms-black, #0d0e10);
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 850;
  text-align: center;
}

body.woocommerce-cart .return-to-shop {
  margin: 0;
  padding: 1rem 1.25rem clamp(2.5rem, 7vw, 5rem);
  border: 1px solid var(--ecms-line, #dedbd6);
  border-top: 0;
  border-left: 5px solid var(--ecms-red, #d71920);
  border-radius: 0 0 20px 20px;
  background: #fff;
  text-align: center;
}

/* My Account: native endpoints, forms, tables, addresses, and empty states. */
body.woocommerce-account .woocommerce-MyAccount-navigation {
  width: 25%;
  padding: 1rem;
  border-radius: 18px;
  background: var(--ecms-black, #0d0e10);
  box-shadow: var(--ecms-card-shadow, 0 24px 70px rgba(15, 16, 18, .09));
}

body.woocommerce-account .woocommerce-MyAccount-navigation ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

body.woocommerce-account .woocommerce-MyAccount-navigation li + li {
  border-top: 1px solid rgba(255, 255, 255, .12);
}

body.woocommerce-account .woocommerce-MyAccount-navigation a {
  display: block;
  padding: .8rem .9rem;
  border-radius: 10px;
  color: #fff;
  font-weight: 750;
  text-decoration: none;
}

body.woocommerce-account .woocommerce-MyAccount-navigation .is-active a,
body.woocommerce-account .woocommerce-MyAccount-navigation a:hover,
body.woocommerce-account .woocommerce-MyAccount-navigation a:focus-visible {
  background: var(--ecms-red, #d71920);
  color: #fff;
}

body.woocommerce-account .woocommerce-MyAccount-content {
  width: 71%;
  min-width: 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--ecms-line, #dedbd6);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 42px rgba(15, 16, 18, .06);
}

body.woocommerce-account .woocommerce-MyAccount-content > :first-child {
  margin-top: 0;
}

body.woocommerce-account .woocommerce-Addresses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

body.woocommerce-account .woocommerce-Addresses::before,
body.woocommerce-account .woocommerce-Addresses::after {
  display: none;
}

body.woocommerce-account .woocommerce-Addresses .col-1,
body.woocommerce-account .woocommerce-Addresses .col-2 {
  float: none;
  width: auto;
  padding: 1.25rem;
  border: 1px solid var(--ecms-line, #dedbd6);
  border-radius: 14px;
  background: var(--ecms-paper, #f4f3f1);
}

body.woocommerce-account .woocommerce-form-login,
body.woocommerce-account .woocommerce-form-register,
body.woocommerce-account .lost_reset_password,
body.woocommerce-account .woocommerce-EditAccountForm,
body.woocommerce-account .woocommerce-address-fields {
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--ecms-line, #dedbd6);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 42px rgba(15, 16, 18, .06);
}

body.woocommerce-account table.shop_table {
  border-color: var(--ecms-line, #dedbd6);
  background: #fff;
}

body.woocommerce-account table.shop_table th,
body.woocommerce-account table.shop_table td {
  padding: .9rem;
  border-color: var(--ecms-line, #dedbd6);
  overflow-wrap: anywhere;
}

body.woocommerce-account .woocommerce-order-details,
body.woocommerce-account .woocommerce-customer-details {
  margin-top: 2rem;
}

/* Reserve a clear final viewport row for the floating help control. */
body.woocommerce-cart .site-main,
body.woocommerce-checkout .site-main,
body.woocommerce-account .site-main {
  padding-bottom: max(6rem, calc(5rem + env(safe-area-inset-bottom)));
}

body.woocommerce-cart .ecms-whatsapp-button,
body.woocommerce-checkout .ecms-whatsapp-button,
body.woocommerce-account .ecms-whatsapp-button {
  bottom: max(14px, env(safe-area-inset-bottom));
  max-width: calc(100vw - 28px);
}

@media (max-width: 960px) {
  body.woocommerce-checkout form.checkout {
    grid-template-columns: 1fr;
  }

  body.woocommerce-checkout form.checkout > #customer_details,
  body.woocommerce-checkout form.checkout > #order_review_heading,
  body.woocommerce-checkout form.checkout > #order_review {
    grid-column: 1;
    grid-row: auto;
  }

  body.woocommerce-checkout form.checkout > #order_review_heading {
    margin-top: 1.5rem;
  }

  body.woocommerce-account .woocommerce-MyAccount-navigation,
  body.woocommerce-account .woocommerce-MyAccount-content {
    float: none;
    width: 100%;
  }

  body.woocommerce-account .woocommerce-MyAccount-navigation {
    margin-bottom: 1rem;
  }

  body.woocommerce-account .woocommerce-MyAccount-navigation ul {
    display: flex;
    gap: .35rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  body.woocommerce-account .woocommerce-MyAccount-navigation li,
  body.woocommerce-account .woocommerce-MyAccount-navigation li + li {
    flex: 0 0 auto;
    border: 0;
  }
}

@media (max-width: 767px) {
  body.woocommerce-page .woocommerce-error,
  body.woocommerce-page .woocommerce-info,
  body.woocommerce-page .woocommerce-message {
    padding: 1rem 1rem 1rem 2.8rem;
  }

  body.woocommerce-checkout #customer_details .col-1,
  body.woocommerce-checkout #customer_details .col-2,
  body.woocommerce-checkout form.checkout > #order_review,
  body.woocommerce-account .woocommerce-MyAccount-content {
    padding: 1rem;
  }

  body.woocommerce-checkout form.checkout > #order_review_heading {
    padding: 1.25rem 1rem .65rem;
  }

  body.woocommerce-cart table.shop_table_responsive tr,
  body.woocommerce-account table.shop_table_responsive tr {
    padding: .5rem 0;
    border-bottom: 1px solid var(--ecms-line, #dedbd6);
  }

  body.woocommerce-cart table.shop_table_responsive td,
  body.woocommerce-account table.shop_table_responsive td {
    min-height: 44px;
    padding: .65rem 1rem;
  }

  body.woocommerce-account .woocommerce-Addresses {
    grid-template-columns: 1fr;
  }

  body.woocommerce-cart .ecms-whatsapp-button,
  body.woocommerce-checkout .ecms-whatsapp-button,
  body.woocommerce-account .ecms-whatsapp-button {
    width: 48px;
    height: 48px;
    min-height: 48px;
  }
}

@media (max-width: 480px) {
  body.woocommerce-checkout form .form-row-first,
  body.woocommerce-checkout form .form-row-last,
  body.woocommerce-account form .form-row-first,
  body.woocommerce-account form .form-row-last {
    float: none;
    width: 100%;
  }

  body.woocommerce-cart table.shop_table td.actions .coupon {
    display: grid;
    grid-template-columns: 1fr;
    gap: .65rem;
    width: 100%;
  }

  body.woocommerce-cart table.shop_table td.actions .coupon .input-text,
  body.woocommerce-cart table.shop_table td.actions .coupon .button,
  body.woocommerce-cart table.shop_table td.actions > .button {
    width: 100%;
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.woocommerce-page .woocommerce *,
  body.woocommerce-page .woocommerce *::before,
  body.woocommerce-page .woocommerce *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
