.amc-cart,
.amc-checkout,
.amc-checkout-header {
  --amc-text: #302632;
  --amc-plum: #512c43;
  --amc-berry: #873a58;
  --amc-rose: #a65370;
  --amc-line: #e9dee3;
  --amc-sand: #fcf8fa;
  --amc-pink: #f6e6ee;
  --amc-green: #335b46;
  --amc-mint: #edf4eb;
}

.amc-cart-grid {
  display: flex !important;
  flex-wrap: wrap;
  gap: 16px 20px;
  align-items: start;
}
.amc-cart-grid > * { flex: 0 0 100%; min-width: 0; }
.amc-cart-grid > :is(.amc-cart-list-column, .amc-cart-summary-column) {
  box-sizing: border-box;
  width: auto;
  max-width: none;
  min-width: 0;
  margin-inline: 0;
  float: none;
}
.amc-cart-grid > .amc-cart-list-column { flex: 3 0 min(100%, 360px); }
.amc-cart-grid > .amc-cart-summary-column { flex: 1 0 min(100%, 255px); }

.amc-checkout .amc-stage-card,
.amc-cart .woocommerce-cart-form {
  padding: 18px;
  border: 1px solid var(--amc-line);
  border-radius: 15px;
  background: #fff;
}

.amc-cart .cart_totals.amc-summary {
  width: 100%;
  max-width: 100%;
  float: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--amc-line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 14px 36px #4a233414;
}

.amc-summary .amc-summary-title {
  margin: 0;
  padding: 14px 18px;
  border: 0;
  color: #fff;
  background: linear-gradient(125deg, var(--amc-plum), #814360);
  font-size: 1.08rem;
  line-height: 1.65;
}

.amc-cart .amc-summary > table {
  width: calc(100% - 26px);
  margin: 9px 13px 12px;
}

.amc-summary .order-total th,
.amc-summary .order-total td {
  background: var(--amc-pink);
  color: var(--amc-plum);
  border-color: #ebd8e3;
}

.amc-summary .order-total .amount {
  color: inherit;
  font-size: 1.14em;
  font-weight: 800;
}

.amc-summary .amc-savings-row td {
  padding: 9px 0;
  border: 0;
  background: transparent;
}

.amc-savings,
.amc-product-saving {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 5px 8px;
}

.amc-product-saving {
  padding: 4px 7px 7px;
  font-size: .88em;
  color: var(--amc-green);
}

.amc-savings {
  padding: 8px 10px;
  border: 1px solid #dce9d9;
  border-radius: 8px;
  color: var(--amc-green);
  background: var(--amc-mint);
  font-size: .94em;
}

.amc-savings .amount,
.amc-product-saving .amount {
  color: inherit;
}

.amc-summary .wc-proceed-to-checkout {
  padding: 10px 13px 13px;
}

.amc-summary .checkout-button,
.amc-checkout .amc-payment-panel #place_order,
.amc-checkout .amc-button {
  border: 1px solid transparent;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(115deg, #73344e, #9b4e6b);
  font: inherit;
  font-weight: 700;
}

.amc-summary .checkout-button:hover,
.amc-checkout .amc-payment-panel #place_order:hover,
.amc-checkout .amc-button:hover {
  color: #fff;
  background: #73344e;
}

.amc-checkout .amc-button-secondary {
  color: var(--amc-berry);
  background: #fff;
  border-color: var(--amc-line);
}

.amc-checkout .amc-button {
  min-height: 44px;
  padding: 6px 13px;
  cursor: pointer;
}

.amc-checkout .amc-button:focus-visible,
.amc-checkout .amc-stage-title:focus-visible {
  outline: 2px solid var(--amc-berry);
  outline-offset: 3px;
}

.amc-cart .amc-coupon {
  padding: 10px 12px;
  border: 1px solid var(--amc-line);
  border-radius: 10px;
  background: var(--amc-sand);
}

.amc-coupon-label {
  display: block;
  width: 100%;
  margin-bottom: 5px;
  font-weight: 700;
}

.amc-coupon input[name="coupon_code"] {
  border-radius: 8px;
  background: #fff;
}

.amc-coupon button {
  border-radius: 8px;
}

.woocommerce-form-coupon-toggle.amc-original-coupon-toggle[hidden],
.amc-checkout .amc-original-title,
.amc-checkout .amc-shipping-panel[hidden],
.amc-checkout .amc-payment-panel[hidden],
.amc-checkout .amc-stage-card > [hidden],
.amc-checkout .amc-actions > [hidden],
.amc-checkout .amc-stage-note[hidden],
.amc-checkout .amc-shipping-table [hidden],
.amc-checkout .amc-order-summary [hidden],
.amc-ship-start[hidden], .amc-ship-end[hidden], .amc-ship-state[hidden], .amc-shipping-amount[hidden],
.amc-checkout[data-amc-step="contact"] .amc-address-row,
.amc-checkout[data-amc-step="contact"] .amc-address-extra,
.amc-checkout[data-amc-step="address"] .amc-contact-row,
.amc-checkout[data-amc-step="shipping"] .amc-details-wrap,
.amc-checkout[data-amc-step="payment"] .amc-details-wrap,
.amc-checkout .amc-wallet-field,
.amc-checkout .amc-wallet-panel [hidden] {
  display: none !important;
}

.amc-checkout .amc-customer {
  width: 100%;
  float: none;
  padding-inline: 0;
  margin: 0;
}

.amc-checkout .amc-customer > .col-1,
.amc-checkout .amc-customer > .col-2 {
  width: 100%;
  max-width: 100%;
  float: none;
}

.amc-checkout .amc-customer .woocommerce-billing-fields > h3 {
  display: none;
}

.amc-checkout-header {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  flex-basis: 100%;
  margin-block-end: 16px;
  padding-left: var(--amc-header-left, 0px);
  padding-right: var(--amc-header-right, 0px);
}
.amc-checkout-header .amc-navigation {
  padding: 12px 10px;
  border: 1px solid var(--amc-line);
  border-radius: 12px;
  background: var(--amc-sand);
}
.amc-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.amc-steps li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  margin: 0;
  text-align: center;
  color: var(--amc-plum);
  font-size: 13px;
}
.amc-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  inset-block-start: 13px;
  inset-inline-start: calc(50% + 19px);
  width: calc(100% - 34px);
  border-block-start: 1px solid #d9becd;
}
.amc-steps [aria-current="step"] .amc-step-caption { font-weight: 800; }

.amc-checkout-header .amc-checkout-coupon {
  margin-block-start: 10px;
  border: 1px solid #dfc5d0;
  border-radius: 12px;
  background: #fff;
}
.amc-checkout-coupon > a.amc-coupon-trigger {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 9px 13px;
  border-radius: 12px;
  color: var(--amc-plum);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.amc-checkout-coupon > a.amc-coupon-trigger:hover { background: var(--amc-sand); }
.amc-checkout-coupon .amc-coupon-text {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.amc-checkout-coupon .amc-coupon-help {
  color: #715568;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.6;
}
.amc-checkout-coupon .amc-coupon-badge {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--amc-berry);
  background: var(--amc-pink);
}
.amc-checkout-coupon > a.amc-coupon-trigger::after {
  content: "";
  display: block;
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  margin-inline-start: auto;
  border-right: 2px solid var(--amc-rose);
  border-bottom: 2px solid var(--amc-rose);
  transform: rotate(45deg);
}
.amc-checkout-coupon > a.amc-coupon-trigger[aria-expanded="true"]::after { transform: rotate(225deg); }
.amc-checkout-coupon > a.amc-coupon-trigger:focus-visible {
  outline: 2px solid var(--amc-rose);
  outline-offset: 2px;
}
.amc-checkout-header .amc-checkout-coupon > form.checkout_coupon {
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 8px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 13px 12px;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.amc-checkout-coupon form.checkout_coupon .form-row {
  flex: 1 1 150px;
  float: none;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
}
.amc-checkout-coupon form.checkout_coupon .form-row-last { flex: 0 0 auto; }
.amc-checkout-coupon form.checkout_coupon .clear { display: none; }
.amc-checkout-coupon form.checkout_coupon label[for="coupon_code"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.amc-checkout-coupon form.checkout_coupon input[name="coupon_code"] {
  width: 100%;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid #c694aa;
  border-radius: 8px;
}
.amc-checkout-coupon form.checkout_coupon input[name="coupon_code"]:focus-visible {
  outline: 2px solid var(--amc-rose);
  outline-offset: -2px;
}
.amc-checkout-coupon form.checkout_coupon button[name="apply_coupon"] {
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--amc-berry);
  border-radius: 8px;
  color: #fff;
  background: var(--amc-berry);
  font: inherit;
  font-weight: 700;
}
.amc-checkout-coupon > :is(.woocommerce-message, .woocommerce-error, .is-success, .is-error) {
  margin: 0 13px 10px;
}

.amc-stage-title {
  margin-block: 0 10px;
  color: var(--amc-text);
}

.amc-stage-note,
.amc-stage-error {
  margin-block: 5px 8px;
}

.amc-stage-error {
  color: #94334e;
}

.amc-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}

.amc-order-summary > :is(.amc-summary-next, .amc-summary-pay) {
  width: 100%;
  margin-block-start: 12px;
}

.amc-actions > :last-child {
  margin-inline-start: auto;
}

@media (max-width: 767px) {
  .amc-checkout .amc-stage-card,
  .amc-cart .woocommerce-cart-form {
    padding: 12px;
  }

  .amc-steps li {
    font-size: 12px;
  }
}

/* WoodMart sizes both the outer receipt and inner table wrapper. The native
   review now hosts BOTH columns. Give every wrapper on that path the full row. */
form.checkout.amc-checkout .amc-wide,
form.checkout.amc-checkout .amc-details-wrap {
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  flex: 0 0 100% !important;
  grid-column: 1 / -1 !important;
  justify-self: stretch;
  float: none !important;
  margin-inline: 0 !important;
  padding-inline: 0 !important;
}

form.checkout.amc-checkout .amc-wide {
  display: block;
  padding-block: 0;
  margin-block: 0;
  border: 0;
  box-shadow: none;
  overflow: visible;
}

.amc-checkout .checkout-order-review.amc-wide::before,
.amc-checkout .checkout-order-review.amc-wide::after {
  content: none !important;
}
.amc-checkout .checkout-order-review.amc-wide { position: static; }

form.checkout.amc-checkout .amc-checkout-frame {
  container: amc-order / inline-size;
}

.amc-checkout .amc-checkout-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: clamp(14px, 2vw, 26px);
  width: 100%;
  min-width: 0;
}

@container amc-order (min-width: 800px) {
  .amc-checkout .amc-checkout-columns {
    grid-template-columns: minmax(0, 1.45fr) minmax(330px, 1fr);
  }
}

.amc-checkout .amc-checkout-columns > * {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  justify-self: stretch;
}

@container amc-order (min-width: 800px) {
  .amc-checkout .amc-checkout-columns > .amc-order-summary {
    margin-block-start: var(--amc-summary-offset, 0px);
  }
}

.amc-checkout .amc-stage-card { padding: clamp(14px, 2.2vw, 28px); }

.amc-checkout .amc-order-summary {
  padding: 0 clamp(10px, 1.25vw, 18px) 10px;
  overflow: visible;
  border: 1px solid var(--amc-line);
  border-radius: 15px;
  background: #fff;
  color: var(--amc-text);
  box-shadow: 0 8px 20px #512c430d;
}

.amc-checkout .amc-order-summary .amc-summary-title {
  margin-inline: calc(0px - clamp(10px, 1.25vw, 18px));
  margin-block-end: 8px;
  border-radius: 14px 14px 0 0;
}

/* Normalize only the path to the actual review table, including wrappers
   returned in an updated_checkout fragment. Leave cart and gateway tables alone. */
form.amc-checkout .amc-order-summary .amc-table-wrap,
form.amc-checkout .amc-order-summary table.amc-review-table {
  display: block;
  box-sizing: border-box;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  float: none;
  overflow: visible !important;
  box-shadow: none;
  border: 0;
  background: transparent;
}

form.amc-checkout .amc-order-summary table.amc-review-table {
  display: block;
  border-collapse: collapse;
}

.amc-checkout .amc-review-table thead { display: table-header-group; }
.amc-checkout .amc-review-table tbody { display: table-row-group; }
.amc-checkout .amc-review-table tfoot { display: table-footer-group; }
.amc-checkout .amc-review-table tr { display: table-row; }
.amc-checkout .amc-review-table tr > :is(th, td) {
  display: table-cell;
  box-sizing: border-box;
  padding: 10px 5px;
  min-width: 0;
  max-width: none;
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.75;
  vertical-align: middle;
  font-size: inherit;
  text-align: start;
}

.amc-checkout .amc-two-cols :is(thead, tbody) > tr > :first-child:not([colspan]) { width: 56%; }
.amc-checkout .amc-two-cols :is(thead, tbody) > tr > :last-child:not([colspan]) { width: 44%; text-align: end; }
.amc-checkout .amc-review-table td::before { content: none !important; }
.amc-checkout .amc-review-table .amount { white-space: normal; }
.amc-checkout .amc-review-table .product-name :is(a, .wd-checkout-prod-title, .wd-product-detail) {
  min-width: 0;
  max-width: 100%;
  max-height: none;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  -webkit-line-clamp: unset;
}
.amc-checkout .amc-review-table thead th { color: #695b63; border-bottom: 1px solid var(--amc-line); }
.amc-checkout .amc-review-table tr.cart_item td { border-bottom: 1px solid var(--amc-line); }
.amc-checkout .amc-review-table .product-name a { color: var(--amc-text); text-decoration: none; font-weight: 600; }
.amc-checkout .amc-review-table .product-name a:hover { color: var(--amc-berry); text-decoration: underline; }
.amc-checkout .amc-review-table .product-total .amount { color: var(--amc-plum); font-variant-numeric: tabular-nums; }
.amc-checkout .amc-review-table .wd-checkout-prod { min-width: 0; flex-wrap: wrap; gap: 5px; }
.amc-checkout .amc-review-table .product-name img { width: auto; max-width: min(42px, 100%); height: auto; }

.amc-checkout .amc-shipping-panel .amc-shipping-table {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  border: 0;
  text-align: start;
}
.amc-checkout .amc-shipping-table > tbody,
.amc-checkout .amc-shipping-table > tbody > tr,
.amc-checkout .amc-shipping-table > tbody > tr > :is(th, td) {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: start;
  white-space: normal;
  overflow-wrap: anywhere;
}
.amc-checkout .amc-shipping-table > tbody > tr > th { margin-block: 10px 6px; color: var(--amc-plum); }
.amc-checkout .amc-shipping-table > tbody > tr > td::before { content: none; }
/* Use the original WooCommerce controls so carrier and gateway events still fire. */
.amc-checkout .amc-shipping-panel .amc-shipping-table :is(ul.woocommerce-shipping-methods, ul[id="shipping_method"]),
.amc-checkout .amc-payment-panel #payment ul.payment_methods,
.amc-checkout .amc-payment-panel #payment ul.wc_payment_methods {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: start;
}
.amc-checkout .amc-shipping-panel .amc-shipping-table :is(ul.woocommerce-shipping-methods, ul[id="shipping_method"]) {
  grid-auto-rows: 1fr;
}
.amc-checkout .amc-shipping-count {
  display: inline-block;
  margin-inline: 8px 0;
  padding: 2px 9px;
  border-radius: 12px;
  background: var(--amc-pink);
  color: var(--amc-plum);
  font-size: 12px;
  font-weight: 700;
}
.amc-checkout .amc-shipping-table :is(.woocommerce-shipping-methods, [id="shipping_method"]) > li,
.amc-checkout .amc-shipping-table tr > td:has(> input[type="hidden"][name^="shipping_method"]),
.amc-checkout .amc-payment-panel #payment :is(ul.payment_methods, ul.wc_payment_methods) > li:has(input[name="payment_method"]) {
  box-sizing: border-box;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #bcabb5;
  border-radius: 10px;
  text-align: start;
  overflow-wrap: anywhere;
}
.amc-checkout .amc-shipping-table :is(.woocommerce-shipping-methods, [id="shipping_method"]) > li:has(input:checked, input[type="hidden"][name^="shipping_method"]),
.amc-checkout .amc-shipping-table tr > td:has(> input[type="hidden"][name^="shipping_method"]),
.amc-checkout .amc-payment-panel #payment :is(ul.payment_methods, ul.wc_payment_methods) > li:has(input[name="payment_method"]:checked) {
  background: var(--amc-sand);
  border-color: var(--amc-berry);
  box-shadow: inset 0 0 0 1px var(--amc-berry);
}
.amc-checkout .amc-shipping-table input[type="radio"],
.amc-checkout .amc-payment-panel input[type="radio"][name="payment_method"] {
  accent-color: var(--amc-berry);
  margin-inline: 0 6px;
}
.amc-checkout .amc-shipping-table label,
.amc-checkout .amc-payment-panel li > label[for^="payment_method"] {
  display: inline;
  float: none;
  white-space: normal;
  cursor: pointer;
}
.amc-checkout :is(.amc-shipping-table, .amc-payment-panel) li:has(> input[type="radio"]:enabled) { cursor: pointer; }
.amc-checkout :is(.amc-shipping-table, .amc-payment-panel) li:has(> input[type="radio"]:focus-visible) {
  outline: 2px solid var(--amc-berry);
  outline-offset: 2px;
}
.amc-checkout .amc-payment-panel, .amc-checkout .amc-payment-panel #payment { min-width: 0; max-width: 100%; }
.amc-checkout .amc-payment-panel #place_order { width: 100%; min-height: 44px; }

/* The cart list remains editable. The two summary cards show only amounts. */
.amc-cart .cart_totals.amc-summary tr.woocommerce-shipping-totals,
.amc-cart .cart_totals.amc-summary tr.shipping,
.amc-checkout .amc-order-summary table.amc-review-table > thead,
.amc-checkout .amc-order-summary table.amc-review-table tr.cart_item {
  display: none !important;
}
.amc-cart .cart_totals.amc-summary {
  box-sizing: border-box;
  width: 100% !important;
  max-width: none;
  padding: 0 !important;
}
.amc-cart .cart_totals.amc-summary .amc-summary-title { border-radius: 14px 14px 0 0; }
form.checkout .amc-iran-country { display: none !important; }
form.checkout :is(.woocommerce-billing-fields__field-wrapper,.woocommerce-shipping-fields__field-wrapper) {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 0 12px;
}
form.checkout :is(.woocommerce-billing-fields__field-wrapper,.woocommerce-shipping-fields__field-wrapper) > * {
  grid-column: 1 / -1;
  min-width: 0;
}
form.checkout :is(.woocommerce-billing-fields__field-wrapper,.woocommerce-shipping-fields__field-wrapper) > .form-row {
  float: none;
  width: 100% !important;
  max-width: none;
  margin-inline: 0;
  box-sizing: border-box;
}
/* Place both native name fields on the same row in the RTL contact step. */
form.amc-checkout[data-amc-step="contact"] .woocommerce-billing-fields__field-wrapper:has(> .form-row [name="billing_last_name"]) > .form-row:has([name="billing_first_name"]) {
  grid-area: 1 / 1;
}
form.amc-checkout[data-amc-step="contact"] .woocommerce-billing-fields__field-wrapper:has(> .form-row [name="billing_first_name"]) > .form-row:has([name="billing_last_name"]) {
  grid-area: 1 / 2;
}
form.amc-checkout .woocommerce-billing-fields__field-wrapper :is([name="billing_first_name"], [name="billing_last_name"]) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}
form.checkout :is(#billing_state_field,#shipping_state_field) { grid-column: 1; }
form.checkout :is(#billing_city_field,#shipping_city_field) { grid-column: 2; }
form.checkout :is(#billing_state_field,#shipping_state_field,#billing_city_field,#shipping_city_field) :is(input, select, .select2-container) {
  width: 100% !important;
  max-width: 100%;
  min-width: 0;
}
.amc-checkout .amc-wallet-balance th,
.amc-checkout .amc-wallet-balance td {
  color: var(--amc-plum);
  background: var(--amc-sand);
}
.amc-wallet-panel {
  box-sizing: border-box;
  width: 100%;
  padding: 14px 16px;
  margin-block: 10px 14px;
  background: #fcf4f7;
  border: 1px solid #dfc2cf;
  border-radius: 10px;
}
.amc-wallet-card-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-block-end: 10px;
  color: var(--amc-plum);
}
.amc-wallet-card-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.amc-wallet-panel .amc-wallet-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--amc-plum);
  cursor: pointer;
}
.amc-wallet-label input { margin: 0; accent-color: var(--amc-berry); }
.amc-wallet-amount { display: flex; gap: 8px; margin-block-start: 10px; }
.amc-wallet-amount input { min-width: 0; flex: 1; direction: ltr; }
.amc-summary-pay:disabled, .amc-wallet-panel button:disabled { opacity: .6; cursor: wait; }

/* Each footer line uses the card width even if an extension inserts a large colspan. */
form.amc-checkout .amc-order-summary table.amc-review-table > tfoot {
  display: block;
  width: 100%;
  padding: 0;
  text-align: start;
}
form.amc-checkout .amc-review-table > tfoot > tr:not([hidden]):not(.amc-wallet-field) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  width: 100%;
}
form.amc-checkout .amc-review-table > tfoot > tr > :is(th, td):not([hidden]) {
  box-sizing: border-box;
  width: 100% !important;
  min-width: 0;
}
.amc-review-table > tfoot > tr > td:not(:only-child) { text-align: end; }
form.amc-checkout .amc-review-table > tfoot > tr > :only-child { grid-column: 1 / -1; }

.amc-order-summary .woocommerce-Price-currencySymbol { white-space: nowrap; }

.amc-cart .amc-wallet-applied,
.amc-checkout:not([data-amc-step="payment"]) .amc-order-summary tr.amc-wallet-applied,
.amc-checkout:not([data-amc-step="payment"]) .amc-order-summary tr:has(.amc-wallet-fee),
.amc-cart .cart_totals tr:has(.amc-wallet-fee),
.woocommerce tr.amc-items-source[hidden],
.woocommerce tr.amc-wallet-balance[hidden] { display: none !important; }

.amc-items-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
}
.amc-journey a, .amc-items-heading a { color: #63304a; text-decoration: underline; }

.amc-shipping-items:empty { display: none; }
.amc-items-heading { justify-content: space-between; }
.amc-shipping-items ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.amc-shipping-items li { margin: 0; }
.amc-shipping-items li img {
  display: block;
  box-sizing: border-box;
  width: 54px;
  height: 54px;
  padding: 3px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--amc-line);
  border-radius: 9px;
}
.amc-shipping-heading {
  margin: 16px 0 8px;
  padding-block-start: 14px;
  border-block-start: 1px solid var(--amc-line);
  color: var(--amc-plum);
  font-size: 1rem;
}
.amc-shipping-items:empty + .amc-shipping-heading {
  margin-block-start: 0;
  padding-block-start: 0;
  border: 0;
}

:is(.amc-checkout .amc-order-summary, .amc-cart .cart_totals.amc-summary) {
  --amc-summary-muted: var(--amc-pink);
  color: #fff;
  background-color: var(--amc-plum);
  background-image:
    radial-gradient(circle at 8% 4%, #ffffff12 0 86px, transparent 87px),
    radial-gradient(circle at 97% 107%, #ffffff0d 0 98px, transparent 99px),
    linear-gradient(155deg, var(--amc-plum) 10%, var(--amc-berry) 100%);
  border: 0;
  border-radius: 16px;
  box-shadow: 0 5px 16px #512c431a;
  font-size: 13px;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
}

:is(.amc-checkout .amc-order-summary, .amc-cart .cart_totals.amc-summary) .amc-summary-title {
  margin-block: 0 4px;
  padding: 17px 16px 9px;
  color: #fff;
  background: transparent;
  border: 0;
  font-size: 18px;
  line-height: 1.6;
  font-weight: 800;
}

:is(.amc-order-summary, .cart_totals.amc-summary) table.shop_table :is(th, td) {
  background: transparent;
  border: 0;
  color: var(--amc-summary-muted) !important;
  padding: 7px 2px;
  font-size: 13px;
  line-height: 1.7;
  font-weight: 600;
}

:is(.amc-order-summary, .cart_totals.amc-summary) table.shop_table :is(.amount, bdi, strong, small, a, .woocommerce-Price-currencySymbol) {
  color: inherit !important;
}

:is(.amc-order-summary, .cart_totals.amc-summary) table.shop_table tr.order-total {
  position: relative;
}

:is(.amc-order-summary, .cart_totals.amc-summary) table.shop_table tr.order-total::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-start: 0;
  border-block-start: 1px dashed #ffffff70;
  pointer-events: none;
}

:is(.amc-order-summary, .cart_totals.amc-summary) table.shop_table tr.order-total > :is(th, td) {
  border-block-start: 0;
  font-size: 16px;
  padding-block: 14px;
  color: #fff !important;
  font-weight: 800;
}

:is(.amc-order-summary, .cart_totals.amc-summary) table.shop_table .order-total .amount {
  font-size: 23px;
  font-weight: 800;
}

:is(.amc-order-summary, .cart_totals.amc-summary) .amount .woocommerce-Price-currencySymbol {
  font-size: .8em;
}

:is(.amc-order-summary, .cart_totals.amc-summary) table.shop_table .amc-savings-row > td {
  padding: 0;
}

:is(.amc-order-summary, .cart_totals.amc-summary) .amc-savings {
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: flex-start;
  gap: 3px 5px;
  padding: 10px 13px;
  color: #fff;
  background: #ffffff26;
  border: 1px solid #ffffff1a;
  border-radius: 11px;
  font-size: 12px;
  line-height: 1.65;
}

:is(.amc-order-summary, .cart_totals.amc-summary) .amc-savings::before {
  content: "+";
  margin-inline-end: 3px;
  font-weight: 700;
}

:is(.amc-checkout .amc-order-summary, .amc-cart .cart_totals.amc-summary) :is(.amc-summary-next, .amc-summary-pay, .checkout-button) {
  min-height: 46px;
  border: 1px solid var(--amc-pink);
  border-radius: 12px;
  background: var(--amc-pink);
  color: var(--amc-plum);
  font-size: 14px;
  font-weight: 800;
  box-shadow: none;
}

:is(.amc-checkout .amc-order-summary, .amc-cart .cart_totals.amc-summary) :is(.amc-summary-next, .amc-summary-pay, .checkout-button):hover {
  background: #fff;
  color: var(--amc-plum);
}
:is(.amc-checkout .amc-order-summary, .amc-cart .cart_totals.amc-summary) :is(a, button):focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Keep the space around the two checkout cards white. */
body.woocommerce-checkout:has(form.amc-checkout),
body.woocommerce-checkout :is(main, .main-page-wrapper, .wd-page-content, .wd-content-layout, .site-content, .woocommerce):has(form.amc-checkout),
form.checkout.amc-checkout,
form.checkout.amc-checkout :is(.amc-wide, .amc-checkout-columns) {
  background: #fff !important;
}

body.woocommerce-checkout {
  --amc-field-bg: #f4f1f7;
}

body.woocommerce-checkout :is(form.amc-checkout, form.checkout_coupon:where(.amc-checkout-coupon *)) :is(
  input:not([type]), input[type="text"], input[type="email"], input[type="tel"],
  input[type="number"], input[type="password"], input[type="search"], input[type="url"],
  input[type="date"], textarea, select, .select2-selection
) {
  background-color: var(--amc-field-bg) !important;
}

body.woocommerce-checkout :is(form.amc-checkout, form.checkout_coupon:where(.amc-checkout-coupon *)) input:-webkit-autofill {
  -webkit-box-shadow: inset 0 0 0 1000px var(--amc-field-bg);
}

.amc-journey {
  display: flex;
  direction: rtl;
  color: #512c43;
  border: 1px solid #e9dee3;
  border-radius: 12px;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  margin-block: 0 22px;
  padding: 14px clamp(12px, 3vw, 24px);
  background: #fcf8fa;
}
.amc-journey > a {
  align-self: flex-start;
  font-size: 13px;
}
.amc-journey ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  gap: 8px;
}
.amc-journey ol > li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: clamp(11px, 1.5vw, 14px);
}
.amc-journey [aria-current] { font-weight: 700; }
.amc-journey li:not(:last-child)::after {
  content: "";
  flex: 1;
  border-block-start: 1px solid #d9becd;
}
:is(.amc-journey, .amc-steps) .amc-journey-number {
  display: inline-grid;
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid #d9becd;
  border-radius: 50%;
  background: #fff;
}
:is(.amc-journey, .amc-steps) [aria-current] .amc-journey-number {
  background: #873a58;
  border-color: #873a58;
  color: #fff;
}

.amc-cart .woocommerce-cart-form { container: amc-cart-products / inline-size; }
.amc-cart-products-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 10px 0 12px;
  border-block-end: 1px solid var(--amc-line);
  color: var(--amc-plum);
}
.amc-cart-products-heading h2 { margin: 0; font-size: 17px; }
.amc-cart-products-heading span { font-size: 12px; color: #765b69; }
.amc-cart .amc-cart-lines,
.amc-cart .amc-cart-lines > tbody {
  display: block;
  width: 100%;
  margin: 0;
  border: 0;
}
.amc-cart .amc-cart-lines > thead { display: none; }
.amc-cart .amc-cart-lines tr.amc-cart-product {
  display: grid;
  grid-template-columns: minmax(45px, 61px) minmax(0, 1fr) minmax(90px, max-content);
  grid-template-areas: "photo name total" "photo name price" "photo remove quantity";
  gap: 5px 14px;
  align-items: start;
  padding: 15px 0;
  border-block-end: 1px solid var(--amc-line);
  background: #fff;
}
.amc-cart .amc-cart-lines tr.amc-cart-product > td {
  display: block;
  width: auto;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: start !important;
  overflow-wrap: anywhere;
}
.amc-cart .amc-cart-lines tr.amc-cart-product > td::before { content: none; }
.amc-cart .amc-cart-lines tr.amc-cart-product > .product-thumbnail {
  grid-area: photo;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  aspect-ratio: 1;
  padding: 5px;
  box-sizing: border-box;
  background: var(--amc-sand);
  border: 1px solid var(--amc-line);
  border-radius: 10px;
}
.amc-cart .amc-cart-product .product-thumbnail :is(a, picture, img) {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
}
.amc-cart .amc-cart-product .product-thumbnail img { object-fit: contain !important; }

.amc-cart .amc-cart-product .product-name { grid-area: name; }
.amc-cart .amc-cart-product .product-name > a {
  color: var(--amc-plum);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.65;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
}
.amc-cart .amc-cart-product .product-name > a:hover { text-decoration: underline; }
.amc-cart .woocommerce-cart-form .amc-cart-lines tr.amc-cart-product > td.product-remove,
.amc-cart .woocommerce-cart-form .product-remove .amc-cart-remove {
  position: static !important;
  transform: none !important;
}
.amc-cart .amc-cart-product .product-remove {
  grid-area: remove;
  align-self: start;
  justify-self: start;
}
.amc-cart .woocommerce-cart-form .product-remove .amc-cart-remove {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 30px;
  width: auto;
  height: auto;
  padding: 2px 9px;
  color: #fff !important;
  background: #b42332;
  border: 1px solid #b42332;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}
.amc-cart .product-remove .amc-cart-remove::before,
.amc-cart .product-remove .amc-cart-remove::after { content: none !important; }
.amc-cart .woocommerce-cart-form .product-remove .amc-cart-remove:hover {
  background: #941c2b;
  border-color: #941c2b;
}

.amc-cart .amc-cart-product .product-quantity { grid-area: quantity; justify-self: end; }
.amc-cart .amc-cart-product .product-price { grid-area: price; justify-self: end; }
.amc-cart .amc-cart-product .product-subtotal { grid-area: total; justify-self: end; }
.amc-cart .amc-cart-lines tr.amc-cart-product > td.product-price::before {
  content: "قیمت واحد";
  float: none;
  margin-inline-end: 5px;
  color: #765b69;
  font-size: 11px;
}
.amc-cart .amc-cart-product .product-price :is(.amount, bdi, .woocommerce-Price-currencySymbol) {
  color: #765b69;
  font-size: 12px;
}
.amc-cart .amc-cart-product .product-subtotal :is(.amount, bdi, .woocommerce-Price-currencySymbol) {
  color: var(--amc-plum);
  font-weight: 800;
}
body.woocommerce-cart .woocommerce .woocommerce-Price-currencySymbol:not(.cart_totals *) {
  color: #000 !important;
}
.amc-cart .amc-cart-product :is(.product-price, .product-subtotal) bdi { white-space: nowrap; }
.amc-cart .amc-cart-lines tr:has(> td.actions),
.amc-cart .amc-cart-lines td.actions { display: block; width: 100%; }
.amc-cart .amc-cart-lines td.actions {
  box-sizing: border-box;
  padding: 12px 0 0;
  border: 0;
}
.amc-cart .amc-cart-lines .actions .coupon {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  float: none;
  width: auto;
}
.amc-cart .amc-cart-lines .actions .coupon label.amc-coupon-label { display: block; }
.amc-cart .amc-cart-lines .actions .coupon input[name="coupon_code"] {
  flex: 1 1 120px;
  width: auto;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--amc-line);
  padding: 6px 9px;
}
.amc-cart .amc-cart-lines .actions .coupon button[name="apply_coupon"] {
  flex: 0 0 auto;
  border: 0;
  border-radius: 7px;
  padding: 6px 12px;
  background: var(--amc-berry);
  color: #fff;
}
.amc-cart .amc-cart-product .product-quantity .quantity:has(> .qty:not([type="hidden"])) {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--amc-rose);
  border-radius: 10px;
  background: #fff;
}
.amc-cart .amc-cart-product .product-quantity .quantity > :is(.plus, .minus, .qty) {
  box-sizing: border-box;
  min-height: 34px;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 0 4px;
  background: #fff;
  color: var(--amc-plum);
  font-weight: 700;
  text-align: center;
}
.amc-cart .amc-cart-product .product-quantity .quantity > :is(.plus, .minus) {
  min-width: 28px;
  background: var(--amc-pink);
  font-size: 16px;
}
.amc-cart .amc-cart-product .product-quantity .quantity > :is(.plus, .minus):hover:not(:disabled) {
  background: #edd1df;
}
.amc-cart .amc-cart-product .product-quantity .quantity > :is(.plus, .minus, .qty):focus-visible {
  outline: 2px solid var(--amc-berry);
  outline-offset: -2px;
}

@container amc-cart-products (max-width: 350px) {
  .amc-cart .amc-cart-lines tr.amc-cart-product {
    grid-template-columns: 49px minmax(0, 1fr) minmax(0, max-content);
    grid-template-areas: "photo name name" "photo remove remove" "quantity quantity total" "quantity quantity price";
    gap: 5px 9px;
  }
  .amc-cart .amc-cart-product .product-quantity { justify-self: start; align-self: center; }
}

.amc-cart .cart_totals.amc-summary {
  container: amc-cart-totals / inline-size;
}
.amc-cart .cart_totals.amc-summary table.shop_table {
  display: block;
  box-sizing: border-box;
  --amc-cart-summary-inset: clamp(13px, 5cqi, 18px);
  width: calc(100% - 2 * var(--amc-cart-summary-inset));
  margin: 4px var(--amc-cart-summary-inset) 12px;
  border: 0;
  background: transparent;
}
.amc-cart .cart_totals.amc-summary table.shop_table > :is(tbody, tfoot) {
  display: block;
  width: 100%;
}
.amc-cart .cart_totals.amc-summary table.shop_table tr:not([hidden]):not(.shipping):not(.woocommerce-shipping-totals) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, max-content);
  align-items: center;
  width: 100%;
  column-gap: 9px;
}
.amc-cart .cart_totals.amc-summary table.shop_table tr > :is(th, td) {
  display: block;
  box-sizing: border-box;
  width: auto !important;
  min-width: 0;
  max-width: none;
  padding-inline: 0;
  overflow-wrap: normal;
}
.amc-cart .cart_totals.amc-summary table.shop_table tr > :only-child { grid-column: 1 / -1; }
.amc-cart .cart_totals.amc-summary table.shop_table td:not([colspan]) { text-align: end !important; }
.amc-cart .cart_totals.amc-summary table.shop_table td::before { content: none; }
.amc-cart .cart_totals.amc-summary table.shop_table :is(.amount, bdi) {
  white-space: nowrap;
  word-break: normal;
}
.amc-cart .cart_totals.amc-summary table.shop_table .order-total th { font-size: 14px; }
.amc-cart .cart_totals.amc-summary table.shop_table .order-total .amount {
  font-size: clamp(16px, 7cqi, 23px);
}
.amc-cart .cart_totals.amc-summary .wc-proceed-to-checkout .checkout-button {
  display: grid;
  place-items: center;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}
.amc-cart .cart_totals.amc-summary .wc-proceed-to-checkout .checkout-button { text-decoration: none; }
.amc-cart .cart_totals.amc-summary .wc-proceed-to-checkout > a:not(.checkout-button) {
  display: block;
  margin-block-start: 9px;
  color: #fff;
  text-align: center;
  text-underline-offset: 3px;
}

.woocommerce :is(
  .woocommerce-info:has(.amc-resume-payment),
  .woocommerce-error:has(> li:only-child .amc-resume-payment),
  .woocommerce-error > li:not(:only-child):has(.amc-resume-payment)
) {
  color: #fff;
  background: #a51c56;
  border: 1px solid #841544;
  border-radius: 8px;
}

.woocommerce :is(
  .woocommerce-info:has(.amc-resume-payment),
  .woocommerce-error > li:has(.amc-resume-payment)
) :is(.amount, .woocommerce-Price-currencySymbol) {
  color: #fff !important;
}

.woocommerce .woocommerce-error > li:not(:only-child):has(.amc-resume-payment) {
  padding: 8px 10px;
}

.woocommerce :is(.woocommerce-info, .woocommerce-error) a.amc-resume-payment {
  display: inline-block;
  margin: 4px 6px;
  padding: 4px 10px;
  border: 1px solid #fff2f6;
  border-radius: 6px;
  color: #641434;
  background: #fff2f6;
  font-weight: 700;
  text-decoration: none;
}
.woocommerce :is(.woocommerce-info, .woocommerce-error) a.amc-resume-payment:hover {
  color: #641434;
  background: #f6e6ee;
}
.woocommerce :is(.woocommerce-info, .woocommerce-error) a.amc-resume-payment:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
