/* Sepahan v2.75 - unified shop grid, category scroller and product cards */

/* ---------- Layout setting: one source of truth ---------- */
.sepahan-shop-layout-4-2{--sepahan-shop-desktop-cols:4;--sepahan-shop-mobile-cols:2}
.sepahan-shop-layout-3-2{--sepahan-shop-desktop-cols:3;--sepahan-shop-mobile-cols:2}
.sepahan-shop-layout-3-1{--sepahan-shop-desktop-cols:3;--sepahan-shop-mobile-cols:1}
.sepahan-shop-layout-2-1{--sepahan-shop-desktop-cols:2;--sepahan-shop-mobile-cols:1}

html body .sepahan-shop-page .sepahan-products-grid>.products.sepahan-shop-grid,
html body .sepahan-shop-page .sepahan-products-grid>.sepahan-products-loop{
  display:grid!important;
  grid-template-columns:repeat(var(--sepahan-shop-desktop-cols,4),minmax(0,1fr))!important;
  gap:18px!important;
  align-items:stretch!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  list-style:none!important;
  clear:both!important;
}

html body .sepahan-shop-page .sepahan-products-grid>.products.sepahan-shop-grid::before,
html body .sepahan-shop-page .sepahan-products-grid>.products.sepahan-shop-grid::after{display:none!important;content:none!important}

@media(max-width:1023px) and (min-width:768px){
  html body .sepahan-shop-page .sepahan-products-grid>.products.sepahan-shop-grid,
  html body .sepahan-shop-page .sepahan-products-grid>.sepahan-products-loop{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:14px!important;
  }
}

@media(max-width:767px){
  html body .sepahan-shop-page .sepahan-products-grid>.products.sepahan-shop-grid,
  html body .sepahan-shop-page .sepahan-products-grid>.sepahan-products-loop{
    grid-template-columns:repeat(var(--sepahan-shop-mobile-cols,2),minmax(0,1fr))!important;
    gap:10px!important;
  }
}

/* ---------- Category slider: one item per arrow click ---------- */
html body .sepahan-shop-cats-shell{
  position:relative!important;
  width:100%!important;
  max-width:100%!important;
  margin:20px 0 22px!important;
  box-sizing:border-box!important;
}
html body .sepahan-shop-cats-shell-scroll{
  display:grid!important;
  grid-template-columns:44px minmax(0,1fr) 44px!important;
  align-items:center!important;
  gap:10px!important;
  direction:rtl!important;
}
html body .sepahan-shop-cats-shell-scroll .sepahan-shop-cats-scroll{
  display:flex!important;
  flex-flow:row nowrap!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  gap:12px!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  margin:0!important;
  padding:2px!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  direction:rtl!important;
  scroll-behavior:smooth!important;
  scroll-snap-type:x mandatory!important;
  scrollbar-width:none!important;
  -ms-overflow-style:none!important;
  overscroll-behavior-inline:contain!important;
  -webkit-overflow-scrolling:touch!important;
  touch-action:pan-x pan-y!important;
}
html body .sepahan-shop-cats-shell-scroll .sepahan-shop-cats-scroll::-webkit-scrollbar{display:none!important;width:0!important;height:0!important}
html body .sepahan-shop-cats-shell-scroll .sepahan-shop-cats-scroll>.sepahan-shop-cat{
  direction:rtl!important;
  flex:0 0 128px!important;
  width:128px!important;
  min-width:128px!important;
  max-width:128px!important;
  margin:0!important;
  scroll-snap-align:start!important;
  scroll-snap-stop:always!important;
  user-select:none!important;
}
html body .sepahan-shop-cats-ready-drag{cursor:grab!important}
html body .sepahan-shop-cats-dragging{cursor:grabbing!important;scroll-behavior:auto!important;scroll-snap-type:none!important}
html body .sepahan-shop-cats-nav{
  position:relative!important;
  z-index:5!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:44px!important;
  height:44px!important;
  min-width:44px!important;
  padding:0!important;
  border:1px solid var(--sepahan-border,#e5e7eb)!important;
  border-radius:14px!important;
  background:var(--sepahan-card,#fff)!important;
  color:var(--sepahan-text,#111827)!important;
  box-shadow:0 8px 18px rgba(15,23,42,.07)!important;
  font:900 27px/1 Arial,sans-serif!important;
  cursor:pointer!important;
  pointer-events:auto!important;
  transition:transform .16s ease,border-color .16s ease,color .16s ease,opacity .16s ease!important;
}
html body .sepahan-shop-cats-nav:hover:not(:disabled){transform:translateY(-1px)!important;border-color:var(--sepahan-primary,#2563eb)!important;color:var(--sepahan-primary,#2563eb)!important}
html body .sepahan-shop-cats-nav:focus-visible{outline:3px solid color-mix(in srgb,var(--sepahan-primary,#2563eb) 28%,transparent)!important;outline-offset:2px!important}
html body .sepahan-shop-cats-nav:disabled{opacity:.35!important;cursor:default!important;transform:none!important}
html.dark body .sepahan-shop-cats-nav,body.dark .sepahan-shop-cats-nav{background:#111827!important;border-color:#334155!important;color:#f8fafc!important}

@media(max-width:767px){
  html body .sepahan-shop-cats-shell{margin:14px 0 18px!important}
  html body .sepahan-shop-cats-shell-scroll{display:block!important}
  html body .sepahan-shop-cats-nav{display:none!important}
  html body .sepahan-shop-cats-shell-scroll .sepahan-shop-cats-scroll>.sepahan-shop-cat{
    flex-basis:110px!important;width:110px!important;min-width:110px!important;max-width:110px!important;
  }
}

/* ---------- Product card structure ---------- */
html body li.product.sepahan-product-card,
html body li.sepahan-product-card.sepahan-widget-product-card{
  position:relative!important;
  display:flex!important;
  flex-direction:column!important;
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  height:100%!important;
  margin:0!important;
  padding:0!important;
  float:none!important;
  overflow:hidden!important;
  border:1px solid var(--sepahan-border,#e5e7eb)!important;
  border-radius:18px!important;
  background:var(--sepahan-card,#fff)!important;
  box-shadow:0 8px 24px rgba(15,23,42,.055)!important;
  list-style:none!important;
  isolation:isolate!important;
}
html body li.sepahan-product-card>.sepahan-product-inner{
  display:grid!important;
  grid-template-rows:auto minmax(0,1fr) auto!important;
  width:100%!important;
  min-width:0!important;
  height:100%!important;
  padding:0!important;
  background:inherit!important;
}
html body li.sepahan-product-card .sepahan-product-image-link{
  position:relative!important;
  display:block!important;
  width:100%!important;
  min-width:0!important;
  overflow:hidden!important;
  text-decoration:none!important;
}
html body li.sepahan-product-card .sepahan-product-img{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  height:180px!important;
  min-height:0!important;
  margin:0!important;
  padding:14px!important;
  overflow:hidden!important;
  background:var(--sepahan-card,#fff)!important;
  box-sizing:border-box!important;
}
html body li.sepahan-product-card .sepahan-product-img img{
  display:block!important;
  width:auto!important;
  height:auto!important;
  max-width:100%!important;
  max-height:100%!important;
  margin:auto!important;
  object-fit:contain!important;
  transform:none!important;
}
html body li.sepahan-product-card .sepahan-product-body{
  display:flex!important;
  flex-direction:column!important;
  min-width:0!important;
  min-height:0!important;
  padding:12px 13px 8px!important;
  gap:10px!important;
  overflow:hidden!important;
}
html body li.sepahan-product-card .sepahan-product-title{
  display:-webkit-box!important;
  flex:0 0 auto!important;
  min-height:48px!important;
  max-height:48px!important;
  margin:0!important;
  overflow:hidden!important;
  color:var(--sepahan-text,#111827)!important;
  font-size:13px!important;
  font-weight:850!important;
  line-height:24px!important;
  text-align:right!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:2!important;
}
html body li.sepahan-product-card .sepahan-product-title a{display:block!important;color:inherit!important;text-decoration:none!important}

/* Price is the left cell; rating is the right cell, independent of RTL source order. */
html body li.sepahan-product-card .sepahan-product-meta-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:end!important;
  width:100%!important;
  min-width:0!important;
  min-height:48px!important;
  margin-top:auto!important;
  padding:0!important;
  gap:8px!important;
  direction:ltr!important;
  overflow:hidden!important;
}
html body li.sepahan-product-card .sepahan-product-price{
  grid-column:1!important;
  grid-row:1!important;
  justify-self:start!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;
  min-width:0!important;
  max-width:100%!important;
  height:auto!important;
  min-height:40px!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  color:var(--sepahan-product-price,#2563eb)!important;
  text-align:left!important;
  direction:rtl!important;
  font-weight:950!important;
  overflow:hidden!important;
}
html body li.sepahan-product-card .sepahan-price-normalized,
html body li.sepahan-product-card .sepahan-product-price>.price{
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  justify-content:flex-end!important;
  width:100%!important;
  min-width:0!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  gap:2px!important;
  color:inherit!important;
  text-align:left!important;
  direction:rtl!important;
  line-height:1.35!important;
  overflow:hidden!important;
}
html body li.sepahan-product-card .sepahan-product-price del,
html body li.sepahan-product-card .sepahan-price-normalized del{
  order:1!important;
  display:block!important;
  width:100%!important;
  margin:0!important;
  color:#94a3b8!important;
  opacity:.75!important;
  font-size:10.5px!important;
  font-weight:700!important;
  line-height:16px!important;
  text-align:left!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
html body li.sepahan-product-card .sepahan-product-price ins,
html body li.sepahan-product-card .sepahan-price-normalized ins,
html body li.sepahan-product-card .sepahan-price-normalized>.woocommerce-Price-amount{
  order:2!important;
  display:block!important;
  width:100%!important;
  margin:0!important;
  color:inherit!important;
  font-size:13px!important;
  font-weight:950!important;
  line-height:20px!important;
  text-align:left!important;
  text-decoration:none!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
html body li.sepahan-product-card .sepahan-product-price bdi,
html body li.sepahan-product-card .sepahan-price-normalized bdi{
  display:inline-flex!important;
  align-items:baseline!important;
  justify-content:flex-start!important;
  max-width:100%!important;
  direction:rtl!important;
  unicode-bidi:isolate!important;
  white-space:nowrap!important;
}
html body li.sepahan-product-card .sepahan-product-rating{
  grid-column:2!important;
  grid-row:1!important;
  justify-self:end!important;
  align-self:end!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  flex:0 0 auto!important;
  min-width:0!important;
  margin:0 0 2px!important;
  padding:0!important;
  gap:3px!important;
  color:#f59e0b!important;
  font-size:11px!important;
  font-weight:850!important;
  line-height:1!important;
  direction:rtl!important;
  white-space:nowrap!important;
}
html body li.sepahan-product-card .sepahan-product-rating svg{flex:0 0 auto!important;width:15px!important;height:15px!important}
html body li.sepahan-product-card .sepahan-product-price-call,
html body li.sepahan-product-card .sepahan-product-price-outofstock{grid-column:1/-1!important;width:100%!important;max-width:100%!important}

html body li.sepahan-product-card .sepahan-card-actions{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 42px!important;
  align-items:center!important;
  width:100%!important;
  margin:0!important;
  padding:9px 13px 13px!important;
  gap:8px!important;
  box-sizing:border-box!important;
}
html body li.sepahan-product-card .sepahan-card-btn{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  min-width:0!important;
  height:38px!important;
  min-height:38px!important;
  margin:0!important;
  padding:0 10px!important;
  border-radius:12px!important;
  box-sizing:border-box!important;
  font-size:11.5px!important;
  font-weight:900!important;
  line-height:1!important;
  text-decoration:none!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
html body li.sepahan-product-card .sepahan-card-btn-icon{width:42px!important;min-width:42px!important;padding:0!important}
html body li.sepahan-product-card .sepahan-card-btn-icon svg{display:block!important;width:18px!important;height:18px!important}

/* Desktop image proportions follow the selected column count. */
@media(min-width:1024px){
  html body .sepahan-shop-layout-4-2 li.sepahan-product-card .sepahan-product-img{height:170px!important}
  html body .sepahan-shop-layout-3-2 li.sepahan-product-card .sepahan-product-img,
  html body .sepahan-shop-layout-3-1 li.sepahan-product-card .sepahan-product-img{height:205px!important}
  html body .sepahan-shop-layout-2-1 li.sepahan-product-card .sepahan-product-img{height:245px!important}
}

@media(max-width:767px){
  html body .sepahan-shop-layout-4-2 li.sepahan-product-card,
  html body .sepahan-shop-layout-3-2 li.sepahan-product-card{border-radius:15px!important}
  html body .sepahan-shop-layout-4-2 li.sepahan-product-card .sepahan-product-img,
  html body .sepahan-shop-layout-3-2 li.sepahan-product-card .sepahan-product-img{height:124px!important;padding:9px!important}
  html body .sepahan-shop-layout-4-2 li.sepahan-product-card .sepahan-product-body,
  html body .sepahan-shop-layout-3-2 li.sepahan-product-card .sepahan-product-body{padding:8px 9px 5px!important;gap:6px!important}
  html body .sepahan-shop-layout-4-2 li.sepahan-product-card .sepahan-product-title,
  html body .sepahan-shop-layout-3-2 li.sepahan-product-card .sepahan-product-title{
    min-height:40px!important;max-height:40px!important;font-size:11.5px!important;line-height:20px!important;
  }
  html body .sepahan-shop-layout-4-2 li.sepahan-product-card .sepahan-product-meta-row,
  html body .sepahan-shop-layout-3-2 li.sepahan-product-card .sepahan-product-meta-row{min-height:43px!important;gap:5px!important}
  html body .sepahan-shop-layout-4-2 li.sepahan-product-card .sepahan-product-price,
  html body .sepahan-shop-layout-3-2 li.sepahan-product-card .sepahan-product-price{min-height:36px!important}
  html body .sepahan-shop-layout-4-2 li.sepahan-product-card .sepahan-product-price ins,
  html body .sepahan-shop-layout-4-2 li.sepahan-product-card .sepahan-price-normalized ins,
  html body .sepahan-shop-layout-4-2 li.sepahan-product-card .sepahan-price-normalized>.woocommerce-Price-amount,
  html body .sepahan-shop-layout-3-2 li.sepahan-product-card .sepahan-product-price ins,
  html body .sepahan-shop-layout-3-2 li.sepahan-product-card .sepahan-price-normalized ins,
  html body .sepahan-shop-layout-3-2 li.sepahan-product-card .sepahan-price-normalized>.woocommerce-Price-amount{font-size:11px!important;line-height:18px!important}
  html body .sepahan-shop-layout-4-2 li.sepahan-product-card .sepahan-product-rating,
  html body .sepahan-shop-layout-3-2 li.sepahan-product-card .sepahan-product-rating{font-size:9.5px!important;gap:2px!important}
  html body .sepahan-shop-layout-4-2 li.sepahan-product-card .sepahan-product-rating svg,
  html body .sepahan-shop-layout-3-2 li.sepahan-product-card .sepahan-product-rating svg{width:13px!important;height:13px!important}
  html body .sepahan-shop-layout-4-2 li.sepahan-product-card .sepahan-card-actions,
  html body .sepahan-shop-layout-3-2 li.sepahan-product-card .sepahan-card-actions{grid-template-columns:minmax(0,1fr) 36px!important;padding:7px 9px 9px!important;gap:6px!important}
  html body .sepahan-shop-layout-4-2 li.sepahan-product-card .sepahan-card-btn,
  html body .sepahan-shop-layout-3-2 li.sepahan-product-card .sepahan-card-btn{height:33px!important;min-height:33px!important;font-size:10px!important;border-radius:10px!important}
  html body .sepahan-shop-layout-4-2 li.sepahan-product-card .sepahan-card-btn-icon,
  html body .sepahan-shop-layout-3-2 li.sepahan-product-card .sepahan-card-btn-icon{width:36px!important;min-width:36px!important}

  html body .sepahan-shop-layout-3-1 li.sepahan-product-card .sepahan-product-img,
  html body .sepahan-shop-layout-2-1 li.sepahan-product-card .sepahan-product-img{height:210px!important}
}

@media(max-width:380px){
  html body .sepahan-shop-layout-4-2 li.sepahan-product-card .sepahan-product-img,
  html body .sepahan-shop-layout-3-2 li.sepahan-product-card .sepahan-product-img{height:106px!important}
  html body .sepahan-shop-layout-4-2 li.sepahan-product-card .sepahan-card-actions,
  html body .sepahan-shop-layout-3-2 li.sepahan-product-card .sepahan-card-actions{grid-template-columns:minmax(0,1fr) 34px!important}
  html body .sepahan-shop-layout-4-2 li.sepahan-product-card .sepahan-card-btn-icon,
  html body .sepahan-shop-layout-3-2 li.sepahan-product-card .sepahan-card-btn-icon{width:34px!important;min-width:34px!important}
}
