/* ==========================================================================
   Ember & Haze — WooCommerce Checkout, Cart, Account & PDP Bridge Styles
   Harmonizes WooCommerce shortcodes & PDP interactive blocks with .eh-* tokens.
   ========================================================================== */

.eh-woo-shell {
  padding-top: 26px;
  padding-bottom: 56px;
}

.eh-woo-head {
  margin-bottom: 20px;
}

.eh-woo-head h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  color: var(--eh-charcoal);
}

.eh-woo-head p {
  margin: 0;
  color: var(--eh-muted);
  font-size: 14.5px;
}

/* ---------- WooCommerce Notices ---------- */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  margin: 0 0 18px;
  padding: 13px 16px !important;
  border-radius: 10px;
  border: 1px solid #fed7aa;
  border-top-width: 1px !important;
  background: var(--eh-amber-soft);
  color: #9a3412;
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  max-width: 100%;
  box-sizing: border-box;
}

.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
  display: none !important;
}

.woocommerce-message {
  border-color: #bbf7d0;
  background: var(--eh-sage-soft);
  color: #166534;
}

.woocommerce-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.woocommerce-error li {
  margin: 4px 0;
}

.woocommerce-message a.button,
.woocommerce-info a.button {
  display: inline-block;
  margin-left: 10px;
  color: var(--eh-amber);
  text-decoration: underline;
  font-weight: 700;
}

/* ---------- Dual-Column Checkout & Cart ---------- */
.eh-woo-shell .woocommerce {
  width: 100%;
}

form.woocommerce-checkout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
  gap: 24px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

form.woocommerce-checkout > *,
form.woocommerce-checkout > .col2-set,
form.woocommerce-checkout > #customer_details,
.woocommerce-billing-fields,
.woocommerce-shipping-fields,
.woocommerce-additional-fields,
.woocommerce-billing-fields__field-wrapper,
#order_review,
.eh-checkout-summary-card,
#payment {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

form.woocommerce-checkout > .col2-set,
form.woocommerce-checkout > #customer_details {
  background: #ffffff;
  border: 1px solid var(--eh-rule);
  border-radius: 14px;
  padding: 22px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

form.woocommerce-checkout .col-1,
form.woocommerce-checkout .col-2 {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  float: none;
}

.select2-container {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.eh-checkout-summary-card {
  background: #ffffff;
  border: 1px solid var(--eh-rule);
  border-radius: 14px;
  padding: 22px 24px;
  position: sticky;
  top: 108px;
}

.woocommerce form .form-row {
  margin: 0 0 13px;
  padding: 0;
}

.woocommerce form .form-row label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--eh-charcoal);
  margin-bottom: 5px;
}

.woocommerce form .form-row .required {
  color: var(--eh-crimson);
  text-decoration: none;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row select,
.woocommerce form .form-row textarea,
.eh-woo-shell .select2-container--default .select2-selection--single {
  width: 100%;
  min-height: 41px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--eh-rule-strong);
  background: #ffffff;
  color: var(--eh-charcoal);
  font-size: 14px;
  line-height: 1.35;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row select:focus,
.woocommerce form .form-row textarea:focus {
  outline: none;
  border-color: var(--eh-amber);
}

.woocommerce form .form-row-first,
.woocommerce form .form-row-last {
  width: 48.5%;
  display: inline-block;
  vertical-align: top;
}

.woocommerce form .form-row-first {
  margin-right: 3%;
}

.woocommerce form .form-row-wide {
  width: 100%;
  clear: both;
}

.eh-state-notice {
  display: none;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  margin: 8px 0 14px;
}

.eh-state-notice.is-visible {
  display: block;
}

table.woocommerce-checkout-review-order-table,
table.shop_table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 16px;
}

table.shop_table th,
table.shop_table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--eh-rule);
  text-align: left;
  vertical-align: middle;
}

table.shop_table thead th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--eh-muted);
}

table.shop_table tr.order-total th,
table.shop_table tr.order-total td {
  font-size: 17px;
  font-weight: 800;
  color: var(--eh-charcoal);
  border-top: 2px solid var(--eh-charcoal);
  border-bottom: none;
}

table.woocommerce-checkout-review-order-table th.product-total,
table.woocommerce-checkout-review-order-table td.product-total,
table.woocommerce-checkout-review-order-table tfoot td {
  text-align: right;
  white-space: nowrap;
}

table.woocommerce-checkout-review-order-table td.product-name {
  width: 65%;
  word-break: break-word;
}

#payment {
  background: var(--eh-linen);
  border: 1px solid var(--eh-rule);
  border-radius: 12px;
  padding: 16px;
  margin-top: 14px;
}

#payment ul.payment_methods {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 10px;
}

#payment ul.payment_methods li {
  background: #ffffff;
  border: 1px solid var(--eh-rule);
  border-radius: 10px;
  padding: 12px 14px;
}

#payment ul.payment_methods li label {
  font-weight: 700;
  cursor: pointer;
  margin-left: 6px;
}

#payment .payment_box {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--eh-rule);
  font-size: 13px;
  color: var(--eh-muted);
}

#payment #place_order,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce a.button.alt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--eh-amber);
  color: #ffffff;
  border: none;
  border-radius: 9px;
  padding: 12px 22px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.16s ease;
}

#payment #place_order {
  width: 100%;
}

#payment #place_order:hover,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover,
.woocommerce button.button:hover {
  background: var(--eh-amber-deep);
}

.woocommerce .checkout_coupon.woocommerce-form-coupon {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background: var(--eh-linen);
  border: 1px solid var(--eh-rule);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

/* ---------- Order Thank-You Review Links ---------- */
.eh-thankyou-review-bar {
  margin: 18px 0 22px;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--eh-sage-soft);
  border: 1px solid #bbf7d0;
}

.eh-thankyou-review-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.eh-btn--outline {
  background: #ffffff;
  color: var(--eh-charcoal);
  border: 1px solid var(--eh-rule-strong);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}

.eh-btn--outline:hover {
  border-color: var(--eh-amber);
  color: var(--eh-amber);
}

/* ---------- My Account Layout ---------- */
.woocommerce-account .woocommerce {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.woocommerce-account .woocommerce:has(#customer_login) {
  grid-template-columns: 1fr;
}

.woocommerce-MyAccount-navigation {
  background: #ffffff;
  border: 1px solid var(--eh-rule);
  border-radius: 14px;
  padding: 12px;
}

.woocommerce-MyAccount-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.woocommerce-MyAccount-navigation li a {
  display: block;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--eh-charcoal);
}

.woocommerce-MyAccount-navigation li.is-active a,
.woocommerce-MyAccount-navigation li a:hover {
  background: var(--eh-amber-soft);
  color: var(--eh-amber-deep);
}

.woocommerce-MyAccount-content {
  background: #ffffff;
  border: 1px solid var(--eh-rule);
  border-radius: 14px;
  padding: 22px 24px;
  min-width: 0;
  overflow-x: auto;
}

#customer_login.u-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

#customer_login .u-column1,
#customer_login .u-column2 {
  background: #ffffff;
  border: 1px solid var(--eh-rule);
  border-radius: 14px;
  padding: 24px;
  width: 100%;
  float: none;
}

/* ---------- Native Cart Page Dual-Column Responsive ---------- */
body.woocommerce-cart .eh-woo-shell .woocommerce {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.85fr);
  gap: 24px;
  align-items: start;
}

body.woocommerce-cart .eh-woo-shell .woocommerce > .woocommerce-notices-wrapper {
  grid-column: 1 / -1;
}

body.woocommerce-cart .woocommerce-cart-form,
body.woocommerce-cart .cart-collaterals {
  background: #ffffff;
  border: 1px solid var(--eh-rule);
  border-radius: 14px;
  padding: 20px 22px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

body.woocommerce-cart .cart-collaterals .cart_totals {
  width: 100% !important;
  float: none !important;
}

body.woocommerce-cart .cart-collaterals h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

body.woocommerce-cart table.cart td.product-thumbnail img {
  width: 64px !important;
  height: 64px !important;
  object-fit: contain;
  border: 1px solid var(--eh-rule);
  border-radius: 8px;
  padding: 4px;
  background: #ffffff;
}

body.woocommerce-cart table.cart td.actions .coupon {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

body.woocommerce-cart table.cart td.actions .coupon .input-text {
  min-width: 180px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--eh-rule-strong);
}

body.woocommerce-cart .wc-proceed-to-checkout {
  padding: 12px 0 0;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
  width: 100%;
  box-sizing: border-box;
}

/* ---------- PDP Consumable Tiers & 5-Star Breakdown Bridge ---------- */
.eh-tiers-box {
  background: var(--eh-linen);
  border: 1px solid var(--eh-rule);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.eh-tiers-box__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
}

.eh-tiers-box__title {
  font-weight: 800;
  color: var(--eh-charcoal);
}

.eh-tiers-box__code {
  font-size: 12px;
  color: var(--eh-espresso);
}

.eh-inline-apply {
  background: #ffffff;
  border: 1px solid var(--eh-amber);
  color: var(--eh-amber-deep);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 4px;
}

.eh-tiers-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.eh-tier-cell {
  background: #ffffff;
  border: 1px solid var(--eh-rule-strong);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}

.eh-tier-cell.is-active {
  border-color: var(--eh-amber);
  background: var(--eh-amber-soft);
}

.eh-tier-cell strong {
  display: block;
  font-size: 13px;
  color: var(--eh-charcoal);
}

.eh-tier-cell span {
  font-family: var(--eh-font-mono);
  font-size: 12px;
  color: var(--eh-amber-deep);
  font-weight: 700;
}

.eh-promo-slim {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--eh-linen);
  border: 1px solid var(--eh-rule);
  margin-bottom: 16px;
  font-size: 13px;
}

.eh-rev-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 18px;
  margin-bottom: 20px;
}

.eh-rev-box {
  background: #ffffff;
  border: 1px solid var(--eh-rule);
  border-radius: 12px;
  padding: 16px 18px;
}

.eh-star-row {
  width: 100%;
  display: grid;
  grid-template-columns: 58px 1fr 34px;
  align-items: center;
  gap: 10px;
  padding: 5px 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  border-radius: 6px;
}

.eh-star-row:hover {
  background: var(--eh-linen);
}

.eh-star-track {
  height: 8px;
  background: var(--eh-rule);
  border-radius: 99px;
  overflow: hidden;
  display: block;
}

.eh-star-fill {
  display: block;
  height: 100%;
  background: var(--eh-amber);
}

.eh-own-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--eh-sage-soft);
  color: var(--eh-sage);
  font-size: 11px;
  font-weight: 700;
}

.eh-drawer__coupons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.eh-coupon-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 99px;
  background: var(--eh-sage-soft);
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 11.5px;
  font-weight: 700;
}

.eh-coupon-chip button {
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 800;
  padding: 0;
  color: inherit;
}

@media (max-width: 960px) {
  form.woocommerce-checkout,
  .woocommerce-account .woocommerce,
  #customer_login.u-columns,
  body.woocommerce-cart .eh-woo-shell .woocommerce,
  .eh-rev-layout {
    grid-template-columns: 1fr;
  }
  .eh-checkout-summary-card {
    position: static;
  }
}

@media (max-width: 560px) {
  .woocommerce form .form-row-first,
  .woocommerce form .form-row-last {
    width: 100%;
    margin-right: 0;
    display: block;
  }
  form.woocommerce-checkout > #customer_details,
  .eh-checkout-summary-card,
  .woocommerce-MyAccount-content {
    padding: 16px 14px;
  }
  table.woocommerce-checkout-review-order-table,
  table.shop_table {
    table-layout: fixed;
    width: 100%;
  }
  table.woocommerce-checkout-review-order-table th,
  table.woocommerce-checkout-review-order-table td,
  table.shop_table th,
  table.shop_table td {
    word-break: break-word;
    overflow-wrap: anywhere;
  }
}

/* WordPress admin bar sticky offset compatibility */
@media (min-width: 783px) {
  body.admin-bar .eh-header {
    top: 32px;
  }
  body.admin-bar .eh-drawer {
    top: 32px;
    height: calc(100vh - 32px);
  }
}
@media (min-width: 601px) and (max-width: 782px) {
  body.admin-bar .eh-header {
    top: 46px;
  }
}
