/**
 * Matchazuki — Cart & Checkout (Figma redesign) v2
 * Plain CSS, enqueued after style-dist.min.css and overriding it.
 *
 * Tokens: green #16362f / hover #2d4a44 / link #3e6d58,
 * card border #ebebe8, divider #e3e3e0, summary bg #f4f4f2,
 * muted #7a7a75, faint #a5a5a0, error #b3261e, banner/sale #e5484d.
 */

/* =============================================================
 * Shared layout
 * =========================================================== */
.woocommerce-cart .site-content .col-full,
.woocommerce-checkout .site-content .col-full {
  max-width: 1240px;
  margin: auto;
  padding: 32px 24px 64px;
}

.mz-page-title {
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 40px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #000;
  margin: 0 0 24px;
}

.mz-cart__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.mz-cart__head .mz-page-title {
  margin-bottom: 20px;
}

.mz-continue-link {
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  letter-spacing: -0.02em;
  color: #3e6d58;
  text-decoration: underline;
  white-space: nowrap;
}

.mz-continue-link:hover {
  color: #16362f;
}

/* Buttons */
.mz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 100px;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: -0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
  box-sizing: border-box;
}

.mz-btn--primary,
.mz-btn--primary:visited {
  background-color: #16362f;
  border: 1px solid #16362f;
  color: #fff !important;
}

.mz-btn--primary:hover {
  background-color: #2d4a44;
  border-color: #2d4a44;
  color: #fff;
}

.mz-btn--primary.is-disabled {
  background-color: #dcdcd8;
  border-color: #dcdcd8;
  color: #a3a39e !important;
}

.mz-btn--ghost {
  background-color: transparent;
  border: 1px solid #16362f;
  color: #16362f;
}

.mz-btn--ghost:hover {
  background-color: rgba(22, 54, 47, 0.06);
  color: #16362f;
}

.mz-link-btn {
  background: none;
  border: 0;
  padding: 0;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  line-height: 23px;
  letter-spacing: -0.02em;
  color: #3e6d58;
  text-decoration: underline;
  cursor: pointer;
}

.mz-link-btn:hover {
  color: #16362f;
}

/* Error banner (out of stock etc. per Figma) */
.mz-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  padding: 12px 20px;
  margin: 0 0 24px;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
}

.mz-banner--error {
  background-color: #e5484d;
  color: #fff;
}

/* Notices */
.woocommerce-cart .woocommerce-error,
.woocommerce-checkout .woocommerce-error {
  background-color: #e5484d;
  border: 0;
  border-radius: 8px;
  color: #fff;
  padding: 12px 16px;
  margin-bottom: 16px;
  list-style: none;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  line-height: 20px;
}

.woocommerce-cart .woocommerce-error li,
.woocommerce-checkout .woocommerce-error li {
  margin: 0;
  padding: 2px 0;
}

.woocommerce-cart .woocommerce-error a,
.woocommerce-checkout .woocommerce-error a {
  color: #fff;
  text-decoration: underline;
}

.woocommerce-cart .woocommerce-message,
.woocommerce-cart .woocommerce-info,
.woocommerce-checkout .woocommerce-message,
.woocommerce-checkout .woocommerce-info {
  background-color: #d8e2de;
  border: 0;
  border-radius: 8px;
  color: #16362f;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  line-height: 20px;
}

.woocommerce-cart .woocommerce-message a,
.woocommerce-cart .woocommerce-info a,
.woocommerce-checkout .woocommerce-message a,
.woocommerce-checkout .woocommerce-info a {
  color: #16362f;
}

.woocommerce-cart .woocommerce-error::before,
.woocommerce-cart .woocommerce-message::before,
.woocommerce-cart .woocommerce-info::before,
.woocommerce-checkout .woocommerce-error::before,
.woocommerce-checkout .woocommerce-message::before,
.woocommerce-checkout .woocommerce-info::before {
  display: none;
}

/* =============================================================
 * Cart layout
 * =========================================================== */
.mz-cart {
  display: flex;
  align-items: flex-start;
  gap: 40px;
}

.mz-cart.is-loading {
  opacity: 0.5;
  pointer-events: none;
}

.mz-cart__main {
  flex: 1 1 auto;
  min-width: 0;
}

.mz-cart__summary {
  flex: 0 0 360px;
  position: sticky;
  top: 96px;
}

@media (max-width: 900px) {
  .mz-cart {
    flex-direction: column;
    gap: 24px;
  }
  .mz-cart__summary {
    flex: 1 1 auto;
    width: 100%;
    position: static;
    margin-top: 0;
  }
}

/* Cart item cards (Figma: separate white cards with light border) */
.mz-cart__items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mz-cart-item {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: #fff;
  border: 1px solid #ebebe8;
  border-radius: 12px;
  box-sizing: border-box;
}

.mz-cart-item__thumb {
  flex: 0 0 88px;
}

.mz-cart-item__thumb img {
  display: block;
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
  background: #ffffff;
}

.mz-cart-item__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.mz-cart-item__name,
.mz-cart-item__name a {
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 21px;
  letter-spacing: -0.01em;
  color: #1d1d1d;
  text-decoration: none;
}

.mz-cart-item__name a:hover {
  color: #16362f;
}

/* Variant select — borderless text + chevron per Figma */
.mz-cart-item__variant select,
.js-mz-switch-variant {
  appearance: none;
  -webkit-appearance: none;
  max-width: 220px;
  width: auto;
  height: 28px;
  padding: 2px 26px 2px 0;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M7.17443 10.5488L2.3125 5.68689L3.01961 4.97978L7.88154 9.84171C7.94662 9.9068 8.05215 9.9068 8.11724 9.84171L12.9792 4.97978L13.6863 5.68689L8.82434 10.5488C8.36873 11.0044 7.63004 11.0044 7.17443 10.5488Z' fill='%2316362F'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: #333;
  cursor: pointer;
  box-shadow: none;
}

.mz-cart-item__variant select:focus {
  outline: none;
}

.mz-cart-item__meta {
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  color: #7a7a75;
}

.mz-cart-item__meta dl,
.mz-cart-item__meta dt,
.mz-cart-item__meta dd {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  float: none;
}

.mz-cart-item__error {
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 13px;
  color: #b3261e;
}

.mz-cart-item__oos {
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #e5484d;
}

.mz-cart-item--oos .mz-cart-item__thumb img {
  opacity: 0.55;
}

/* Right side: line total + remove link */
.mz-cart-item__side {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
}

.mz-cart-item__subtotal {
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: #1d1d1d;
}

.mz-cart-item__subtotal.is-sale > :first-child,
.mz-cart-item__subtotal.is-sale > .amount {
  color: #e5484d;
}

.mz-cart-item__regular {
  margin-left: 6px;
  font-size: 13px;
  color: #a5a5a0;
}

.mz-cart-item__regular .amount {
  color: #a5a5a0;
}

.mz-cart-item__remove {
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 13px;
  letter-spacing: -0.01em;
  color: #7a8c80;
  text-decoration: underline;
}

.mz-cart-item__remove:hover {
  color: #16362f;
}

/* Quantity stepper — rectangular per Figma */
.mz-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e3e3e0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.mz-qty__btn {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  font-size: 17px;
  line-height: 1;
  color: #16362f;
  cursor: pointer;
  transition: background-color 0.15s ease;
  padding: 0;
}

.mz-qty__btn:hover {
  background-color: rgba(22, 54, 47, 0.06);
}

.mz-qty__input {
  width: 40px;
  height: 34px;
  border: 0;
  text-align: center;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #1d1d1d;
  background: transparent;
  -moz-appearance: textfield;
  appearance: textfield;
  padding: 0;
  box-shadow: none;
}

.mz-qty__input::-webkit-outer-spin-button,
.mz-qty__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Empty cart */
.mz-cart--empty {
  display: block;
}

.mz-cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 140px 24px;
  text-align: center;
}

.mz-cart-empty__text {
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #1d1d1d;
  margin: 0;
}

/* =============================================================
 * Order summary card (shared cart + checkout)
 * =========================================================== */
.mz-summary-card {
  background: #f4f4f2;
  border: 0;
  border-radius: 16px;
  padding: 20px;
  box-sizing: border-box;
}

.mz-summary-rows {
  margin-top: 8px;
}

.mz-summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #e3e3e0;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #1d1d1d;
}

.mz-summary-row__value {
  font-weight: 400;
  text-align: right;
}

.mz-summary-row__value .amount {
  color: #1d1d1d;
}

.mz-summary-row__muted {
  color: #7a7a75;
  font-weight: 400;
  font-size: 13px;
  text-align: right;
}

.mz-summary-row--discount .mz-summary-row__value,
.mz-summary-row--discount .mz-summary-row__value .amount {
  color: #3e6d58;
}

.mz-summary-row--discount .woocommerce-remove-coupon {
  margin-left: 8px;
  font-weight: 400;
  font-size: 12px;
  color: #b3261e;
  text-decoration: underline;
}

/* Coupon remove — X icon button (Figma) */
.mz-coupon-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #7a7a75;
  cursor: pointer;
  vertical-align: middle;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.mz-coupon-remove:hover {
  background: rgba(179, 38, 30, 0.1);
  color: #b3261e;
}

.mz-coupon-remove svg {
  width: 10px;
  height: 10px;
}

.mz-summary-row__free {
  color: #3e6d58;
  font-weight: 700;
}

.mz-coupon-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 20px;
  background: #d8e2de;
  color: #16362f;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
}

.mz-summary-row--total {
  border-bottom: 0;
  align-items: center;
}

.mz-summary-row--total .mz-summary-row__value {
  font-size: 22px;
  font-weight: 700;
}

.mz-cart__checkout {
  width: 100%;
  margin-top: 12px;
  min-height: 52px;
}

.mz-cart__checkout.is-disabled {
  pointer-events: none;
}

/* Coupon (Figma: white pill input + pill button on gray card) */
.mz-coupon {
  margin-bottom: 12px;
}

.mz-coupon__row {
  display: flex;
  gap: 8px;
}

.mz-coupon__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 100px;
  background: #fff;
  box-shadow: none;
  padding: 10px 18px;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  color: #1d1d1d;
  box-sizing: border-box;
}

.mz-coupon__input::placeholder {
  color: #a5a5a0;
}

.mz-coupon__input:focus {
  outline: none;
  border-color: #16362f;
}

.mz-coupon__apply {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 100px;
  background: #16362f;
  color: #fff;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.mz-coupon__apply:hover:not(:disabled) {
  background-color: #2d4a44;
}

.mz-coupon__apply:disabled {
  background: #dcdcd8;
  color: #a3a39e;
  cursor: default;
}

.mz-coupon__msg {
  margin-top: 8px;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 13px;
  line-height: 18px;
  color: #16362f;
}

/* =============================================================
 * Popup / modal
 * =========================================================== */
body.mz-popup-open {
  overflow: hidden;
}

.mz-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.mz-popup[hidden] {
  display: none;
}

.mz-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.mz-popup__card {
  position: relative;
  width: 400px;
  max-width: 100%;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-sizing: border-box;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.mz-popup__card--form {
  width: 560px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
}

.mz-popup__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  color: #1d1d1d;
}

.mz-popup__close:hover {
  background: rgba(22, 54, 47, 0.06);
}

.mz-popup__close svg {
  width: 14px;
  height: 14px;
}

.mz-popup__title {
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 26px;
  letter-spacing: -0.02em;
  color: #000;
  margin: 0 0 16px;
  padding-right: 36px;
}

.mz-popup__desc {
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  line-height: 20px;
  color: #666;
  margin: 0 0 20px;
}

.mz-popup__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.mz-popup__actions .mz-btn {
  min-width: 120px;
}

@media (max-width: 600px) {
  .mz-popup {
    padding: 0;
    align-items: flex-end;
  }
  .mz-popup__card,
  .mz-popup__card--form {
    width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
    overflow-y: auto;
  }
  .mz-popup__actions .mz-btn {
    flex: 1 1 auto;
  }
}

/* =============================================================
 * Checkout layout
 * =========================================================== */
.mz-checkout {
  display: flex;
  align-items: flex-start;
  gap: 40px;
}

.mz-checkout__main {
  flex: 1 1 auto;
  min-width: 0;
}

.mz-checkout__aside {
  flex: 0 0 360px;
  position: sticky;
  top: 96px;
}

@media (max-width: 900px) {
  .mz-checkout {
    flex-direction: column;
    gap: 24px;
  }
  .mz-checkout__aside {
    flex: 1 1 auto;
    width: 100%;
    position: static;
  }
}

.mz-section {
  background: #fff;
  border: 1px solid #ebebe8;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
  box-sizing: border-box;
}

/* Deliver-to card */
.mz-address-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mz-address-card__label {
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #1d1d1d;
}

.mz-address-card__lines {
  margin-top: 10px;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  line-height: 24px;
  color: #4a4a45;
}

.mz-address-card__line--name {
  color: #1d1d1d;
}

/* Empty state: only the "+ Add new address" row is visible */
.mz-address-card__add {
  display: none;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 4px 0;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #16362f;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.mz-address-card__add-icon {
  font-size: 18px;
  line-height: 1;
}

.mz-address-card--empty .mz-address-card__head,
.mz-address-card--empty .mz-address-card__lines {
  display: none;
}

.mz-address-card--empty .mz-address-card__add {
  display: inline-flex;
}

/* Billing fields inside the address modal */
.mz-address-fields .woocommerce-billing-fields > h3,
.mz-address-fields .woocommerce-shipping-fields,
.mz-address-fields .woocommerce-additional-fields {
  display: none;
}

.mz-address-fields .form-row {
  width: 100%;
  float: none;
  margin: 0 0 12px;
  padding: 0;
  box-sizing: border-box;
}

.mz-address-fields .form-row label {
  display: block;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  letter-spacing: -0.02em;
  color: #333;
  margin-bottom: 4px;
}

.mz-address-fields .form-row .input-text,
.mz-address-fields .form-row select {
  width: 100%;
  height: 48px;
  border: 1px solid #e3e3e0;
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
  color: #1d1d1d;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  line-height: 20px;
  padding: 12px;
  box-sizing: border-box;
}

.mz-address-fields .form-row .input-text:focus,
.mz-address-fields .form-row select:focus {
  outline: none;
  border-color: #16362f;
}

.mz-address-fields .form-row.woocommerce-invalid .input-text,
.mz-address-fields .form-row.woocommerce-invalid select,
.mz-field.woocommerce-invalid input,
.mz-field.woocommerce-invalid textarea {
  border-color: #b3261e;
}

.mz-address-fields .select2-container--default .select2-selection--single {
  height: 48px;
  border: 1px solid #e3e3e0;
  border-radius: 12px;
  background: #fff;
}

.mz-address-fields
  .select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  line-height: 46px;
  padding-left: 12px;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  color: #333;
}

.mz-address-fields
  .select2-container--default
  .select2-selection--single
  .select2-selection__arrow {
  height: 46px;
  right: 12px;
  width: 16px;
  display: flex;
  align-items: center;
}

.mz-field-error {
  display: block;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 13px;
  color: #b3261e;
  margin-top: 4px;
}

/* Custom fields (tax invoice) */
.mz-field {
  margin: 0 0 12px;
}

.mz-field label {
  display: block;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  letter-spacing: -0.02em;
  color: #333;
  margin-bottom: 4px;
}

.mz-field label .required {
  color: #b3261e;
  text-decoration: none;
  border: 0;
}

.mz-field input[type="text"],
.mz-field textarea {
  width: 100%;
  border: 1px solid #e3e3e0;
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
  color: #1d1d1d;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  line-height: 20px;
  padding: 12px;
  box-sizing: border-box;
}

.mz-field input[type="text"] {
  height: 48px;
}

.mz-field input[type="text"]:focus,
.mz-field textarea:focus {
  outline: none;
  border-color: #16362f;
}

/* Checkbox rows */
.mz-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: #1d1d1d;
  cursor: pointer;
  margin: 0 0 12px;
}

.mz-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #16362f;
  margin: 0;
  flex: 0 0 auto;
}

/* Tax invoice section (Figma: checkbox row + chevron, modal form,
 * saved summary below) */
.mz-tax-section {
  position: relative;
}

.mz-tax-section__toggle {
  margin: 0;
  padding-right: 36px;
}

.mz-tax-section__chevron {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.mz-tax-section__chevron:hover {
  background: rgba(22, 54, 47, 0.06);
}

.mz-tax-summary {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e3e3e0;
}

.mz-tax-summary__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.mz-tax-summary__label {
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 13px;
  color: #7a7a75;
}

.mz-tax-summary__lines {
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  line-height: 24px;
  color: #4a4a45;
}

.mz-tax-summary__line--name {
  color: #1d1d1d;
}

/* Individual / corporate radios (Figma) */
.mz-tax-form__types {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.mz-radio {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: #1d1d1d;
  cursor: pointer;
}

.mz-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #16362f;
  margin: 0;
  flex: 0 0 auto;
}

.mz-tax-form {
  padding-top: 4px;
}

/* =============================================================
 * Checkout: product list (left column)
 * =========================================================== */
.mz-checkout-items {
  display: flex;
  flex-direction: column;
}

.mz-checkout-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
}

.mz-checkout-item__thumb {
  flex: 0 0 48px;
}

.mz-checkout-item__thumb img {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: #f4f2ec;
}

.mz-checkout-item__name {
  flex: 1 1 auto;
  min-width: 0;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.01em;
  color: #1d1d1d;
}

.mz-checkout-item__qty {
  flex: 0 0 auto;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  color: #7a7a75;
}

/* =============================================================
 * Checkout: payment (left column)
 * =========================================================== */
.mz-payment-section__title {
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #1d1d1d;
  margin: 0 0 14px;
}

.mz-payment-section #payment {
  background: transparent;
  border-radius: 0;
}

.mz-payment-section .wc_payment_methods {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 0;
}

.mz-payment-section .wc_payment_method {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  border: 1px solid #ebebe8;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 10px;
  background: #fff;
}

.mz-payment-section .wc_payment_method > input.input-radio {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
  border: 1.5px solid #9da5a0;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  position: relative;
}

.mz-payment-section .wc_payment_method > input.input-radio:checked {
  background-color: #16362f;
  border-color: #16362f;
}

.mz-payment-section .wc_payment_method > input.input-radio:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.mz-payment-section .wc_payment_method > label {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 0;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: #1d1d1d;
  cursor: pointer;
}

.mz-payment-section .wc_payment_method > label img {
  max-height: 24px;
  width: auto;
  margin: 0 0 0 6px;
}

.mz-payment-section .payment_box {
  flex: 1 1 100%;
  background: #f4f4f2;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 4px 0 0;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 13px;
  line-height: 19px;
  color: #4a4a45;
}

.mz-payment-section .payment_box::before {
  display: none;
}

.mz-payment-section .place-order {
  padding: 0;
  margin: 0;
}

/* =============================================================
 * Checkout: order review (right column)
 * =========================================================== */
.woocommerce-checkout .mz-summary-card #order_review {
  width: 100%;
  padding: 0;
  float: none;
}

.mz-summary-row__shipping .shipping_method.mz-shipping-select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 13px;
  color: #7a7a75;
  padding: 0 18px 0 0;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M7.17443 10.5488L2.3125 5.68689L3.01961 4.97978L7.88154 9.84171C7.94662 9.9068 8.05215 9.9068 8.11724 9.84171L12.9792 4.97978L13.6863 5.68689L8.82434 10.5488C8.36873 11.0044 7.63004 11.0044 7.17443 10.5488Z' fill='%237a7a75'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  cursor: pointer;
}

.mz-place-order {
  width: 100%;
  margin-top: 16px;
  min-height: 52px;
}

/* Terms & privacy text */
.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper,
.woocommerce-checkout .woocommerce-privacy-policy-text p {
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 13px;
  line-height: 19px;
  color: #666;
}

/* Loading state while checkout refreshes */
.woocommerce-checkout .blockUI.blockOverlay {
  border-radius: 16px;
}

/* =============================================================
 * Specificity overrides vs the sitewide "#main { h1..p }"
 * typography block in pages/all.css (id selector wins otherwise)
 * =========================================================== */
#main .mz-page-title {
  font-size: 40px;
  line-height: 1.15;
}

#main .mz-cart-empty__text {
  font-size: 28px;
  line-height: 1.35;
}

#main .mz-popup__title {
  font-size: 22px;
  line-height: 26px;
}

#main .mz-payment-section__title {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 700;
}

#main .mz-popup__desc {
  font-size: 14px;
  line-height: 20px;
  color: #666;
}

#main .mz-cart-item__name,
#main .mz-checkout-item__name {
  font-size: 15px;
  line-height: 21px;
}

@media (max-width: 600px) {
  #main .mz-page-title {
    font-size: 30px;
  }
}

/* =============================================================
 * Specificity overrides vs Storefront's "#payment ..." rules
 * =========================================================== */
.mz-payment-section #payment .wc_payment_method > input.input-radio {
  /* Storefront hides the input and draws a Font Awesome circle on the
     label instead — bring the real input back as a Figma-style square. */
  display: inline-block;
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
  border: 1.5px solid #9da5a0;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  position: relative;
}

/* Storefront keeps the input visually hidden (clip/!important) and draws a
   Font Awesome circle on label::before — restyle that pseudo as the Figma
   square checkbox instead of fighting the hidden input. */
.mz-payment-section #payment .wc_payment_method > label {
  position: relative;
  padding: 0 !important;
  margin: 0 !important;
}

/* =============================================================
 * Minimal header on cart & checkout (Figma: logo + Sign in only)
 * =========================================================== */
.mz-header--minimal .control-container {
  display: flex;
  align-items: center;
}

.mz-signin-link {
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: #1d1d1d;
  text-decoration: none;
  padding: 8px 4px;
}

.mz-signin-link:hover {
  color: #16362f;
  text-decoration: underline;
}

/* Summary rows sit directly on the gray card — no nested white panel. */
.woocommerce-checkout .mz-summary-card #order_review,
.woocommerce-checkout .mz-summary-card .woocommerce-checkout-review-order-table {
  background: transparent !important;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

/* Deliver-to name line stays black (beats inherited link/typography colors). */
#main .mz-address-card__line--name {
  color: #1d1d1d;
}

/* Tax modal — Figma layout */
.mz-popup--tax .mz-popup__card--form {
  width: 720px;
}

.mz-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.mz-field input[type="email"],
.mz-field input[type="tel"] {
  width: 100%;
  height: 48px;
  border: 1px solid #e3e3e0;
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
  color: #1d1d1d;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  line-height: 20px;
  padding: 12px;
  box-sizing: border-box;
}

.mz-field input[type="email"]:focus,
.mz-field input[type="tel"]:focus {
  outline: none;
  border-color: #16362f;
}

.mz-field input::placeholder,
.mz-field textarea::placeholder {
  color: #a5a5a0;
}

.mz-tax-form .mz-check {
  margin: 4px 0 16px;
}

.mz-tax-summary__line--contact {
  margin-top: 4px;
}

/* =============================================================
 * Thank-you page (Figma)
 * =========================================================== */
.mz-header--logo-only {
  justify-content: center;
}

.mz-thankyou {
  display: flex;
  justify-content: center;
  padding: 56px 16px 104px;
}

.mz-thankyou__card {
  width: 560px;
  max-width: 100%;
  text-align: center;
}

.mz-thankyou__title {
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #1d1d1d;
  margin: 0 0 12px;
}

#main .mz-thankyou__title {
  font-size: 32px;
  line-height: 1.2;
}

.mz-thankyou__desc {
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  line-height: 22px;
  color: #4a4a45;
  margin: 0 0 32px;
}

.mz-thankyou__items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
  text-align: left;
}

.mz-thankyou__item {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid #ebebe8;
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
}

.mz-thankyou__item-thumb img {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: #f4f2ec;
}

.mz-thankyou__item-name {
  flex: 1 1 auto;
  min-width: 0;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  line-height: 20px;
  color: #1d1d1d;
}

.mz-thankyou__item-qty {
  flex: 0 0 auto;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 13px;
  color: #7a7a75;
}

.mz-thankyou__item-total {
  flex: 0 0 auto;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  color: #1d1d1d;
}

.mz-thankyou__item-total .amount {
  color: #1d1d1d;
}

.mz-thankyou__next {
  text-align: left;
  margin-bottom: 32px;
}

.mz-thankyou__next-title {
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #1d1d1d;
  margin-bottom: 10px;
}

.mz-thankyou__step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-family: "Linux Biolinum", "IBM Plex Sans Thai", sans-serif;
  font-size: 14px;
  color: #4a4a45;
}

.mz-thankyou__step-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c9c9c4;
  position: relative;
  flex: 0 0 auto;
}

.mz-thankyou__step.is-done .mz-thankyou__step-icon {
  background: #16362f;
}

.mz-thankyou__step.is-done .mz-thankyou__step-icon::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.mz-thankyou__actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.mz-thankyou__actions .mz-btn {
  min-width: 170px;
}

.mz-btn--soft,
.mz-btn--soft:visited {
  background: #ecece9;
  border: 1px solid #ecece9;
  color: #1d1d1d !important;
}

.mz-btn--soft:hover {
  background: #e0e0dc;
  border-color: #e0e0dc;
  color: #1d1d1d;
}

@media (max-width: 600px) {
  .mz-header--logo-only {
    justify-content: flex-start;
  }
  .mz-thankyou {
    padding: 32px 16px 64px;
  }
  .mz-thankyou__actions {
    flex-direction: column;
  }
  .mz-thankyou__actions .mz-btn {
    width: 100%;
  }
}

.mz-payment-section #payment .wc_payment_method > label::before {
  content: "" !important;
  display: inline-block !important;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border: 1.5px solid #9da5a0;
  border-radius: 4px;
  background: #fff;
  margin-right: 10px;
  flex: 0 0 auto;
}

.mz-payment-section #payment .wc_payment_method > input.input-radio:checked + label::before {
  background: #16362f;
  border-color: #16362f;
}

.mz-payment-section #payment .wc_payment_method > label::after {
  display: none !important;
  content: none !important;
}

.mz-payment-section #payment .wc_payment_method > input.input-radio:checked + label::after {
  content: "" !important;
  display: block !important;
  position: absolute;
  left: 7px;
  top: 50%;
  margin-top: -7px;
  width: 4px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.mz-payment-section #payment .wc_payment_method > input.input-radio:checked {
  background-color: #16362f;
  border-color: #16362f;
}

.mz-payment-section #payment .wc_payment_method > input.input-radio:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.mz-payment-section #payment,
.mz-payment-section #payment ul.payment_methods {
  background: transparent;
  border: 0;
  padding: 0;
}

.mz-payment-section #payment .place-order {
  background: transparent;
  padding: 0;
  margin: 0;
}

/* The checkout WP page content repeats the title as a bare <h3>. */
.woocommerce-checkout .entry-content > h3:first-of-type {
  display: none;
}

/* =============================================================
 * Mobile
 * =========================================================== */
@media (max-width: 600px) {
  .woocommerce-cart .site-content .col-full,
  .woocommerce-checkout .site-content .col-full {
    padding: 24px 16px 48px;
  }

  .mz-page-title {
    font-size: 30px;
  }

  .mz-cart-item {
    padding: 16px;
    gap: 12px;
  }

  .mz-cart-item__thumb,
  .mz-cart-item__thumb img {
    flex-basis: 72px;
    width: 72px;
    height: 72px;
  }

  .mz-cart-item__side {
    gap: 8px;
  }

  .mz-cart-empty {
    padding: 96px 16px;
  }

  .mz-section,
  .mz-checkout-item {
    padding: 16px;
  }

  .mz-tax-section__chevron {
    right: 12px;
  }
}

/* =============================================================
 * Payment method row alignment fix (Figma) — keep the checkbox,
 * label text and gateway logo on one baseline; checkbox centered.
 * =============================================================== */
.mz-payment-section #payment .wc_payment_method {
  align-items: center;
}

.mz-payment-section #payment .wc_payment_method > label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 20px;
  line-height: 20px;
}

/* Checkbox square drawn on label::before — fixed size, vertically centered */
.mz-payment-section #payment .wc_payment_method > label::before {
  flex: 0 0 auto;
  align-self: center;
  margin: 0 !important;
}

/* Push the gateway logo (Beam / VISA…) to the far right of the row */
.mz-payment-section #payment .wc_payment_method > label img {
  margin: 0 0 0 auto;
  max-height: 20px;
  width: auto;
}

/* Keep the tick centered on the checkbox regardless of row height */
.mz-payment-section #payment .wc_payment_method > input.input-radio:checked + label::after {
  left: 7px;
  top: 10px;
  margin-top: -5px;
}

/* Auto-filled account email — hide its checkout field row entirely */
.woocommerce-checkout .form-row.mz-hidden-field { display: none !important; }


/* =============================================================
 * Invalid-coupon toast banner (orange, centered top) — shared by
 * cart & checkout, replaces the per-page coupon error message.
 * =========================================================== */
.mz-banner--toast {
  width: max-content;
  max-width: 90%;
  margin: 0 auto 20px;
  border-radius: 8px;
}

.mz-banner--toast .mz-banner__icon {
  display: inline-flex;
  flex: 0 0 auto;
}

.mz-banner--toast .mz-banner__icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Hide the old inline checkout coupon message (now shown as the toast). */
.js-mz-checkout-coupon-msg {
  display: none !important;
}
