/* Keep classic and block checkout surfaces readable in either theme mode. */
.woocommerce-cart,
.woocommerce-checkout,
.wc-block-cart,
.wc-block-checkout {
  color: var(--ink);
}

/* PayPal Payments injects its own button frame. Give that frame room and a
   clear place after the native action whenever the plugin renders it there. */
.woocommerce-checkout #payment .place-order{display:flex;flex-direction:column;align-items:stretch;gap:14px}
.woocommerce-checkout #payment #place_order{order:1;width:100%;min-height:54px;background:linear-gradient(110deg,#123f30,#19734b 58%,#9d7548);border:1px solid #c8a578;color:#fff!important;font-weight:700;text-shadow:0 1px 1px #102c21}
.woocommerce-checkout #payment #place_order:hover{background:linear-gradient(110deg,#0e3528,#145f3e 58%,#87613a);filter:none}
.woocommerce-checkout :is(.ppc-button-wrapper,#ppc-button-ppcp-gateway,.wc-ppcp-checkout-container),
.wc-block-checkout :is(.wc-block-components-express-payment,.wc-block-components-express-payment-continue-rule){width:100%;max-width:100%;min-width:0;overflow:visible}
.woocommerce-checkout :is(.ppc-button-wrapper,#ppc-button-ppcp-gateway,.wc-ppcp-checkout-container){order:2;margin-block:8px;}
.woocommerce-checkout :is(.ppc-button-wrapper iframe,#ppc-button-ppcp-gateway iframe,.wc-ppcp-checkout-container iframe){max-width:100%!important}
@media(max-width:720px){.woocommerce-checkout #payment .place-order{gap:12px}.woocommerce-checkout :is(.ppc-button-wrapper,#ppc-button-ppcp-gateway,.wc-ppcp-checkout-container),.wc-block-checkout .wc-block-components-express-payment{width:100%!important;max-width:100%!important;margin-inline:0!important}.woocommerce-checkout :is(.ppc-button-wrapper iframe,#ppc-button-ppcp-gateway iframe,.wc-ppcp-checkout-container iframe){width:100%!important}}

.woocommerce-cart :is(h1,h2,h3,h4,p,td,th,label,small,strong,em,legend),
.woocommerce-checkout :is(h1,h2,h3,h4,p,td,th,label,small,strong,em,legend),
.wc-block-cart :is(h1,h2,h3,h4,p,td,th,label,small,strong,em,legend),
.wc-block-checkout :is(h1,h2,h3,h4,p,td,th,label,small,strong,em,legend) {
  color: var(--ink);
}

.woocommerce-checkout :is(input,select,textarea),
.woocommerce-cart :is(input,select,textarea),
.wc-block-cart :is(input,select,textarea),
.wc-block-checkout :is(input,select,textarea),
.wc-block-components-text-input input,
.wc-block-components-combobox .components-combobox-control__input,
.wc-blocks-components-select__select {
  color: var(--ink) !important;
  background: var(--surface) !important;
  border-color: var(--line) !important;
  caret-color: var(--ink);
}

.woocommerce-checkout :is(input,textarea)::placeholder,
.woocommerce-cart :is(input,textarea)::placeholder,
.wc-block-cart :is(input,textarea)::placeholder,
.wc-block-checkout :is(input,textarea)::placeholder {
  color: var(--muted);
  opacity: .85;
}

.woocommerce-checkout :is(#order_review,.woocommerce-checkout-review-order,#payment,.payment_box),
.woocommerce-cart :is(.cart-collaterals,.cart_totals),
.wc-block-cart :is(.wc-block-cart__main,.wc-block-cart__sidebar),
.wc-block-checkout :is(.wc-block-components-order-summary,.wc-block-checkout__main) {
  color: var(--ink);
  background-color: var(--surface);
  border-color: var(--line);
}

.woocommerce-checkout #payment div.payment_box {
  color: var(--ink);
  background: var(--paper);
}

.woocommerce-checkout #payment div.payment_box::before {
  border-bottom-color: var(--paper);
}

.woocommerce-checkout a,
.woocommerce-cart a,
.wc-block-cart a,
.wc-block-checkout a {
  color: var(--ink);
  text-decoration-color: var(--accent);
}

.woocommerce-checkout :is(.woocommerce-privacy-policy-text,.woocommerce-terms-and-conditions-wrapper),
.woocommerce-checkout .form-row .required {
  color: var(--muted);
}

.woocommerce-checkout .woocommerce-terms-and-conditions,
.wc-block-components-notice-banner,
.woocommerce-checkout .woocommerce-info,
.woocommerce-checkout .woocommerce-message,
.woocommerce-checkout .woocommerce-error,
.woocommerce-cart .woocommerce-info,
.woocommerce-cart .woocommerce-message,
.woocommerce-cart .woocommerce-error {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--accent);
}

.wc-block-components-text-input label,
.wc-block-components-select label,
.wc-block-components-checkbox label,
.wc-block-components-radio-control__label {
  color: var(--ink) !important;
}

.wc-block-components-totals-item,
.wc-block-components-totals-footer-item,
.wc-block-components-order-summary-item,
.wc-block-components-radio-control-accordion-option {
  color: var(--ink);
  border-color: var(--line);
}

.woocommerce-checkout :is(input,select,textarea):focus,
.woocommerce-cart :is(input,select,textarea):focus,
.wc-block-checkout :is(input,select,textarea):focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 1px var(--accent);
}

/* Keep the native Woo checkout comfortable on narrow phones and tablets. */
@media (max-width: 720px) {
  body.woocommerce-checkout .ls-commerce,
  body.woocommerce-cart .ls-commerce { width: calc(100% - 24px); padding-block: 28px 52px; }
  body.woocommerce-checkout .ls-page-heading h1,
  body.woocommerce-cart .ls-page-heading h1 { font-size: clamp(1.8rem, 9vw, 2.65rem); }
  .woocommerce-checkout form.checkout,
  .woocommerce-cart form.woocommerce-cart-form { width: 100%; }
  .woocommerce-checkout #customer_details .col-1,
  .woocommerce-checkout #customer_details .col-2,
  .woocommerce-checkout .form-row-first,
  .woocommerce-checkout .form-row-last,
  .woocommerce-checkout .form-row,
  .woocommerce-cart .form-row { float: none; width: 100%; margin-inline: 0; }
  .woocommerce-checkout #customer_details .col-1,
  .woocommerce-checkout #customer_details .col-2 { margin-bottom: 22px; }
  .woocommerce-checkout .form-row label,
  .woocommerce-checkout .form-row input,
  .woocommerce-checkout .form-row select,
  .woocommerce-checkout .form-row textarea,
  .woocommerce-cart .form-row input,
  .woocommerce-cart .form-row select { width: 100%; }
  .woocommerce-checkout .form-row input,
  .woocommerce-checkout .form-row select,
  .woocommerce-checkout .form-row textarea { min-height: 48px; font-size: 16px; }
  .woocommerce-checkout #order_review_heading { margin-top: 28px; font-size: 1.35rem; }
  .woocommerce-checkout table.shop_table,
  .woocommerce-cart table.shop_table { font-size: .78rem; }
  .woocommerce-checkout table.shop_table th,
  .woocommerce-checkout table.shop_table td,
  .woocommerce-cart table.shop_table th,
  .woocommerce-cart table.shop_table td { padding: 8px 6px; overflow-wrap: anywhere; }
  .woocommerce-checkout #payment ul.payment_methods { padding: 12px; }
  .woocommerce-checkout #payment .place-order { padding: 12px 0; }
  .woocommerce-checkout #payment button#place_order,
  .wc-block-checkout .wc-block-components-checkout-place-order-button { width: 100%; min-height: 52px; justify-content: center; }
  .wc-block-checkout .wc-block-checkout__main,
  .wc-block-checkout .wc-block-checkout__sidebar,
  .wc-block-cart .wc-block-cart__main,
  .wc-block-cart .wc-block-cart__sidebar { width: 100%; max-width: 100%; margin-inline: 0; }
  .wc-block-components-order-summary { margin-block: 18px; }
  .wc-block-components-notice-banner { padding: 12px; }
  .woocommerce-checkout :is(.woocommerce-info,.woocommerce-message,.woocommerce-error),
  .woocommerce-cart :is(.woocommerce-info,.woocommerce-message,.woocommerce-error) { padding: 12px 12px 12px 42px; font-size: .82rem; }
}

/* Keep cart line prices inside the viewport on narrow phones. */
.woocommerce-cart .woocommerce-cart-form,.woocommerce-cart .woocommerce-cart-form__contents,.woocommerce-cart .woocommerce table.shop_table,.woocommerce-checkout .woocommerce table.shop_table{width:100%;max-width:100%;min-width:0}
.woocommerce-cart .woocommerce table.shop_table,.woocommerce-checkout .woocommerce table.shop_table{table-layout:fixed;border-collapse:collapse}
.woocommerce-cart table.shop_table td,.woocommerce-cart table.shop_table th,.woocommerce-checkout table.shop_table td,.woocommerce-checkout table.shop_table th{min-width:0;overflow-wrap:anywhere}
.woocommerce-cart table.shop_table .product-price,.woocommerce-cart table.shop_table .product-subtotal,.woocommerce-checkout table.shop_table .product-total,.woocommerce-checkout table.shop_table tfoot td{white-space:normal;text-align:end}
.woocommerce-cart .woocommerce-Price-amount,.woocommerce-checkout .woocommerce-Price-amount{font-variant-numeric:tabular-nums}
.wc-block-cart .wc-block-cart-items,.wc-block-checkout .wc-block-components-order-summary{width:100%;max-width:100%;table-layout:fixed}
.wc-block-cart .wc-block-cart-items td,.wc-block-checkout .wc-block-components-order-summary td{min-width:0;overflow-wrap:anywhere}
.wc-block-cart .wc-block-cart-item__total,.wc-block-checkout .wc-block-components-order-summary-item__total-price{width:84px;text-align:end;white-space:normal}
.wc-block-cart .wc-block-components-product-price,.wc-block-checkout .wc-block-components-product-price{white-space:normal;overflow-wrap:anywhere}
@media(max-width:700px){
  body.woocommerce-cart .ls-commerce,body.woocommerce-checkout .ls-commerce{width:calc(100% - 24px);padding-inline:0}
  .woocommerce-cart .woocommerce-cart-form{overflow:visible}
  .woocommerce-cart .woocommerce table.shop_table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
  .woocommerce-cart .woocommerce table.shop_table tbody tr.cart_item{position:relative;display:grid;grid-template-columns:64px minmax(0,1fr);gap:7px 12px;width:100%;padding:42px 10px 14px;border-bottom:1px solid var(--line);background:var(--surface)}
  .woocommerce-cart .woocommerce table.shop_table tbody tr.cart_item td{display:block;width:auto;padding:4px 0;border:0;min-width:0}
  .woocommerce-cart .woocommerce table.shop_table tbody tr.cart_item td:before{font-size:.66rem;color:var(--muted);margin-inline-end:8px}
  .woocommerce-cart .woocommerce table.shop_table td.product-remove{position:absolute;top:7px;inset-inline-end:8px;padding:0;z-index:1}
  .woocommerce-cart .woocommerce table.shop_table td.product-thumbnail{grid-column:1;grid-row:1 / span 3;width:64px;padding-top:3px}
  .woocommerce-cart .woocommerce table.shop_table td.product-thumbnail img{width:64px;height:auto;max-width:100%;border-radius:4px}
  .woocommerce-cart .woocommerce table.shop_table td.product-name{grid-column:2;grid-row:1 / span 2;padding-inline-end:28px;line-height:1.35;font-weight:600;overflow-wrap:anywhere}
  .woocommerce-cart .woocommerce table.shop_table td.product-price{grid-column:2;grid-row:3;display:flex;align-items:center;justify-content:space-between;gap:8px;text-align:start}
  .woocommerce-cart .woocommerce table.shop_table td.product-quantity{grid-column:1 / -1;grid-row:4;display:flex;align-items:center;justify-content:space-between;gap:12px}
  .woocommerce-cart .woocommerce table.shop_table td.product-subtotal{grid-column:1 / -1;grid-row:5;display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:8px;border-top:1px solid var(--line);font-weight:700}
  .woocommerce-cart .woocommerce table.shop_table td.product-price .amount,.woocommerce-cart .woocommerce table.shop_table td.product-subtotal .amount{white-space:nowrap}
  .woocommerce-cart .woocommerce table.shop_table td.actions{display:block;padding:10px 0;border:0}
  .woocommerce-cart .woocommerce table.shop_table td.actions .coupon{display:flex;gap:8px;flex-wrap:wrap}
  .woocommerce-cart .woocommerce table.shop_table td.actions .coupon input{flex:1 1 130px;min-width:0}
  .woocommerce-cart .cart-collaterals,.woocommerce-cart .cart_totals{width:100%;max-width:100%;float:none}
  .woocommerce-cart .cart_totals table{width:100%;table-layout:fixed}
  .woocommerce-cart .cart_totals th{width:42%}
  .woocommerce-cart .cart_totals td{text-align:end;overflow-wrap:anywhere}
  .woocommerce-checkout #order_review,.woocommerce-checkout .woocommerce-checkout-review-order{min-width:0;max-width:100%;overflow-x:hidden}
  .woocommerce-checkout #order_review table.shop_table td,.woocommerce-checkout #order_review table.shop_table th{padding:8px 5px;font-size:.76rem}
  .woocommerce-checkout #order_review table.shop_table td:last-child,.woocommerce-checkout #order_review table.shop_table th:last-child{width:86px;text-align:end;white-space:normal}
  .wc-block-cart .wc-block-cart-items{display:table;width:100%;table-layout:fixed}
  .wc-block-cart .wc-block-cart-items__row{width:100%}
  .wc-block-cart .wc-block-cart-item__image{width:58px;padding-inline-end:8px}
  .wc-block-cart .wc-block-cart-item__product{min-width:0;overflow-wrap:anywhere}
  .wc-block-cart .wc-block-cart-item__total{width:76px;padding-inline-start:4px;font-size:.76rem}
  .wc-block-cart .wc-block-components-product-metadata{font-size:.72rem;overflow-wrap:anywhere}
  .wc-block-checkout .wc-block-components-order-summary-item__total-price{width:78px;font-size:.76rem}
}

/* Checkout uses the page width; hosted fields size themselves inside it. */
body.woocommerce-checkout .ls-page .ls-content {width:100%;max-width:none}
@media (min-width:768px) {
    body.woocommerce-checkout .ls-content :is(.woocommerce,.wp-block-woocommerce-checkout) {width:100%;max-width:1200px;margin-inline:auto}
    body.woocommerce-checkout form.checkout.woocommerce-checkout {display:block;width:100%}
    body.woocommerce-checkout form.checkout :is(#customer_details,#order_review,#payment,.place-order) {float:none;clear:both;width:100%;max-width:none;min-width:0}
    body.woocommerce-checkout .wp-block-woocommerce-checkout .wc-block-components-sidebar-layout {display:grid;grid-template-columns:minmax(0,1fr) minmax(240px,30%);gap:clamp(16px,3vw,40px)}
    body.woocommerce-checkout .wc-block-checkout :is(.wc-block-components-main,.wc-block-components-sidebar) {width:100%;padding-inline:0;min-width:0}
    body.woocommerce-checkout :is(#payment .payment_box,#payment .payment_methods,.wc-block-components-radio-control-accordion-content) {max-width:none;min-width:0}
    body.woocommerce-checkout #payment .place-order > p {max-width:none}
}
