/* Sepahan 2.2.3 - restore only the legacy mobile product-price position. */
@media (max-width: 767px) {
  /*
   * The legacy card placed the price as the first physical item on the left
   * and the rating as the second item on the right.  Reset only positioning
   * properties here; typography, colors and header behaviour remain untouched.
   */
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-meta-row,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-meta-row {
    position: static !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 43px !important;
    margin: 0 !important;
    padding: 0 !important;
    direction: ltr !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  /* Only the direct price child participates in the row layout. */
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price {
    position: static !important;
    inset: auto !important;
    order: 1 !important;
    flex: 1 1 auto !important;
    align-self: flex-end !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-end !important;
    width: auto !important;
    max-width: calc(100% - 42px) !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    direction: ltr !important;
    text-align: left !important;
    transform: none !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  /* The normalized wrapper is content, not another positioned grid/flex item. */
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-normalized,
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-wrap,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-normalized,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-wrap {
    position: static !important;
    inset: auto !important;
    align-self: flex-start !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-end !important;
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 1px !important;
    direction: ltr !important;
    text-align: left !important;
    transform: none !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  /* Keep every price line anchored to the same physical left edge. */
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price .woocommerce-Price-amount,
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price ins,
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price del,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price .woocommerce-Price-amount,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price ins,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price del {
    position: static !important;
    inset: auto !important;
    align-self: flex-start !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    transform: none !important;
  }

  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price .woocommerce-Price-amount,
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price .woocommerce-Price-amount bdi,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price .woocommerce-Price-amount,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price .woocommerce-Price-amount bdi {
    direction: rtl !important;
    text-align: left !important;
  }

  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-rating,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-rating {
    position: static !important;
    inset: auto !important;
    order: 2 !important;
    flex: 0 0 auto !important;
    align-self: flex-end !important;
    margin: 0 0 2px auto !important;
    transform: none !important;
  }
}

/*
 * Exact single/current-price alignment.
 * WooCommerce outputs a direct amount for normal products, but wraps the
 * current sale amount in <ins>.  Normalize both paths to the same physical
 * left origin without changing typography or any header behaviour.
 */
@media (max-width: 767px) {
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-wrap,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-wrap {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-end !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
  }

  /* The nested normalized wrapper was still inheriting an old centred rule. */
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-wrap > .sepahan-price-normalized,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-wrap > .sepahan-price-normalized {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-end !important;
    align-self: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 1px !important;
    direction: ltr !important;
    text-align: left !important;
    transform: none !important;
  }

  /* Direct normal amount and sale <ins> now have the exact same start point. */
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-wrap > .sepahan-price-normalized > .woocommerce-Price-amount.amount,
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-wrap > .sepahan-price-normalized > ins,
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-wrap > .sepahan-price-normalized > del,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-wrap > .sepahan-price-normalized > .woocommerce-Price-amount.amount,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-wrap > .sepahan-price-normalized > ins,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-wrap > .sepahan-price-normalized > del {
    align-self: flex-start !important;
    justify-self: start !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-inline: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-align: left !important;
    transform: none !important;
  }

  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-price-single .sepahan-price-normalized > .woocommerce-Price-amount.amount,
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-price-sale .sepahan-price-normalized > ins > .woocommerce-Price-amount.amount,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price-single .sepahan-price-normalized > .woocommerce-Price-amount.amount,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price-sale .sepahan-price-normalized > ins > .woocommerce-Price-amount.amount {
    display: inline-block !important;
    align-self: flex-start !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    transform: none !important;
  }
}

/*
 * Sepahan 2.2.3 — exact price origin at every viewport width.
 * Keep the normal-price DOM path and the sale-current <ins> path anchored to
 * the same physical left edge. Typography and header behaviour are untouched.
 */
html body li.product.sepahan-product-card .sepahan-product-meta-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: end !important;
  direction: ltr !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

html body li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price {
  grid-column: 1 !important;
  grid-row: 1 !important;
  justify-self: stretch !important;
  align-self: end !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-end !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  direction: ltr !important;
  text-align: left !important;
  transform: none !important;
  box-sizing: border-box !important;
}

html body li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-wrap,
html body li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-normalized,
html body li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-wrap > .sepahan-price-normalized {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-end !important;
  align-self: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  margin-inline: 0 !important;
  padding: 0 !important;
  gap: 1px !important;
  direction: ltr !important;
  text-align: left !important;
  transform: none !important;
  box-sizing: border-box !important;
}

/* Both output shapes begin at exactly x=0 inside the price column. */
html body li.product.sepahan-product-card .sepahan-product-price-single .sepahan-price-normalized > .woocommerce-Price-amount.amount,
html body li.product.sepahan-product-card .sepahan-product-price-sale .sepahan-price-normalized > ins,
html body li.product.sepahan-product-card .sepahan-product-price-sale .sepahan-price-normalized > del,
html body li.product.sepahan-product-card .sepahan-product-price-sale .sepahan-price-normalized > ins > .woocommerce-Price-amount.amount,
html body li.product.sepahan-product-card .sepahan-product-price-sale .sepahan-price-normalized > del > .woocommerce-Price-amount.amount {
  position: static !important;
  inset: auto !important;
  align-self: flex-start !important;
  justify-self: start !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  margin-inline: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-align: left !important;
  transform: none !important;
}

html body li.product.sepahan-product-card .sepahan-product-price-single .woocommerce-Price-amount.amount,
html body li.product.sepahan-product-card .sepahan-product-price-sale ins .woocommerce-Price-amount.amount,
html body li.product.sepahan-product-card .sepahan-product-price-sale del .woocommerce-Price-amount.amount {
  direction: rtl !important;
  unicode-bidi: isolate !important;
  text-align: left !important;
}

html body li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-rating {
  grid-column: 2 !important;
  grid-row: 1 !important;
  justify-self: end !important;
  align-self: end !important;
}

/* High-specificity archive/related override for desktop and tablet. */
html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price,
html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price {
  justify-self: stretch !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  direction: ltr !important;
  text-align: left !important;
}

html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-wrap,
html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-normalized,
html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-wrap > .sepahan-price-normalized,
html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-wrap,
html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-normalized,
html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-meta-row > .sepahan-product-price > .sepahan-price-wrap > .sepahan-price-normalized {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-end !important;
  align-self: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  margin-inline: 0 !important;
  padding: 0 !important;
  direction: ltr !important;
  text-align: left !important;
  transform: none !important;
}

html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-price-single .sepahan-price-normalized > .woocommerce-Price-amount.amount,
html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-price-sale .sepahan-price-normalized > ins,
html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-price-sale .sepahan-price-normalized > del,
html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-price-sale .sepahan-price-normalized > ins > .woocommerce-Price-amount.amount,
html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-price-sale .sepahan-price-normalized > del > .woocommerce-Price-amount.amount,
html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price-single .sepahan-price-normalized > .woocommerce-Price-amount.amount,
html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price-sale .sepahan-price-normalized > ins,
html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price-sale .sepahan-price-normalized > del,
html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price-sale .sepahan-price-normalized > ins > .woocommerce-Price-amount.amount,
html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price-sale .sepahan-price-normalized > del > .woocommerce-Price-amount.amount {
  align-self: flex-start !important;
  justify-self: start !important;
  width: auto !important;
  max-width: 100% !important;
  margin: 0 !important;
  margin-inline: 0 !important;
  padding-inline: 0 !important;
  text-align: left !important;
  transform: none !important;
}
