/* Sepahan 2.2.3 - previous product-price layout, configurable mobile header, mobile performance. */

@media (max-width: 767px) {
  /* A product with one price must start at the physical left edge, just like sale prices. */
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-price-single,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price-single {
    direction: ltr !important;
    align-items: flex-start !important;
    justify-content: flex-end !important;
    text-align: left !important;
    padding-inline-start: 0 !important;
    margin-inline-start: 0 !important;
  }

  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-price-single > .woocommerce-Price-amount,
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-price-single > .woocommerce-Price-amount *,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price-single > .woocommerce-Price-amount,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price-single > .woocommerce-Price-amount * {
    direction: rtl !important;
    margin-inline: 0 !important;
  }

  /* Avoid expensive repaint/compositing work while the document is scrolling. */
  html {
    scroll-behavior: auto !important;
  }

  html body,
  html body main,
  html body section,
  html body .elementor-element,
  html body .sepahan-shop-page {
    background-attachment: scroll !important;
  }

  html body .sepahan-v241-mobile-bottom-nav,
  html body .sepahan-v241-mobile-bottom-nav-inner,
  html body #topHeader,
  html body header#topHeader,
  html body .sepahan-main-header,
  html body .site-header {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  html body .sepahan-v241-style-glass .sepahan-v241-mobile-bottom-nav-inner {
    background: var(--sepahan-v241-nav-bg, #fff) !important;
  }

  html.dark body .sepahan-v241-style-glass .sepahan-v241-mobile-bottom-nav-inner,
  body.dark .sepahan-v241-style-glass .sepahan-v241-mobile-bottom-nav-inner,
  [data-theme="dark"] body .sepahan-v241-style-glass .sepahan-v241-mobile-bottom-nav-inner {
    background: var(--sepahan-v241-nav-bg, #0f172a) !important;
  }

  html body .sepahan-v241-mobile-bottom-nav {
    transition: none !important;
    transform: translate3d(0, 0, 0) !important;
    backface-visibility: hidden !important;
  }

  html body .sepahan-v241-mobile-bottom-nav-inner {
    box-shadow: 0 7px 22px rgba(15, 23, 42, .14) !important;
  }

  html body .sepahan-v241-mobile-nav-item,
  html body .sepahan-product-card,
  html body .sepahan-product-card *,
  html body .sepahan-shop-cat,
  html body .sepahan-shop-cat * {
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition-duration: 0s !important;
  }

  /* Large repeated shadows are costly on low-end mobile GPUs. */
  html body main#primary.sepahan-shop-page li.product.sepahan-product-card,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card {
    box-shadow: 0 2px 9px rgba(15, 23, 42, .07) !important;
  }

  html body main#primary.sepahan-shop-page li.product.sepahan-product-card:nth-child(n+5),
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card:nth-child(n+5) {
    content-visibility: auto;
    contain-intrinsic-size: 350px;
  }

  /* Keep fixed UI in its own stable layer without promoting every card. */
  html body #topHeader,
  html body header#topHeader,
  html body .sepahan-main-header,
  html body .site-header {
    will-change: auto !important;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
  }

  html body main#primary.sepahan-shop-page .sepahan-product-card,
  html body main#primary.sepahan-shop-page .sepahan-product-card img,
  html body.single-product .sepahan-nikan-related .sepahan-product-card,
  html body.single-product .sepahan-nikan-related .sepahan-product-card img {
    will-change: auto !important;
    filter: none !important;
  }
}


/* Sepahan 2.2.3 final mobile card-price anchoring and stable header. */
@media (max-width: 767px) {
  /* The price is anchored to the physical left edge of product body. */
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-body,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-body {
    position: relative !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  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: relative !important;
    display: block !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: hidden !important;
    box-sizing: border-box !important;
  }

  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-price,
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-price-normalized,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-price-normalized {
    position: absolute !important;
    left: 0 !important;
    right: auto !important;
    bottom: 0 !important;
    top: auto !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% - 48px) !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    direction: rtl !important;
    text-align: left !important;
    transform: none !important;
    box-sizing: border-box !important;
  }

  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-price-single,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price-single {
    left: 0 !important;
    right: auto !important;
    width: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .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-price > ins,
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-price > del,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price > .woocommerce-Price-amount,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price > ins,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price > del {
    align-self: flex-start !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-rating,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-rating {
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
    bottom: 2px !important;
    top: auto !important;
    margin: 0 !important;
    transform: none !important;
  }
}


@media (max-width: 767px) {
  /* -----------------------------------------------------------------------
   * Mobile header. The body class comes from the theme setting and the final
   * inline controller keeps the matching spacer stable without scroll events.
   * -------------------------------------------------------------------- */
  html body #topHeader,
  html body header#topHeader {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    margin: 0 !important;
    transform: none !important;
    translate: none !important;
    filter: none !important;
    clip-path: none !important;
    transition: none !important;
    animation: none !important;
    will-change: auto !important;
    backface-visibility: visible !important;
    content-visibility: visible !important;
    box-sizing: border-box !important;
    z-index: 10000 !important;
  }

  html body #topHeader.is-hidden,
  html body #topHeader.header-hidden,
  html body #topHeader.sepahan-header-hidden,
  html body header#topHeader.is-hidden,
  html body header#topHeader.header-hidden,
  html body header#topHeader.sepahan-header-hidden {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
  }

  html body.sepahan-mobile-header-normal #topHeader,
  html body.sepahan-mobile-header-normal header#topHeader {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
  }

  html body.sepahan-mobile-header-sticky #topHeader,
  html body.sepahan-mobile-header-sticky header#topHeader {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: var(--sepahan-mobile-header-top, 0px) !important;
    left: auto !important;
    right: auto !important;
  }

  html body.sepahan-mobile-header-fixed #topHeader,
  html body.sepahan-mobile-header-fixed header#topHeader {
    position: fixed !important;
    top: var(--sepahan-mobile-header-top, 0px) !important;
    left: 0 !important;
    right: 0 !important;
  }

  html body:not(.sepahan-mobile-header-fixed) #sepahan-v239-header-spacer {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
  }

  html body.sepahan-mobile-header-fixed #sepahan-v239-header-spacer {
    display: block !important;
    width: 100% !important;
    height: calc(var(--sepahan-mobile-header-height, 72px) + 8px) !important;
    min-height: calc(var(--sepahan-mobile-header-height, 72px) + 8px) !important;
    max-height: calc(var(--sepahan-mobile-header-height, 72px) + 8px) !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    overflow: hidden !important;
  }
}

/* --------------------------------------------------------------------------
 * Final mobile card-price visibility fix.
 * Old theme layers used overflow:hidden/max-width on several nested price
 * elements. At narrow widths that could hide the complete amount. Keep every
 * digit visible and allow only the currency label to wrap when truly needed.
 * -------------------------------------------------------------------------- */
@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,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-meta-row {
    grid-template-columns: minmax(0, 1fr) minmax(32px, auto) !important;
    column-gap: 4px !important;
    overflow: visible !important;
    clip: auto !important;
    contain: none !important;
  }

  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-price,
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-price-normalized,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-price-normalized {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-end !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
    clip: auto !important;
    clip-path: none !important;
    contain: none !important;
  }

  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-price ins,
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-price del,
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-price-normalized ins,
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-price-normalized del,
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .woocommerce-Price-amount.amount,
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .woocommerce-Price-amount.amount bdi,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price ins,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price del,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-price-normalized ins,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-price-normalized del,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .woocommerce-Price-amount.amount,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .woocommerce-Price-amount.amount bdi {
    max-width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
    text-overflow: clip !important;
    clip: auto !important;
    clip-path: none !important;
  }

  /* Current prices remain one consistent responsive size. */
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-price > .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 > .sepahan-price-normalized > ins > .woocommerce-Price-amount.amount,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price > .sepahan-price-normalized > .woocommerce-Price-amount.amount,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price > .sepahan-price-normalized > ins > .woocommerce-Price-amount.amount {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    font-size: clamp(10px, 3.15vw, 13px) !important;
    line-height: 1.35 !important;
    letter-spacing: -0.1px !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: keep-all !important;
  }

  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-price > .sepahan-price-normalized > .woocommerce-Price-amount.amount bdi,
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-price > .sepahan-price-normalized > ins > .woocommerce-Price-amount.amount bdi,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price > .sepahan-price-normalized > .woocommerce-Price-amount.amount bdi,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price > .sepahan-price-normalized > ins > .woocommerce-Price-amount.amount bdi {
    display: inline !important;
    width: auto !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: keep-all !important;
  }

  html body li.product.sepahan-product-card .sepahan-card-price-break {
    display: inline !important;
  }

  html body li.product.sepahan-product-card .woocommerce-Price-currencySymbol {
    display: inline-block !important;
    white-space: nowrap !important;
    margin-right: 3px !important;
    margin-left: 0 !important;
  }

  /* The old price may ellipsize only as a last resort; the current price never does. */
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card del .woocommerce-Price-amount.amount,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card del .woocommerce-Price-amount.amount {
    font-size: clamp(8px, 2.55vw, 10.5px) !important;
    white-space: nowrap !important;
  }

  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-rating,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-rating {
    min-width: 32px !important;
    max-width: 42px !important;
    overflow: visible !important;
  }
}

@media (max-width: 359px) {
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-price > .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 > .sepahan-price-normalized > ins > .woocommerce-Price-amount.amount,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price > .sepahan-price-normalized > .woocommerce-Price-amount.amount,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-price > .sepahan-price-normalized > ins > .woocommerce-Price-amount.amount {
    font-size: 9.5px !important;
    letter-spacing: -0.2px !important;
  }

  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-rating,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-rating {
    min-width: 29px !important;
    max-width: 36px !important;
    font-size: 8.5px !important;
    gap: 1px !important;
  }
}

@media (max-width: 767px) {
  html body main#primary.sepahan-shop-page .sepahan-products-grid > ul.products > li.product.sepahan-product-card .sepahan-product-body,
  html body.single-product .sepahan-nikan-related li.product.sepahan-product-card .sepahan-product-body {
    overflow: visible !important;
  }
}
