/* Allameh shop — cart / checkout / thank-you (loaded only on those pages) */
/* ------------------------------------------------------------------ */
/* Purchase journey: three-step bar (سبد ← اطلاعات ← پرداخت)          */
/* ------------------------------------------------------------------ */

body.allameh-brand-ui .allameh-steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  max-width: 760px;
  margin: 12px auto 36px;
  padding: 0 12px;
}

body.allameh-brand-ui .allameh-steps__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 148px;
  flex: 0 0 auto;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: none;
}

body.allameh-brand-ui .allameh-steps__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--brand-line);
  background: var(--brand-surface);
  color: var(--brand-text-muted);
  font-family: var(--brand-font);
  font-size: 15px;
  font-weight: 700;
}

body.allameh-brand-ui .allameh-steps__num svg {
  width: 16px;
  height: 16px;
  display: block;
}

body.allameh-brand-ui .allameh-steps__label {
  font-family: var(--brand-font);
  font-size: 14px;
  color: var(--brand-text-muted);
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
}

body.allameh-brand-ui .allameh-steps__short {
  display: none;
}

body.allameh-brand-ui .allameh-steps__item.is-active .allameh-steps__num {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--brand-on-primary);
  box-shadow: 0 2px 8px rgba(38, 35, 122, 0.24);
}

body.allameh-brand-ui .allameh-steps__item.is-active .allameh-steps__label {
  color: var(--brand-primary);
  font-weight: 700;
}

body.allameh-brand-ui .allameh-steps__item.is-done .allameh-steps__num {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: rgba(38, 35, 122, 0.06);
}

body.allameh-brand-ui .allameh-steps__item.is-done .allameh-steps__label {
  color: var(--brand-text-secondary);
}

body.allameh-brand-ui .allameh-steps__item.is-back {
  cursor: pointer;
}

body.allameh-brand-ui .allameh-steps__item.is-back:hover .allameh-steps__num {
  border-color: var(--brand-primary);
  background: rgba(38, 35, 122, 0.12);
}

body.allameh-brand-ui .allameh-steps__item.is-back:hover .allameh-steps__label {
  color: var(--brand-primary);
}

body.allameh-brand-ui .allameh-steps__arrow {
  flex: 0 0 88px;
  min-width: 88px;
  max-width: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-line);
  padding-top: 14px;
  align-self: flex-start;
}

body.allameh-brand-ui .allameh-steps__arrow svg {
  display: block;
  width: 20px;
  height: 20px;
}

body.allameh-brand-ui .allameh-steps__item.is-done + .allameh-steps__arrow {
  color: rgba(38, 35, 122, 0.4);
}

body.allameh-brand-ui .allameh-steps__line {
  display: none;
}

/* ------------------------------------------------------------------ */
/* Cart page: one rounded shell around items, one around totals       */
/* ------------------------------------------------------------------ */

body.allameh-brand-ui.woocommerce-cart .e-shop-table.e-cart-section,
body.allameh-brand-ui.woocommerce-cart .e-cart-totals.e-cart-section {
  border: 1px solid var(--brand-line) !important;
  border-radius: var(--brand-radius-control) !important;
  overflow: hidden;
  background: var(--brand-surface);
}

body.allameh-brand-ui.woocommerce-cart .e-cart-totals.e-cart-section {
  background: #fafafc;
}

body.allameh-brand-ui.woocommerce-cart table.shop_table,
body.allameh-brand-ui.woocommerce-cart .e-shop-table table.shop_table,
body.allameh-brand-ui.woocommerce-cart .cart-collaterals .cart_totals,
body.allameh-brand-ui.woocommerce-cart .e-cart-totals .cart_totals,
body.allameh-brand-ui.woocommerce-cart .cart_totals table.shop_table {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

body.allameh-brand-ui.woocommerce-cart table.shop_table th,
body.allameh-brand-ui.woocommerce-cart table.shop_table td {
  border: 0 !important;
  border-bottom: 1px solid rgba(38, 35, 122, 0.08) !important;
  padding: 14px 12px !important;
  font-family: var(--brand-font) !important;
  vertical-align: middle;
}

body.allameh-brand-ui.woocommerce-cart table.shop_table thead th {
  background: #fafafc;
  color: var(--brand-primary);
  font-size: 13px;
  font-weight: 700;
}

body.allameh-brand-ui.woocommerce-cart .e-shop-table table.shop_table tr:last-child td,
body.allameh-brand-ui.woocommerce-cart .e-cart-totals table.shop_table tr:last-child th,
body.allameh-brand-ui.woocommerce-cart .e-cart-totals table.shop_table tr:last-child td {
  border-bottom: 0 !important;
}

body.allameh-brand-ui .woocommerce-cart table.cart img {
  width: 56px;
  border-radius: 8px;
  background: transparent;
}

body.allameh-brand-ui .woocommerce-cart table.cart td.product-name a {
  color: var(--brand-text);
  text-decoration: none;
}

body.allameh-brand-ui .woocommerce-cart table.cart td.product-name a:hover {
  color: var(--brand-primary);
}

body.allameh-brand-ui .woocommerce-cart table.cart .quantity .qty {
  border: 1px solid var(--brand-line);
  border-radius: var(--brand-radius-control);
  padding: 8px;
  min-width: 60px;
  font-family: var(--brand-font);
}

body.allameh-brand-ui .woocommerce a.remove {
  color: var(--brand-text-muted) !important;
  background: transparent;
  font-weight: 400;
  transition: color 0.15s ease, background-color 0.15s ease;
}

body.allameh-brand-ui .woocommerce a.remove:hover {
  color: #9b2c2c !important;
  background: rgba(155, 44, 44, 0.08);
}

/* Cart is step 1 only: coupon + shipping estimation live in step 3.
   NOTE: on the cart page `woocommerce-cart` is a BODY class and the cart
   is rendered by the Elementor Pro cart widget (`.e-cart-section`). */
body.allameh-brand-ui.woocommerce-cart .coupon,
body.allameh-brand-ui.woocommerce-cart td.actions .coupon,
body.allameh-brand-ui.woocommerce-cart .woocommerce-shipping-calculator,
body.allameh-brand-ui.woocommerce-cart .cart_totals tr.shipping {
  display: none !important;
}

/* Cart toolbar: item count chip + continue shopping (utbparts pattern) */
body.allameh-brand-ui .allameh-cart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
}

body.allameh-brand-ui .allameh-cart-toolbar__count {
  display: inline-block;
  border: 1px solid var(--brand-line);
  border-radius: var(--brand-radius-control);
  padding: 8px 16px;
  font-family: var(--brand-font);
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-primary);
  background: var(--brand-surface);
}

body.allameh-brand-ui .allameh-cart-toolbar__continue {
  font-family: var(--brand-font);
  font-size: 13px;
  color: var(--brand-text-secondary) !important;
  text-decoration: underline;
  text-underline-offset: 4px;
}

body.allameh-brand-ui .allameh-cart-toolbar__continue:hover {
  color: var(--brand-primary) !important;
}

/* Country is always Iran — the row is noise */
body.allameh-brand-ui #billing_country_field,
body.allameh-brand-ui #shipping_country_field,
body.allameh-brand-ui #billing_email_field,
body.allameh-brand-ui #shipping_email_field,
body.allameh-brand-ui #billing_address_2_field,
body.allameh-brand-ui #shipping_address_2_field {
  display: none !important;
}

/* Empty cart: centered, calm, one clear way forward */
body.allameh-brand-ui .cart-empty.woocommerce-info {
  background: transparent !important;
  border: 0 !important;
  text-align: center;
  color: var(--brand-text-secondary) !important;
  font-family: var(--brand-font) !important;
  font-size: 1.05rem;
  padding: 48px 16px 8px !important;
  margin: 0 !important;
}

body.allameh-brand-ui .cart-empty.woocommerce-info::before {
  content: none !important;
}

body.allameh-brand-ui .woocommerce .return-to-shop {
  text-align: center;
  padding-bottom: 48px;
}

body.allameh-brand-ui .woocommerce .return-to-shop a.button {
  background-color: var(--brand-primary) !important;
  color: var(--brand-on-primary) !important;
  border: 0 !important;
  border-radius: var(--brand-radius-control) !important;
  padding: 12px 28px !important;
  font-size: 13px !important;
  box-shadow: 0 1px 3px rgba(38, 35, 122, 0.18) !important;
}

/* ------------------------------------------------------------------ */
/* Checkout: focused form, sticky-calm order review                   */
/* ------------------------------------------------------------------ */

/* The three-step bar already names each stage. Hide duplicate titles. */
body.allameh-brand-ui.woocommerce-cart .page-header,
body.allameh-brand-ui.woocommerce-checkout .page-header,
body.allameh-brand-ui.woocommerce-cart .entry-header,
body.allameh-brand-ui.woocommerce-checkout .entry-header,
body.allameh-brand-ui.woocommerce-cart h1.entry-title,
body.allameh-brand-ui.woocommerce-checkout h1.entry-title,
body.allameh-brand-ui.woocommerce-cart .elementor-page-title,
body.allameh-brand-ui.woocommerce-checkout .elementor-page-title,
body.allameh-brand-ui .woocommerce-billing-fields > h3,
body.allameh-brand-ui .woocommerce-checkout #order_review_heading {
  display: none !important;
}

body.allameh-brand-ui .woocommerce-checkout form .form-row label {
  font-family: var(--brand-font);
  font-size: 13px;
  color: var(--brand-text-secondary);
  margin-bottom: 4px;
}

body.allameh-brand-ui .woocommerce-checkout form .form-row label .required ~ .required {
  display: none !important;
}

body.allameh-brand-ui .woocommerce-checkout form .form-row {
  margin-bottom: 14px;
}

body.allameh-brand-ui .woocommerce-checkout .form-row-first,
body.allameh-brand-ui .woocommerce-checkout .form-row-last {
  width: 48.5%;
  float: right;
  clear: none;
}

body.allameh-brand-ui .woocommerce-checkout .form-row-last {
  float: left;
}

body.allameh-brand-ui .woocommerce-checkout .form-row-wide {
  clear: both;
}

body.allameh-brand-ui .woocommerce-checkout #billing_state_field,
body.allameh-brand-ui .woocommerce-checkout #shipping_state_field {
  width: 48.5% !important;
  float: right !important;
  clear: both !important;
}

body.allameh-brand-ui .woocommerce-checkout #billing_city_field,
body.allameh-brand-ui .woocommerce-checkout #shipping_city_field {
  width: 48.5% !important;
  float: left !important;
  clear: none !important;
}

body.allameh-brand-ui .woocommerce-checkout #billing_last_name_field,
body.allameh-brand-ui .woocommerce-checkout #shipping_last_name_field,
body.allameh-brand-ui .woocommerce-checkout .allameh-hidden-field {
  display: none !important;
}

body.allameh-brand-ui .woocommerce-checkout #billing_first_name_field,
body.allameh-brand-ui .woocommerce-checkout #shipping_first_name_field {
  width: 48.5% !important;
  float: right !important;
  clear: both !important;
}

body.allameh-brand-ui .woocommerce-checkout #billing_company_field,
body.allameh-brand-ui .woocommerce-checkout #shipping_company_field {
  width: 48.5% !important;
  float: left !important;
  clear: none !important;
}

body.woocommerce-checkout .elementor-widget-woocommerce-checkout-page,
body.woocommerce-checkout .elementor-widget-woocommerce-checkout-page .elementor-widget-container,
body.woocommerce-checkout form.woocommerce-checkout {
  overflow: visible !important;
}

body.allameh-brand-ui .woocommerce-checkout #customer_details,
body.allameh-brand-ui .woocommerce-checkout .woocommerce-billing-fields,
body.allameh-brand-ui .woocommerce-checkout .woocommerce-billing-fields__field-wrapper,
body.allameh-brand-ui .woocommerce-checkout #billing_first_name_field,
body.allameh-brand-ui .woocommerce-checkout #billing_company_field,
body.allameh-brand-ui .woocommerce-checkout #shipping_first_name_field,
body.allameh-brand-ui .woocommerce-checkout #shipping_company_field {
  overflow: visible !important;
}

body.allameh-brand-ui .woocommerce-checkout #billing_first_name_field,
body.allameh-brand-ui .woocommerce-checkout #billing_company_field,
body.allameh-brand-ui .woocommerce-checkout #shipping_first_name_field,
body.allameh-brand-ui .woocommerce-checkout #shipping_company_field {
  position: relative;
  z-index: 1;
}

body.allameh-brand-ui .woocommerce-checkout #billing_first_name_field:focus-within,
body.allameh-brand-ui .woocommerce-checkout #billing_company_field:focus-within,
body.allameh-brand-ui .woocommerce-checkout #shipping_first_name_field:focus-within,
body.allameh-brand-ui .woocommerce-checkout #shipping_company_field:focus-within {
  z-index: 40;
}

body.allameh-brand-ui .woocommerce-checkout #billing_first_name_field .woocommerce-input-wrapper,
body.allameh-brand-ui .woocommerce-checkout #billing_company_field .woocommerce-input-wrapper,
body.allameh-brand-ui .woocommerce-checkout #shipping_first_name_field .woocommerce-input-wrapper,
body.allameh-brand-ui .woocommerce-checkout #shipping_company_field .woocommerce-input-wrapper {
  display: block;
  position: relative;
  width: 100%;
  min-height: 46px;
}

body.allameh-brand-ui .woocommerce-checkout #billing_first_name,
body.allameh-brand-ui .woocommerce-checkout #billing_company,
body.allameh-brand-ui .woocommerce-checkout #shipping_first_name,
body.allameh-brand-ui .woocommerce-checkout #shipping_company {
  display: block !important;
  width: 100% !important;
  min-height: 46px !important;
  height: 46px !important;
  max-height: 46px !important;
  box-sizing: border-box !important;
  resize: none !important;
  overflow: hidden !important;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.5 !important;
  field-sizing: fixed !important;
}

body.allameh-brand-ui .woocommerce-checkout #billing_first_name_field:focus-within #billing_first_name,
body.allameh-brand-ui .woocommerce-checkout #billing_company_field:focus-within #billing_company,
body.allameh-brand-ui .woocommerce-checkout #shipping_first_name_field:focus-within #shipping_first_name,
body.allameh-brand-ui .woocommerce-checkout #shipping_company_field:focus-within #shipping_company {
  position: relative;
  z-index: 40;
  max-height: none !important;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-overflow: clip;
  background: #fff !important;
  box-shadow: 0 12px 32px rgba(25, 22, 101, 0.16);
}

body.allameh-brand-ui .woocommerce-checkout .thwcfd-field-wrapper:has(#billing_first_name_field),
body.allameh-brand-ui .woocommerce-checkout .thwcfd-field-wrapper:has(#billing_company_field),
body.allameh-brand-ui .woocommerce-checkout .thwcfd-field-wrapper:has(#billing_last_name_field),
body.allameh-brand-ui .woocommerce-checkout .thwcfd-field-wrapper:has(#billing_state_field),
body.allameh-brand-ui .woocommerce-checkout .thwcfd-field-wrapper:has(#billing_city_field),
body.allameh-brand-ui .woocommerce-checkout .thwcfd-field-wrapper:has(#shipping_first_name_field),
body.allameh-brand-ui .woocommerce-checkout .thwcfd-field-wrapper:has(#shipping_company_field),
body.allameh-brand-ui .woocommerce-checkout .thwcfd-field-wrapper:has(#shipping_last_name_field),
body.allameh-brand-ui .woocommerce-checkout .thwcfd-field-wrapper:has(#shipping_state_field),
body.allameh-brand-ui .woocommerce-checkout .thwcfd-field-wrapper:has(#shipping_city_field) {
  display: contents;
}

body.allameh-brand-ui .woocommerce-checkout #billing_state_field .select2-container,
body.allameh-brand-ui .woocommerce-checkout #billing_city_field .select2-container,
body.allameh-brand-ui .woocommerce-checkout #shipping_state_field .select2-container,
body.allameh-brand-ui .woocommerce-checkout #shipping_city_field .select2-container {
  width: 100% !important;
}

body.allameh-brand-ui .woocommerce-checkout #billing_address_1_field,
body.allameh-brand-ui .woocommerce-checkout #shipping_address_1_field {
  clear: both !important;
  width: 100% !important;
  float: none !important;
}

body.allameh-brand-ui .woocommerce-checkout #billing_address_1,
body.allameh-brand-ui .woocommerce-checkout #shipping_address_1 {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 88px !important;
  box-sizing: border-box !important;
  resize: none !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;
  white-space: pre-wrap !important;
  word-break: break-word;
  line-height: 1.7 !important;
  field-sizing: content;
}

body.allameh-brand-ui .woocommerce-checkout #customer_details {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  float: none;
  border: 1px solid var(--brand-line);
  border-radius: var(--brand-radius-control);
  padding: 24px 20px;
  background: var(--brand-surface);
  box-sizing: border-box;
}

body.allameh-brand-ui .woocommerce-checkout #customer_details .col-1,
body.allameh-brand-ui .woocommerce-checkout #customer_details .col-2 {
  width: 100% !important;
  float: none !important;
  max-width: none !important;
}

body.allameh-brand-ui .woocommerce-checkout #customer_details .col-2,
body.allameh-brand-ui .woocommerce-billing-fields > p:not(.form-row),
body.allameh-brand-ui .woocommerce-billing-fields__field-wrapper > p:not(.form-row),
body.allameh-brand-ui .woocommerce-checkout #customer_details .col-1 > p:not(.form-row),
body.allameh-brand-ui .woocommerce-checkout #customer_details > p:not(.form-row) {
  display: none !important;
}

body.allameh-brand-ui #ship-to-different-address,
body.allameh-brand-ui .woocommerce-shipping-fields,
body.allameh-brand-ui .woocommerce-shipping-fields-wrapper {
  display: none !important;
}

body.allameh-brand-ui .woocommerce-additional-fields,
body.allameh-brand-ui .woocommerce-additional-fields__field-wrapper,
body.allameh-brand-ui #order_comments_field {
  width: 100% !important;
  float: none !important;
  clear: both !important;
  max-width: none !important;
}

body.allameh-brand-ui .woocommerce-additional-fields > h3 {
  display: none !important;
}

body.allameh-brand-ui .woocommerce-checkout #customer_details #allameh-to-payment {
  order: 20;
  margin-top: 20px !important;
  margin-bottom: 0 !important;
}

body.allameh-brand-ui #order_comments {
  display: block !important;
  width: 100% !important;
  min-height: 88px !important;
  box-sizing: border-box !important;
}

body.allameh-brand-ui .woocommerce-checkout table.shop_table {
  border: 0 !important;
}

body.allameh-brand-ui .woocommerce-checkout table.shop_table td,
body.allameh-brand-ui .woocommerce-checkout table.shop_table th {
  border-color: rgba(38, 35, 122, 0.08) !important;
  font-family: var(--brand-font) !important;
}

body.allameh-brand-ui .woocommerce-checkout #payment {
  background: transparent !important;
  border-top: 1px solid var(--brand-line);
  margin-top: 8px;
}

body.allameh-brand-ui .woocommerce-checkout #payment ul.payment_methods {
  border-bottom: 1px solid rgba(38, 35, 122, 0.08) !important;
  padding: 16px 0;
}

body.allameh-brand-ui .woocommerce-checkout #payment div.payment_box {
  background: rgba(38, 35, 122, 0.05) !important;
  color: var(--brand-text-secondary) !important;
  border-radius: 8px;
  font-size: 13px;
}

body.allameh-brand-ui .woocommerce-checkout #payment div.payment_box::before {
  border-bottom-color: rgba(38, 35, 122, 0.05) !important;
}

body.allameh-brand-ui .woocommerce-checkout #place_order {
  display: block !important;
  width: 100% !important;
  text-align: center;
  font-size: 15px !important;
  padding: 14px 22px !important;
}

body.allameh-brand-ui .allameh-pay-trust {
  margin: 14px 0 0;
  padding: 10px 14px;
  text-align: center;
  font-family: var(--brand-font);
  font-size: 12.5px;
  color: var(--brand-text-secondary);
  background: rgba(38, 35, 122, 0.05);
  border: 1px solid var(--brand-line);
  border-radius: var(--brand-radius-control);
}

body.allameh-brand-ui .woocommerce-privacy-policy-text {
  font-family: var(--brand-font);
  font-size: 12.5px;
  color: var(--brand-text-muted);
}

body.allameh-brand-ui .allameh-recs {
  max-width: 1120px;
  margin: 36px auto 24px;
  padding: 8px 0 12px;
  box-sizing: border-box;
}

body.allameh-brand-ui .allameh-recs__title {
  font-family: var(--brand-font);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand-primary);
  text-align: right;
  margin: 0 0 16px;
}

body.allameh-brand-ui .allameh-recs__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.allameh-brand-ui .allameh-recs__item {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
  background: var(--brand-surface);
  border: 1px solid var(--brand-line);
  border-radius: var(--brand-radius-control);
}

body.allameh-brand-ui .allameh-recs__cover {
  flex: 0 0 96px;
  width: 96px;
  display: block;
}

body.allameh-brand-ui .allameh-recs__img,
body.allameh-brand-ui .allameh-recs__cover img {
  display: block;
  width: 96px;
  height: 132px;
  object-fit: cover;
  border-radius: 8px;
  background: #efeff6;
}

body.allameh-brand-ui .allameh-recs__meta {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

body.allameh-brand-ui .allameh-recs__name {
  font-family: var(--brand-font);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.55;
  color: var(--brand-text) !important;
  text-decoration: none !important;
}

body.allameh-brand-ui .allameh-recs__name:hover {
  color: var(--brand-primary) !important;
}

body.allameh-brand-ui .allameh-recs__price,
body.allameh-brand-ui .allameh-recs__price .amount,
body.allameh-brand-ui .allameh-recs__price .woocommerce-Price-amount {
  font-size: 0.95rem !important;
  color: var(--brand-primary) !important;
  font-weight: 700;
}

body.allameh-brand-ui .allameh-recs__add,
body.allameh-brand-ui a.allameh-recs__add {
  margin-top: 6px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px !important;
  font-size: 13px !important;
  width: auto !important;
  min-width: 0;
  background: var(--brand-primary) !important;
  color: var(--brand-on-primary) !important;
  border: 0 !important;
  border-radius: var(--brand-radius-control) !important;
  box-shadow: none !important;
}

body.allameh-brand-ui a.allameh-recs__add:hover {
  background: var(--brand-primary-dark) !important;
  color: var(--brand-on-primary) !important;
}

@media (min-width: 768px) {
  body.allameh-brand-ui .allameh-recs__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  body.allameh-brand-ui .allameh-recs__cover,
  body.allameh-brand-ui .allameh-recs__img,
  body.allameh-brand-ui .allameh-recs__cover img {
    flex-basis: 112px;
    width: 112px;
    height: 154px;
  }
}

/* --- Two-phase checkout: info (step 2) vs payment (step 3) --- */
body.allameh-msc--info #order_review,
body.allameh-msc--info #order_review_heading,
body.allameh-msc--info #allameh-back-info {
  display: none !important;
}

body.allameh-msc--pay #customer_details {
  display: none !important;
}

/* Coupon belongs to the payment step, not the info step */
body.allameh-msc--info .woocommerce-form-coupon-toggle,
body.allameh-msc--info form.checkout_coupon,
body.allameh-msc--info form.checkout_coupon[style*="display: block"],
body.allameh-msc--info form.checkout_coupon[style*="display:block"] {
  display: none !important;
}

body.allameh-brand-ui .woocommerce-form-coupon-toggle .woocommerce-info {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 0 0 12px !important;
  padding: 12px 16px !important;
  background: #fafafc !important;
  border: 1px solid var(--brand-line) !important;
  border-radius: var(--brand-radius-control) !important;
  color: var(--brand-text-secondary) !important;
  font-family: var(--brand-font) !important;
  font-size: 14px !important;
  line-height: 1.7 !important;
}

body.allameh-brand-ui .woocommerce-form-coupon-toggle .woocommerce-info::before {
  content: none !important;
  display: none !important;
}

body.allameh-brand-ui .woocommerce-form-coupon-toggle .showcoupon {
  color: var(--brand-primary) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.allameh-brand-ui form.checkout_coupon {
  display: none;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 10px;
  border: 1px solid var(--brand-line) !important;
  border-radius: var(--brand-radius-control) !important;
  padding: 12px !important;
  background: var(--brand-surface) !important;
  margin: 0 0 20px !important;
}

body.allameh-brand-ui form.checkout_coupon[style*="display: block"],
body.allameh-brand-ui form.checkout_coupon[style*="display:block"] {
  display: flex !important;
}

body.allameh-brand-ui form.checkout_coupon .form-row,
body.allameh-brand-ui form.checkout_coupon .form-row-first,
body.allameh-brand-ui form.checkout_coupon .form-row-last {
  width: auto !important;
  float: none !important;
  clear: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.allameh-brand-ui form.checkout_coupon .form-row-first {
  flex: 1 1 auto;
  min-width: 0;
}

body.allameh-brand-ui form.checkout_coupon .form-row-last {
  flex: 0 0 auto;
}

body.allameh-brand-ui form.checkout_coupon .form-row label,
body.allameh-brand-ui form.checkout_coupon .form-row br,
body.allameh-brand-ui form.checkout_coupon .clear {
  display: none !important;
}

body.allameh-brand-ui form.checkout_coupon input.input-text {
  width: 100% !important;
  min-height: 46px !important;
  margin: 0 !important;
}

body.allameh-brand-ui form.checkout_coupon button,
body.allameh-brand-ui form.checkout_coupon .button {
  height: 46px !important;
  min-height: 46px !important;
  margin: 0 !important;
  padding: 0 18px !important;
  white-space: nowrap !important;
  background: var(--brand-primary) !important;
  color: var(--brand-on-primary) !important;
  border: 0 !important;
  border-radius: var(--brand-radius-control) !important;
  font-family: var(--brand-font) !important;
}

body.allameh-brand-ui .allameh-flow-cta,
body.allameh-brand-ui #allameh-to-payment,
body.allameh-brand-ui #allameh-place-clone,
body.allameh-brand-ui .woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  margin: 28px auto 8px !important;
  margin-inline: auto !important;
  background: var(--brand-primary) !important;
  color: var(--brand-on-primary) !important;
  border: 0 !important;
  border-radius: var(--brand-radius-control) !important;
  font-family: var(--brand-font) !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  line-height: 1.3 !important;
  padding: 14px 22px !important;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(38, 35, 122, 0.18);
  transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
  text-decoration: none !important;
  box-sizing: border-box;
}

body.allameh-brand-ui .allameh-flow-cta:hover,
body.allameh-brand-ui #allameh-to-payment:hover,
body.allameh-brand-ui #allameh-place-clone:hover,
body.allameh-brand-ui .woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
  background: var(--brand-primary-dark) !important;
  box-shadow: 0 2px 8px rgba(38, 35, 122, 0.22);
  color: var(--brand-on-primary) !important;
}

body.allameh-brand-ui .allameh-flow-cta:active,
body.allameh-brand-ui #allameh-to-payment:active,
body.allameh-brand-ui #allameh-place-clone:active {
  transform: scale(0.98);
}

body.allameh-brand-ui.allameh-msc--pay #allameh-to-payment,
body.allameh-brand-ui.allameh-msc--info #allameh-place-clone,
body.allameh-brand-ui #allameh-to-payment[hidden],
body.allameh-brand-ui #allameh-place-clone[hidden] {
  display: none !important;
}

body.allameh-brand-ui .allameh-flow-cta__ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

body.allameh-brand-ui .allameh-flow-cta__ico svg {
  display: block;
}

@media (min-width: 768px) {
  body.allameh-brand-ui .allameh-flow-dock {
    display: contents;
  }

  body.allameh-brand-ui.woocommerce-cart .wc-proceed-to-checkout {
    position: relative;
    z-index: 2;
  }
}

body.allameh-brand-ui .allameh-flow-dock[hidden] {
  display: none !important;
}

body.allameh-brand-ui #allameh-back-info {
  display: none !important;
}

body.allameh-brand-ui .woocommerce-checkout .form-row.woocommerce-invalid input.input-text,
body.allameh-brand-ui .woocommerce-checkout .form-row.woocommerce-invalid select {
  border-color: #9b2c2c !important;
  box-shadow: 0 0 0 3px rgba(155, 44, 44, 0.1) !important;
}

/* --- Order received: designed success state --- */
body.allameh-brand-ui .allameh-thankyou-page {
  max-width: 720px;
  margin: 0 auto 48px;
  padding: 40px 16px 8px;
}

body.allameh-brand-ui .allameh-thankyou {
  max-width: none;
  margin: 0 0 24px;
  padding: 40px 24px;
  text-align: center;
  border: 1px solid var(--brand-line);
  border-radius: var(--brand-radius-control);
  background: var(--brand-surface);
  box-shadow: 0 2px 14px rgba(25, 22, 101, 0.07);
}

body.allameh-brand-ui .allameh-thankyou__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(38, 35, 122, 0.08);
  color: var(--brand-primary);
  margin-bottom: 16px;
}

body.allameh-brand-ui .allameh-thankyou__title {
  color: var(--brand-primary);
  font-size: 1.3rem !important;
  font-weight: 700;
  margin: 0 0 8px;
}

body.allameh-brand-ui .allameh-thankyou__text {
  color: var(--brand-text-secondary);
  font-size: 14px;
  line-height: 1.8;
  max-width: 40rem;
  margin: 0 auto 20px;
}

body.allameh-brand-ui .allameh-thankyou__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

body.allameh-brand-ui .allameh-thankyou__chip {
  display: inline-block;
  border: 1px solid var(--brand-line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  color: var(--brand-text-secondary);
  background: #fafafc;
}

body.allameh-brand-ui .allameh-thankyou__chip b {
  color: var(--brand-text);
  font-weight: 700;
}

body.allameh-brand-ui .allameh-thankyou__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 12px;
}

body.allameh-brand-ui .allameh-thankyou__support,
body.allameh-brand-ui a.allameh-thankyou__shop {
  display: inline-flex !important;
  flex-direction: row;
  flex: 0 0 auto;
  align-items: center !important;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  min-height: 46px;
  margin: 0 !important;
  line-height: 1 !important;
  white-space: nowrap;
  font-size: 13px !important;
  font-weight: 400 !important;
  text-decoration: none !important;
  vertical-align: middle;
}

body.allameh-brand-ui .allameh-thankyou__support::before,
body.allameh-brand-ui .allameh-thankyou__support::after,
body.allameh-brand-ui a.allameh-thankyou__shop::before,
body.allameh-brand-ui a.allameh-thankyou__shop::after {
  content: none !important;
  display: none !important;
}

body.allameh-brand-ui .allameh-thankyou__glyph {
  display: block !important;
  flex: 0 0 16px;
  width: 16px !important;
  height: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible;
}

body.allameh-brand-ui .allameh-thankyou__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
  white-space: nowrap;
}

body.allameh-brand-ui .allameh-thankyou__support {
  color: var(--brand-primary) !important;
  border: 1px solid rgba(38, 35, 122, 0.25);
  border-radius: var(--brand-radius-control);
  padding: 0 18px;
  transition: background-color 0.18s ease;
}

body.allameh-brand-ui .allameh-thankyou__support:hover {
  background: rgba(38, 35, 122, 0.06);
}

body.allameh-brand-ui a.allameh-thankyou__shop {
  background: var(--brand-primary) !important;
  color: var(--brand-on-primary) !important;
  border: 0 !important;
  border-radius: var(--brand-radius-control) !important;
  padding: 0 24px !important;
  box-shadow: none !important;
}

body.allameh-brand-ui a.allameh-thankyou__shop:hover {
  background: var(--brand-primary-dark) !important;
}

@media (max-width: 480px) {
  body.allameh-brand-ui .allameh-thankyou__support,
  body.allameh-brand-ui a.allameh-thankyou__shop {
    width: 100%;
  }
}

body.allameh-brand-ui .allameh-thankyou__heading {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-primary);
}

body.allameh-brand-ui .allameh-thankyou__board,
body.allameh-brand-ui .allameh-thankyou__ship {
  border: 1px solid var(--brand-line);
  border-radius: var(--brand-radius-control);
  padding: 20px;
  margin-bottom: 24px;
  background: var(--brand-surface);
}

body.allameh-brand-ui .allameh-thankyou__items {
  list-style: none;
  margin: 0;
  padding: 0;
}

body.allameh-brand-ui .allameh-thankyou__item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--brand-line);
}

body.allameh-brand-ui .allameh-thankyou__item:first-child {
  padding-top: 0;
  border-top: 0;
}

body.allameh-brand-ui .allameh-thankyou__cover {
  flex: 0 0 64px;
  width: 64px;
  height: 88px;
  overflow: hidden;
  border-radius: var(--brand-radius-control);
  background: #efeff6;
}

body.allameh-brand-ui .allameh-thankyou__cover img,
body.allameh-brand-ui .allameh-thankyou__cover-img {
  display: block;
  width: 64px;
  height: 88px;
  object-fit: cover;
}

body.allameh-brand-ui .allameh-thankyou__item-meta {
  min-width: 0;
  flex: 1 1 auto;
  text-align: right;
}

body.allameh-brand-ui .allameh-thankyou__item-name {
  margin: 0;
  font-weight: 500;
  color: var(--brand-text);
}

body.allameh-brand-ui .allameh-thankyou__item-qty {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--brand-primary);
}

body.allameh-brand-ui .allameh-thankyou__sum {
  margin: 16px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--brand-line);
  text-align: left;
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-primary);
}

body.allameh-brand-ui .allameh-thankyou__ship-name {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--brand-text);
}

body.allameh-brand-ui .allameh-thankyou__ship-line {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--brand-text-secondary);
}

/* Hide the plain default confirmation — the designed panel replaces it */
body.allameh-brand-ui .woocommerce-thankyou-order-received,
body.allameh-brand-ui ul.woocommerce-order-overview,
body.allameh-brand-ui .woocommerce-order-details,
body.allameh-brand-ui .woocommerce-customer-details,
body.allameh-brand-ui .woocommerce-order-downloads,
body.woocommerce-order-received .allameh-steps {
  display: none !important;
}

@media (max-width: 767px) {
  body.allameh-brand-ui .allameh-steps {
    margin-bottom: 22px;
    padding: 0 8px;
    max-width: none;
  }

  body.allameh-brand-ui .allameh-steps__item {
    min-width: 0;
    flex: 1 1 0;
    gap: 8px;
  }

  body.allameh-brand-ui .allameh-steps__num {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  body.allameh-brand-ui .allameh-steps__full {
    display: none;
  }

  body.allameh-brand-ui .allameh-steps__short {
    display: inline;
  }

  body.allameh-brand-ui .allameh-steps__label {
    font-size: 11.5px;
    white-space: nowrap;
  }

  body.allameh-brand-ui .allameh-steps__arrow {
    flex: 0 0 22px;
    min-width: 22px;
    max-width: 22px;
    padding-top: 8px;
  }

  body.allameh-brand-ui .allameh-steps__arrow svg {
    width: 14px;
    height: 14px;
  }

  body.allameh-brand-ui .woocommerce-checkout #customer_details {
    padding: 16px 12px;
    max-width: none;
  }

  body.allameh-brand-ui form.checkout_coupon[style*="display: block"],
  body.allameh-brand-ui form.checkout_coupon[style*="display:block"] {
    flex-wrap: nowrap;
  }

  body.allameh-brand-ui.allameh-msc .allameh-flow-dock,
  body.allameh-brand-ui.woocommerce-cart .wc-proceed-to-checkout.allameh-flow-dock,
  body.allameh-brand-ui.woocommerce-cart .wc-proceed-to-checkout {
    display: block !important;
    position: fixed !important;
    bottom: 0;
    inset-inline: 0;
    z-index: 100020;
    margin: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    box-shadow: 0 -8px 24px rgba(25, 22, 101, 0.1);
    border-top: 1px solid var(--brand-line);
  }

  body.allameh-brand-ui.allameh-msc .allameh-flow-dock .allameh-flow-cta,
  body.allameh-brand-ui.allameh-msc .allameh-flow-dock #allameh-to-payment,
  body.allameh-brand-ui.allameh-msc .allameh-flow-dock #allameh-place-clone,
  body.allameh-brand-ui.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
    max-width: none;
    width: 100%;
    margin: 0 !important;
    border-radius: var(--brand-radius-control) !important;
    padding: 14px 18px !important;
    box-shadow: none;
  }

  body.allameh-brand-ui.woocommerce-cart,
  body.allameh-msc--info,
  body.allameh-msc--pay {
    padding-bottom: 92px;
  }

  body.allameh-msc--pay #order_review .form-row.place-order {
    display: none !important;
  }
}

/* WooCommerce smallscreen hides .product-thumbnail. Show covers as a card. */
@media screen and (max-width: 768px) {
  body.allameh-brand-ui.woocommerce-cart table.shop_table.cart tbody tr.cart_item {
    display: grid !important;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    grid-template-areas:
      "thumb name remove"
      "thumb price price"
      "thumb qty subtotal";
    column-gap: 12px;
    row-gap: 6px;
    align-items: start;
    padding: 16px 14px !important;
  }

  body.allameh-brand-ui.woocommerce-cart table.shop_table.cart tbody tr.cart_item td {
    display: block !important;
    width: auto !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    text-align: start !important;
    float: none !important;
  }

  body.allameh-brand-ui.woocommerce-cart table.shop_table.cart tbody tr.cart_item td::before {
    content: none !important;
    display: none !important;
    float: none !important;
  }

  body.allameh-brand-ui.woocommerce-cart table.cart .product-thumbnail,
  body.allameh-brand-ui.woocommerce-cart table.shop_table.cart td.product-thumbnail {
    display: block !important;
    grid-area: thumb;
  }

  body.allameh-brand-ui.woocommerce-cart table.shop_table.cart td.product-name {
    grid-area: name;
    align-self: center;
  }

  body.allameh-brand-ui.woocommerce-cart table.shop_table.cart td.product-remove {
    grid-area: remove;
    justify-self: end;
  }

  body.allameh-brand-ui.woocommerce-cart table.shop_table.cart td.product-price {
    grid-area: price;
    font-size: 13px;
    color: var(--brand-text-secondary);
  }

  body.allameh-brand-ui.woocommerce-cart table.shop_table.cart td.product-quantity {
    grid-area: qty;
  }

  body.allameh-brand-ui.woocommerce-cart table.shop_table.cart td.product-subtotal {
    grid-area: subtotal;
    justify-self: end;
    align-self: center;
    font-weight: 700;
    color: var(--brand-primary);
  }

  body.allameh-brand-ui.woocommerce-cart table.cart td.product-thumbnail a {
    display: block;
    width: 72px;
  }

  body.allameh-brand-ui.woocommerce-cart table.cart td.product-thumbnail img,
  body.allameh-brand-ui.woocommerce-cart table.cart .product-thumbnail img {
    display: block !important;
    width: 72px !important;
    max-width: 72px !important;
    height: auto !important;
    border-radius: 8px;
    background: transparent;
  }
}
