/* EastMorrow V9.4 — cart + checkout (Woo Blocks) corporate polish */
body.woocommerce-cart .shell.page-main.em-checkout-surface,
body.woocommerce-checkout .shell.page-main.em-checkout-surface,
.em-checkout-surface{
  --em-shop-content:72rem;
  --em-shop-gutter:6rem;
  width:min(var(--em-shop-content),calc(100% - var(--em-shop-gutter)));
  margin-inline:auto;
  padding-block:1.75rem 3.5rem;
  max-width:none;
}

.em-checkout-surface .page-heading.em-checkout-heading,
.em-checkout-surface .em-checkout-heading{
  display:grid;gap:.55rem;margin:0 0 1.5rem;max-width:48rem;
}
.em-checkout-surface .em-checkout-heading .eyebrow{
  margin:0;color:var(--color-brand,#164d4a);font-size:.75rem;letter-spacing:.14em;
  text-transform:uppercase;font-weight:750;
}
.em-checkout-surface .em-checkout-heading h1{
  margin:0;font-family:var(--font-display,Archivo,Arial,sans-serif);
  font-size:clamp(1.85rem,3vw,2.45rem);letter-spacing:-.035em;line-height:1.15;
  color:var(--color-ink,#1e3033);font-weight:650;
}
.em-checkout-surface .em-checkout-heading .lede{
  margin:0;max-width:52ch;font-size:1.02rem;line-height:1.65;color:var(--color-muted,#526a6d);
}

/* Unlock the legacy 950px page-content clamp on commerce surfaces */
.em-checkout-surface .page-content,
.em-checkout-surface .page-content.em-checkout-content,
body.woocommerce-cart .page-content,
body.woocommerce-checkout .page-content{
  max-width:none;width:100%;
}
.em-checkout-surface .page-content form{max-width:none}

/* Cart / checkout block shell */
body.woocommerce-cart .wp-block-woocommerce-cart,
body.woocommerce-checkout .wp-block-woocommerce-checkout,
.em-checkout-surface .wp-block-woocommerce-cart,
.em-checkout-surface .wp-block-woocommerce-checkout{
  margin:0;max-width:none;
}

/* Empty cart */
.em-checkout-surface .wc-block-cart__empty-cart__title,
.em-checkout-surface .wp-block-heading.with-empty-cart-icon{
  font-family:var(--font-display,Archivo,Arial,sans-serif);
  font-size:clamp(1.35rem,2.4vw,1.75rem);letter-spacing:-.02em;
  color:var(--color-ink,#1e3033);margin:0 0 1rem;font-weight:650;
}
.em-checkout-surface .wp-block-separator{border:0;border-top:1px solid rgba(22,77,74,.14);margin:1.75rem 0}
.em-checkout-surface .wp-block-heading.has-text-align-center:not(.with-empty-cart-icon){
  font-family:var(--font-display,Archivo,Arial,sans-serif);
  font-size:1.25rem;letter-spacing:-.02em;margin:0 0 1.15rem;color:var(--color-ink);
}

/* Empty-cart “New in store” product grid → V9 cards */
.em-checkout-surface .wc-block-grid__products{
  display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));
  gap:1.4rem 1.15rem;margin:0;padding:0;list-style:none;
}
.em-checkout-surface .wc-block-grid__products::before,
.em-checkout-surface .wc-block-grid__products::after{display:none!important;content:none!important}
.em-checkout-surface .wc-block-grid__product{
  margin:0!important;float:none;min-width:0;
  display:flex;flex-direction:column;
  border-radius:14px;overflow:hidden;
  border:1px solid rgba(22,77,74,.12);background:#fff;
  box-shadow:0 6px 20px rgba(30,48,51,.045);
  padding:0 0 1rem;
  transition:transform .28s cubic-bezier(.2,.7,.2,1),box-shadow .28s ease,border-color .28s ease;
}
.em-checkout-surface .wc-block-grid__product:hover{
  transform:translateY(-4px);
  box-shadow:0 16px 36px rgba(22,77,74,.12);
  border-color:rgba(22,77,74,.28);
}
.em-checkout-surface .wc-block-grid__product-image img{
  display:block;width:100%;aspect-ratio:1;object-fit:cover;background:#e8f0ed;
}
.em-checkout-surface .wc-block-grid__product-title{
  padding:.9rem 1rem .25rem;font-size:1rem;font-weight:650;line-height:1.35;
  color:var(--color-ink,#1e3033);letter-spacing:-.02em;
}
.em-checkout-surface .wc-block-grid__product-price{
  padding:0 1rem .75rem;font-size:1.05rem;font-weight:700;color:var(--color-ink);margin:0;
}
.em-checkout-surface .wc-block-grid__product-add-to-cart{padding:0 1rem;margin-top:auto}
.em-checkout-surface .wc-block-grid__product-add-to-cart .wp-block-button__link,
.em-checkout-surface .wc-block-grid__product a.add_to_cart_button{
  display:inline-flex;align-items:center;justify-content:center;width:100%;
  min-height:44px;border-radius:8px;padding:.65rem 1rem;
  background:var(--color-ink,#1e3033);border:1px solid var(--color-ink,#1e3033);
  color:#fcfcfa!important;font-weight:700;font-size:.9rem;text-decoration:none;
  transition:background-color .2s ease,border-color .2s ease,box-shadow .2s ease,transform .2s ease;
}
.em-checkout-surface .wc-block-grid__product-add-to-cart .wp-block-button__link:hover,
.em-checkout-surface .wc-block-grid__product a.add_to_cart_button:hover{
  background:var(--color-brand,#164d4a);border-color:var(--color-brand,#164d4a);
  box-shadow:inset 0 -2px 0 var(--em-sun,#e9c957);transform:translateY(-1px);color:#fff!important;
}
.em-checkout-surface .wc-block-grid__product-add-to-cart .wp-block-button__link:focus-visible,
.em-checkout-surface .wc-block-grid__product a.add_to_cart_button:focus-visible{
  outline:3px solid var(--em-sun,#e9c957);outline-offset:3px;
}

/* Filled cart line items as cards */
.em-checkout-surface .wc-block-cart-items,
.em-checkout-surface table.wc-block-cart-items{
  border:1px solid rgba(22,77,74,.12);border-radius:14px;overflow:hidden;
  background:#fff;box-shadow:0 6px 20px rgba(30,48,51,.04);
}
.em-checkout-surface .wc-block-cart-items__header{
  background:var(--color-surface,#f3f6f5);border-bottom:1px solid rgba(22,77,74,.1);
}
.em-checkout-surface .wc-block-cart-items__header th{
  font-size:.72rem;letter-spacing:.08em;text-transform:uppercase;font-weight:750;
  color:var(--color-muted,#526a6d);padding:.85rem 1rem;
}
.em-checkout-surface .wc-block-cart-items__row{
  border-bottom:1px solid rgba(22,77,74,.1);
}
.em-checkout-surface .wc-block-cart-items__row:last-child{border-bottom:0}
.em-checkout-surface .wc-block-cart-item__image img{
  border-radius:10px;border:1px solid rgba(22,77,74,.1);background:#e8f0ed;
}
.em-checkout-surface .wc-block-cart-item__product a{
  color:var(--color-ink,#1e3033);font-weight:650;text-decoration:none;
}
.em-checkout-surface .wc-block-cart-item__product a:hover{
  color:var(--color-brand,#164d4a);text-decoration:underline;text-underline-offset:3px;
}
.em-checkout-surface .wc-block-cart-item__remove-link{
  color:var(--color-muted,#526a6d);font-size:.82rem;
}
.em-checkout-surface .wc-block-cart-item__remove-link:hover{color:#a83324}

/* Quantity controls */
.em-checkout-surface .wc-block-components-quantity-selector{
  border:1px solid #9bb1ab;border-radius:8px;overflow:hidden;background:#fff;
}
.em-checkout-surface .wc-block-components-quantity-selector__button{
  min-width:2.25rem;min-height:2.25rem;color:var(--color-ink);
  transition:background-color .15s ease;
}
.em-checkout-surface .wc-block-components-quantity-selector__button:hover{background:var(--color-surface,#f3f6f5)}
.em-checkout-surface .wc-block-components-quantity-selector__button:focus-visible{
  outline:3px solid var(--em-sun,#e9c957);outline-offset:2px;
}
.em-checkout-surface .wc-block-components-quantity-selector__input{
  min-height:2.25rem;font-weight:650;color:var(--color-ink);border:0;
}
.em-checkout-surface .wc-block-components-quantity-selector__input:focus{
  outline:none;box-shadow:inset 0 0 0 2px rgba(22,77,74,.2);
}

/* Order summary / sidebar */
.em-checkout-surface .wp-block-woocommerce-cart-totals-block,
.em-checkout-surface .wp-block-woocommerce-checkout-order-summary-block,
.em-checkout-surface .wc-block-cart__sidebar,
.em-checkout-surface .wc-block-checkout__sidebar{
  border:1px solid rgba(22,77,74,.14);border-radius:14px;
  background:var(--color-surface,#f3f6f5);
  box-shadow:0 8px 24px rgba(30,48,51,.05);
  padding:1.15rem 1.2rem 1.25rem;
}
.em-checkout-surface .wc-block-cart__totals-title,
.em-checkout-surface .wc-block-components-checkout-order-summary__title-text{
  font-family:var(--font-display,Archivo,Arial,sans-serif);
  font-size:1.15rem;letter-spacing:-.02em;font-weight:650;color:var(--color-ink);
}
.em-checkout-surface .wc-block-components-totals-item{
  border-color:rgba(22,77,74,.1)!important;
}
.em-checkout-surface .wc-block-components-totals-item__label{color:var(--color-muted);font-size:.9rem}
.em-checkout-surface .wc-block-components-totals-item__value{font-weight:650;color:var(--color-ink)}
.em-checkout-surface .wc-block-components-totals-footer-item .wc-block-components-totals-item__label,
.em-checkout-surface .wc-block-components-totals-footer-item .wc-block-components-totals-item__value{
  font-size:1.05rem;font-weight:750;color:var(--color-ink);
}

/* Coupon */
.em-checkout-surface .wc-block-components-totals-coupon__form{
  display:flex;gap:.55rem;align-items:stretch;flex-wrap:wrap;
}
.em-checkout-surface .wc-block-components-totals-coupon__input input,
.em-checkout-surface .wc-block-components-totals-coupon__input .wc-block-components-text-input input{
  min-height:46px;border-radius:8px;border:1px solid #9bb1ab;background:#fff;
  transition:border-color .2s ease,box-shadow .2s ease;
}
.em-checkout-surface .wc-block-components-totals-coupon__input input:focus,
.em-checkout-surface .wc-block-components-text-input input:focus,
.em-checkout-surface .wc-block-components-textarea textarea:focus,
.em-checkout-surface .wc-block-components-combobox input:focus,
.em-checkout-surface .wc-block-components-select select:focus{
  outline:none;border-color:var(--color-brand,#164d4a);box-shadow:0 0 0 3px rgba(22,77,74,.15);
}
.em-checkout-surface .wc-block-components-totals-coupon__button,
.em-checkout-surface .wc-block-cart__submit-button,
.em-checkout-surface .wc-block-components-checkout-place-order-button,
.em-checkout-surface .wc-block-components-button:not(.is-link):not(.wc-block-components-quantity-selector__button){
  min-height:46px;border-radius:8px!important;
  background:var(--color-ink,#1e3033)!important;border:1px solid var(--color-ink,#1e3033)!important;
  color:#fcfcfa!important;font-weight:700!important;
  transition:background-color .2s ease,border-color .2s ease,box-shadow .2s ease,transform .2s ease;
}
.em-checkout-surface .wc-block-components-totals-coupon__button:hover,
.em-checkout-surface .wc-block-cart__submit-button:hover,
.em-checkout-surface .wc-block-components-checkout-place-order-button:hover,
.em-checkout-surface .wc-block-components-button:not(.is-link):not(.wc-block-components-quantity-selector__button):hover{
  background:var(--color-brand,#164d4a)!important;border-color:var(--color-brand,#164d4a)!important;
  box-shadow:inset 0 -2px 0 var(--em-sun,#e9c957);transform:translateY(-1px);color:#fff!important;
}
.em-checkout-surface .wc-block-components-totals-coupon__button:focus-visible,
.em-checkout-surface .wc-block-cart__submit-button:focus-visible,
.em-checkout-surface .wc-block-components-checkout-place-order-button:focus-visible,
.em-checkout-surface .wc-block-components-button:not(.is-link):focus-visible{
  outline:3px solid var(--em-sun,#e9c957)!important;outline-offset:3px;
}
.em-checkout-surface .wc-block-components-totals-coupon__button--loading,
.em-checkout-surface .wc-block-cart__submit-button--loading,
.em-checkout-surface .wc-block-components-checkout-place-order-button--loading{
  opacity:.72;cursor:wait;
}

/* Checkout fields */
.em-checkout-surface .wc-block-components-text-input input,
.em-checkout-surface .wc-block-components-textarea textarea,
.em-checkout-surface .wc-block-components-combobox .components-combobox-control__input,
.em-checkout-surface .wc-block-components-select select,
.em-checkout-surface .wc-blocks-components-select .wc-blocks-components-select__select{
  border-radius:8px!important;border-color:#9bb1ab!important;min-height:46px;
  background:#fff!important;color:var(--color-ink)!important;
  transition:border-color .2s ease,box-shadow .2s ease;
}
.em-checkout-surface .wc-block-components-text-input.is-active input,
.em-checkout-surface .wc-block-components-text-input input:focus{
  border-color:var(--color-brand,#164d4a)!important;box-shadow:0 0 0 3px rgba(22,77,74,.15)!important;
}
.em-checkout-surface .wc-block-components-text-input.has-error input,
.em-checkout-surface .wc-block-components-textarea.has-error textarea,
.em-checkout-surface .wc-block-components-validation-error{
  border-color:#c4573c!important;
}
.em-checkout-surface .wc-block-components-validation-error,
.em-checkout-surface .wc-block-components-text-input .wc-block-components-validation-error{
  color:#a83324;font-size:.82rem;
}
.em-checkout-surface .wc-block-components-checkbox__label,
.em-checkout-surface .wc-block-checkout__terms{
  color:var(--color-text,#30484b);font-size:.92rem;line-height:1.55;
}

/* Payment methods + BACS readability */
.em-checkout-surface .wc-block-components-radio-control__option,
.em-checkout-surface .wc-block-components-radio-control-accordion-option{
  border:1px solid rgba(22,77,74,.14)!important;border-radius:12px!important;
  background:#fff!important;margin:0 0 .75rem!important;padding:.35rem .15rem;
  transition:border-color .2s ease,box-shadow .2s ease;
}
.em-checkout-surface .wc-block-components-radio-control__option-checked,
.em-checkout-surface .wc-block-components-radio-control-accordion-option--checked-option-highlighted{
  border-color:rgba(22,77,74,.4)!important;
  box-shadow:0 0 0 3px rgba(22,77,74,.1);
}
.em-checkout-surface .wc-block-components-radio-control__label{
  font-weight:700;color:var(--color-ink);font-size:.98rem;
}
.em-checkout-surface .wc-block-components-radio-control__description,
.em-checkout-surface .wc-block-components-radio-control__secondary-description,
.em-checkout-surface .wc-block-components-radio-control-accordion-content{
  color:var(--color-muted,#526a6d)!important;font-size:.9rem!important;line-height:1.65!important;
}
.em-checkout-surface .wc-block-components-radio-control-accordion-content p,
.em-checkout-surface .wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-content{
  max-width:62ch;
}
.em-checkout-surface .wc-block-components-radio-control-accordion-content ul,
.em-checkout-surface .wc-block-components-radio-control-accordion-content ol{
  margin:.5rem 0 .75rem;padding-left:1.15rem;
}
.em-checkout-surface .wc-block-components-radio-control-accordion-content li+li{margin-top:.35rem}
.em-checkout-surface .wc-block-components-radio-control-accordion-content strong{
  color:var(--color-ink);font-weight:700;
}

/* Notices */
.em-checkout-surface .wc-block-components-notice-banner,
body.woocommerce-cart .woocommerce-message,
body.woocommerce-cart .woocommerce-info,
body.woocommerce-checkout .woocommerce-message,
body.woocommerce-checkout .woocommerce-info{
  border-radius:10px;border:1px solid #c1dcd8;border-left:3px solid var(--color-brand,#164d4a);
  background:#edf6f5;color:var(--color-text);
}
.em-checkout-surface .wc-block-components-notice-banner.is-error,
body.woocommerce-cart .woocommerce-error,
body.woocommerce-checkout .woocommerce-error{
  background:#fff3f0;border-color:#e4c3b9;border-left-color:#a83324;
}

/* Return to cart link */
.em-checkout-surface .wc-block-components-checkout-return-to-cart-button{
  color:var(--color-brand,#164d4a)!important;font-weight:650;
  text-decoration:none!important;
}
.em-checkout-surface .wc-block-components-checkout-return-to-cart-button:hover{
  text-decoration:underline!important;text-underline-offset:3px;
}

/* ZH rhythm */
html[lang^=zh] .em-checkout-surface .em-checkout-heading h1{letter-spacing:0;line-height:1.3}
html[lang^=zh] .em-checkout-surface .em-checkout-heading .lede{line-height:1.75}
html[lang^=zh] .em-checkout-surface .wc-block-grid__product-title{letter-spacing:0;line-height:1.45}
html[lang^=zh] .em-checkout-surface .wc-block-components-radio-control-accordion-content{line-height:1.75!important}

@media(max-width:960px){
  .em-checkout-surface{--em-shop-gutter:3rem;padding-block:1.4rem 2.75rem}
  .em-checkout-surface .wc-block-grid__products{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:640px){
  .em-checkout-surface{--em-shop-gutter:2rem;width:calc(100% - 2rem);padding-block:1.15rem 2.25rem}
  .em-checkout-surface .wc-block-grid__products{grid-template-columns:1fr;gap:1.15rem}
  .em-checkout-surface .wp-block-woocommerce-cart-totals-block,
  .em-checkout-surface .wp-block-woocommerce-checkout-order-summary-block,
  .em-checkout-surface .wc-block-cart__sidebar,
  .em-checkout-surface .wc-block-checkout__sidebar{padding:1rem}
  .em-checkout-surface .wc-block-components-totals-coupon__form{flex-direction:column}
  .em-checkout-surface .wc-block-components-totals-coupon__button{width:100%}
}
@media(prefers-reduced-motion:reduce){
  .em-checkout-surface .wc-block-grid__product,
  .em-checkout-surface .wc-block-components-button,
  .em-checkout-surface .wc-block-cart__submit-button,
  .em-checkout-surface .wc-block-components-checkout-place-order-button{
    transition:none!important;
  }
  .em-checkout-surface .wc-block-grid__product:hover,
  .em-checkout-surface .wc-block-components-button:hover,
  .em-checkout-surface .wc-block-cart__submit-button:hover,
  .em-checkout-surface .wc-block-components-checkout-place-order-button:hover{transform:none}
}

/* ===== V9.7 Round-7: cart / checkout mobile touch ===== */
.em-checkout-surface .wc-block-components-button,
.em-checkout-surface .wc-block-cart__submit-button,
.em-checkout-surface .wc-block-components-checkout-place-order-button,
.em-checkout-surface .woocommerce-cart-form .button,
.em-checkout-surface .wc-proceed-to-checkout .checkout-button{
  min-height:var(--em-tap, 2.75rem)!important;
}
@media(max-width:640px){
  .em-checkout-surface .wc-block-components-product-name{
    font-size:1rem;
    line-height:1.4;
  }
  .em-checkout-surface .wc-block-cart-items,
  .em-checkout-surface table.shop_table{
    font-size:.9375rem;
  }
  .em-checkout-surface input.qty,
  .em-checkout-surface .wc-block-components-quantity-selector input{
    min-height:var(--em-tap, 2.75rem);
  }
}

/* ===== V9.13 Round-13: checkout / cart CTA micro-align with shop ATC ===== */
.em-checkout-surface .wc-proceed-to-checkout .checkout-button,
.em-checkout-surface a.checkout-button{
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:var(--em-tap, 2.75rem)!important;
  border-radius:8px!important;
  border:1px solid var(--color-ink,#1e3033)!important;
  background:var(--color-ink,#1e3033)!important;
  color:#fcfcfa!important;
  font-weight:700!important;
  text-decoration:none!important;
  transition:background-color .2s ease,border-color .2s ease,box-shadow .2s ease,transform .2s ease;
}
.em-checkout-surface .wc-proceed-to-checkout .checkout-button:hover,
.em-checkout-surface a.checkout-button:hover{
  background:var(--color-brand,#164d4a)!important;
  border-color:var(--color-brand,#164d4a)!important;
  box-shadow:inset 0 -2px 0 var(--em-sun,#e9c957);
  transform:translateY(-1px);
  color:#fff!important;
}
.em-checkout-surface .wc-proceed-to-checkout .checkout-button:focus-visible,
.em-checkout-surface a.checkout-button:focus-visible{
  outline:3px solid var(--em-sun,#e9c957)!important;
  outline-offset:3px;
}
.em-checkout-surface .wc-block-cart__submit-button,
.em-checkout-surface .wc-block-components-checkout-place-order-button{
  min-height:var(--em-tap, 2.75rem)!important;
}

/* ===== V9.28 Round-28: cart/checkout CTA disabled + empty-grid ATC ===== */
.em-checkout-surface .wc-block-cart__submit-button:disabled,
.em-checkout-surface .wc-block-components-checkout-place-order-button:disabled,
.em-checkout-surface .wc-block-components-totals-coupon__button:disabled,
.em-checkout-surface .wc-block-components-button:disabled,
.em-checkout-surface .wc-block-components-button[aria-disabled="true"],
.em-checkout-surface .wc-block-components-button.is-disabled,
.em-checkout-surface .wc-proceed-to-checkout .checkout-button[aria-disabled="true"],
.em-checkout-surface a.checkout-button[aria-disabled="true"],
.em-checkout-surface a.checkout-button.disabled{
  opacity: .55 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
  pointer-events: none;
  filter: none !important;
}
.em-checkout-surface .wc-block-grid__product-add-to-cart .wp-block-button__link,
.em-checkout-surface .wc-block-grid__product a.add_to_cart_button{
  min-height: var(--em-tap, 2.75rem);
}
.em-checkout-surface .wc-block-grid__product a.add_to_cart_button.loading{
  opacity: .72;
  cursor: wait;
  pointer-events: none;
  transform: none !important;
}
.em-checkout-surface .wc-block-grid__product a.added_to_cart{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 2rem);
  margin: .45rem 1rem 0;
  min-height: 2.25rem;
  font-size: .8125rem;
  font-weight: 700;
  color: var(--color-brand, #164d4a) !important;
  text-decoration: none !important;
}
.em-checkout-surface .wc-block-grid__product a.added_to_cart:hover{
  text-decoration: underline !important;
  text-underline-offset: 3px;
}
.em-checkout-surface .wc-block-grid__product a.added_to_cart:focus-visible{
  outline: 3px solid var(--em-sun, #e9c957);
  outline-offset: 3px;
  border-radius: 4px;
}
@media (hover: none), (pointer: coarse){
  .em-checkout-surface .wc-block-cart__submit-button:hover,
  .em-checkout-surface .wc-block-components-checkout-place-order-button:hover,
  .em-checkout-surface .wc-proceed-to-checkout .checkout-button:hover,
  .em-checkout-surface a.checkout-button:hover,
  .em-checkout-surface .wc-block-grid__product-add-to-cart .wp-block-button__link:hover,
  .em-checkout-surface .wc-block-grid__product a.add_to_cart_button:hover{
    transform: none;
  }
}
