/* PawShop cart, mini cart and checkout (SDD F-08, WP-07).
   Styles WooCommerce's cart / checkout blocks and Moksa's store picker.
   Colours, font sizes and spacing only use theme.json presets. */

/* ---------- free-shipping progress (cart + mini cart) ---------- */
.ps-free-ship {
  margin: 0 0 var(--wp--preset--spacing--50);
  padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
  background: var(--wp--preset--color--stage-young-tint);
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 14px;
  color: var(--wp--preset--color--ink);
}
.ps-free-ship[hidden] { display: none; }
.ps-free-ship__text {
  margin: 0 0 var(--wp--preset--spacing--20);
  font-size: var(--wp--preset--font-size--medium);
  font-weight: 700;
}
.ps-free-ship__bar {
  height: 8px;
  overflow: hidden;
  background: var(--wp--preset--color--surface);
  border-radius: 999px;
}
.ps-free-ship__bar span {
  display: block;
  height: 100%;
  background: var(--wp--preset--color--accent);
  border-radius: inherit;
  transition: width .3s ease;
}
.ps-free-ship.is-reached { background: var(--wp--preset--color--stage-adult-tint); }
.ps-free-ship.is-reached .ps-free-ship__bar span { background: var(--wp--preset--color--success); }
.ps-free-ship--mini {
  margin: 0 var(--wp--preset--spacing--40) var(--wp--preset--spacing--40);
  padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
}
.ps-free-ship--mini .ps-free-ship__text { font-size: var(--wp--preset--font-size--small); }

/* ---------- page frame ---------- */
.wp-block-woocommerce-cart,
.wp-block-woocommerce-checkout {
  color: var(--wp--preset--color--ink);
}
.wp-block-woocommerce-cart .ps-free-ship,
body.woocommerce-cart .ps-free-ship { max-width: 100%; }

/* Step titles */
.wc-block-components-checkout-step__title,
.wc-block-components-title.wc-block-components-title {
  font-size: var(--wp--preset--font-size--large);
  font-weight: 800;
  color: var(--wp--preset--color--ink);
}
.wc-block-components-checkout-step__description { color: var(--wp--preset--color--ink-muted); }

/* Text inputs and selects */
.wc-block-components-text-input input,
.wc-blocks-components-select .wc-blocks-components-select__select,
.wc-block-components-combobox .wc-block-components-combobox-control input {
  border-color: var(--wp--preset--color--line) !important;
  border-radius: 10px !important;
  background: var(--wp--preset--color--surface) !important;
}
.wc-block-components-text-input input:focus,
.wc-blocks-components-select .wc-blocks-components-select__select:focus {
  border-color: var(--wp--preset--color--primary) !important;
  box-shadow: 0 0 0 1px var(--wp--preset--color--primary) !important;
}
.wc-block-components-text-input label,
.wc-blocks-components-select__label { color: var(--wp--preset--color--ink-muted); }

/* Shipping and payment options (payment rows are accordions: highlight the wrapper only) */
.wc-block-checkout .wc-block-components-radio-control--highlight-checked,
.wc-block-checkout .wc-block-components-radio-control-accordion-option,
.wc-block-checkout .wc-block-components-radio-control__option {
  border-color: var(--wp--preset--color--line);
}
.wc-block-checkout .wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control__option-checked,
.wc-block-checkout .wc-block-components-radio-control--highlight-checked .wc-block-components-radio-control-accordion-option--checked-option-highlighted {
  background: var(--wp--preset--color--stage-adult-tint);
  box-shadow: inset 0 0 0 2px var(--wp--preset--color--primary) !important;
  border-radius: 14px;
}
.wc-block-checkout .wc-block-components-radio-control-accordion-option .wc-block-components-radio-control__option-checked {
  background: transparent;
  box-shadow: none !important;
}
.wc-block-checkout .wc-block-components-radio-control__input:checked {
  border-color: var(--wp--preset--color--primary);
}
.wc-block-checkout .wc-block-components-radio-control__input:checked::before {
  background: var(--wp--preset--color--primary);
}
.wc-block-checkout .wc-block-components-radio-control__label { font-weight: 700; }
.wc-block-components-shipping-rates-control .wc-block-components-radio-control__secondary-label,
.wc-block-checkout .wc-block-formatted-money-amount { font-variant-numeric: tabular-nums; }
.wc-block-components-radio-control__description,
.wc-block-components-radio-control-accordion-content { color: var(--wp--preset--color--ink-muted); }

/* Moksa ECPay store picker (shown for 7-ELEVEN / 全家 / 萊爾富 / OK) */
.wc-block-checkout .moksafowo-cvs-store {
  margin-bottom: var(--wp--preset--spacing--50);
  border-radius: 14px;
  border-color: var(--wp--preset--color--line);
  background: var(--wp--preset--color--surface-alt);
}
.wc-block-checkout .moksafowo-cvs-store__btn {
  min-height: 44px;
  padding: 0 var(--wp--preset--spacing--50);
  border: 1px solid var(--wp--preset--color--primary);
  border-radius: 999px;
  background: var(--wp--preset--color--surface);
  color: var(--wp--preset--color--primary);
  font-weight: 700;
  cursor: pointer;
}
.wc-block-checkout .moksafowo-cvs-store__btn:hover {
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--surface);
}

/* Order summary / cart totals */
.wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block,
.wc-block-cart__sidebar .wp-block-woocommerce-cart-order-summary-block {
  background: var(--wp--preset--color--surface-alt);
  border: 1px solid var(--wp--preset--color--line) !important;
  border-radius: 14px;
}
.wc-block-cart__sidebar .wp-block-woocommerce-cart-order-summary-block {
  padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40);
}
.wc-block-cart__sidebar .wc-block-cart__totals-title { padding-inline: 0; }
.wc-block-components-totals-footer-item .wc-block-components-totals-item__label,
.wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
  font-size: var(--wp--preset--font-size--large);
  font-weight: 900;
}
.wc-block-components-totals-coupon__button,
.wc-block-components-totals-coupon .wc-block-components-button {
  border-radius: 10px;
}

/* Primary actions */
.wc-block-components-checkout-place-order-button,
.wc-block-cart__submit-button,
.wc-block-mini-cart__footer-checkout {
  min-height: 52px;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--wp--preset--color--primary) !important;
  color: var(--wp--preset--color--surface) !important;
  font-size: var(--wp--preset--font-size--medium);
  font-weight: 800;
}
.wc-block-components-checkout-place-order-button:hover,
.wc-block-cart__submit-button:hover,
.wc-block-mini-cart__footer-checkout:hover { background: var(--wp--preset--color--primary-strong) !important; }
.wc-block-components-checkout-place-order-button:disabled { opacity: .6; cursor: progress; }
.wc-block-components-checkout-return-to-cart-button { color: var(--wp--preset--color--ink-muted); }

/* Notices */
.wc-block-components-notice-banner.is-error {
  border-color: var(--wp--preset--color--danger);
}

/* ---------- small screens ---------- */
@media (max-width: 600px) {
  .wc-block-components-checkout-order-summary__title { padding-inline: var(--wp--preset--spacing--40); }
  .ps-free-ship { padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40); }
  .ps-free-ship__text { font-size: var(--wp--preset--font-size--small); }
  .wc-block-components-checkout-step__title,
  .wc-block-components-title.wc-block-components-title { font-size: var(--wp--preset--font-size--medium); }
  .wc-block-checkout .moksafowo-cvs-store__btn { width: 100%; margin-top: var(--wp--preset--spacing--20); }
}
