/* اصلاحات ریسپانسیو صفحهٔ اصلی و محصول؛ بدون تغییر هویت بصری */
:root{--page-gutter:clamp(.75rem,4vw,3rem);--sticky-bar-h:5.5rem;--site-max:112.5rem}
html,body{min-width:0;width:100%}
.container{width:min(calc(100% - 2 * var(--page-gutter)),var(--site-max));margin-inline:auto}
.breadcrumb{min-width:0;gap:.5rem;overflow-wrap:anywhere}
#heroSlider{width:100%;height:auto;min-height:0;aspect-ratio:16 / 9;overflow:hidden;position:relative;border-radius:clamp(.25rem,1vw,.875rem);touch-action:pan-y}
#heroSlides{position:absolute;inset:0;width:100%;display:flex;direction:ltr;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:none;-webkit-overflow-scrolling:touch;overscroll-behavior-inline:contain;touch-action:pan-y;will-change:scroll-position}
#heroSlides::-webkit-scrollbar{display:none}
#heroSlides .hero-slide{position:relative;display:grid;grid-template-columns:minmax(0,1fr);flex:0 0 100%;width:100%;min-width:0;height:100%;scroll-snap-align:start;scroll-snap-stop:always;direction:rtl}
#heroSlides .hero-slide img{grid-area:1/1;width:100%;height:100%;max-width:none;object-fit:cover;object-position:var(--hero-focus,32%) center;user-select:none;-webkit-user-drag:none}
.hero-copy{display:none}
.hero-dots{inset-inline:0;inset-block-end:clamp(.5rem,1.5vw,1rem);width:max-content;margin-inline:auto;transform:none}
.hero-prev,.hero-next{display:none}
.cat-strip{grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch}
.cat-tile{min-width:0;min-height:100%;overflow-wrap:anywhere}
.cat-strip>.cat-tile:last-child:nth-child(odd){grid-column:1/-1}
.products{grid-template-columns:repeat(2,minmax(0,1fr))}
.cat-layout .products,.pc-panel .products{grid-template-columns:repeat(2,minmax(0,1fr));min-width:0}
.product-card,.pc-body,.pc-price,.pc-val,.pc-meta{min-width:0}
.pc-val{overflow-wrap:anywhere;white-space:normal}
.pc-val b,.pc-val small{white-space:nowrap;min-width:0}
.pc-meta{flex-wrap:wrap;justify-content:space-between}
.pc-pill{max-width:100%;white-space:normal;overflow-wrap:anywhere}
.pc-cta{min-width:0;white-space:nowrap;font-size:clamp(.65rem,2.5vw,.8rem);padding-inline:.35rem}
.pc-title{min-height:2.8em;line-height:1.4;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}
/* گالری و اطلاعات محصول */
.pd-grid{grid-template-columns:minmax(0,1fr);min-width:0}
.pd-gallery,.pd-info,.pd-buybox{min-width:0;width:100%}
.pd-main{width:100%;aspect-ratio:4/3;max-height:none}
.pd-thumbs{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-inline:contain;scroll-snap-type:x proximity;scrollbar-width:thin;padding-block-end:.25rem}
.pd-thumbs button{flex:0 0 3.5rem;scroll-snap-align:start}
#pdVars{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.5rem}
#pdVars button{min-width:0;padding-inline:.35rem;white-space:normal;overflow-wrap:anywhere}
.opt-values{min-width:0}
.pd-deal,.deal-clock,.dc-seg{min-width:0}
.dc-seg{flex:1 1 0}
.pd-breadcrumb,.breadcrumb{padding-inline:0}
/* محصولات پیشنهادی و کارت‌های کوچک */
#related.products{width:100%;grid-template-columns:repeat(2,minmax(0,1fr));gap:.625rem;justify-content:stretch;min-width:0}
#related .product-card{width:100%;min-width:0;overflow:hidden}
#related .pc-img{width:100%;aspect-ratio:1/1;padding:.45rem;min-width:0}
#related .pc-img>img{width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain}
#related .pc-body{padding:.5rem;min-width:0}
#related .pc-title{min-height:2.8em;line-height:1.4;font-size:clamp(.68rem,2.6vw,.8rem);-webkit-line-clamp:2;overflow-wrap:anywhere}
#related .pc-meta{gap:.25rem;flex-wrap:wrap;min-height:0}
#related .pc-meta .pc-pill{font-size:clamp(.55rem,2vw,.68rem);max-width:100%;white-space:normal}
#related .pc-rating{font-size:.68rem}
#related .pc-price{display:flex;min-width:0;overflow:visible}
#related .pc-val{display:flex;flex:1 1 100%;min-width:0;flex-wrap:wrap;gap:.15rem;white-space:normal;overflow:visible;padding:.3rem}
#related .pc-val b{font-size:clamp(.65rem,2.8vw,.8rem);white-space:nowrap}
#related .pc-val small,#related .pc-from{font-size:clamp(.55rem,2vw,.65rem);white-space:nowrap}
#related .pc-cta{min-width:0;white-space:nowrap;font-size:clamp(.6rem,2.2vw,.72rem);padding-inline:.25rem}
#related .pc-type{inset-block-start:.4rem;inset-inline-start:.4rem;inset-inline-end:auto;max-width:55%;white-space:nowrap}
#related .pc-sale-badge{inset-block-start:.4rem;inset-inline-end:.4rem;inset-inline-start:auto;max-width:45%;white-space:nowrap}
#related .card-actions{inset-block-start:2.5rem;inset-block-end:auto;inset-inline-start:.35rem;inset-inline-end:auto;display:flex;flex-direction:column;flex-wrap:nowrap;gap:.3rem;padding:0;transform:none;max-width:none}
#related .product-card:hover .card-actions,#related .product-card:focus-within .card-actions{opacity:1;pointer-events:auto;transform:none}
#related .ca-btn{width:2rem;height:2rem;flex:0 0 2rem}
/* نوار خرید موبایل */
.sb-bar{inset-inline:0;inset-block-end:0;width:100%;min-width:0;flex-wrap:wrap;gap:.5rem;padding:.5rem max(.75rem,var(--page-gutter)) calc(.5rem + env(safe-area-inset-bottom));}
.sb-mid{flex:1 1 5rem;min-width:0}
.sb-name{max-width:100%;min-width:0}
.sb-price{flex:0 0 auto;min-width:0;gap:.25rem}
.sb-price b{font-size:clamp(.75rem,3.5vw,.95rem);white-space:nowrap}
.sb-price small{white-space:nowrap;font-size:.62rem}
.sb-thumb{width:2.75rem;height:2.75rem;flex:0 0 2.75rem}
.sb-add{flex:0 0 auto;min-width:0;white-space:nowrap}
html.pd-sb{--sticky-bar-h:7rem}
html.pd-sb body{padding-block-end:calc(var(--sticky-bar-h) + env(safe-area-inset-bottom))}
html.pd-sb .scroll-top{inset-block-end:calc(var(--sticky-bar-h) + 1rem + env(safe-area-inset-bottom));inset-inline-end:max(.75rem,var(--page-gutter))}
html.pd-sb .toast{inset-block-end:calc(var(--sticky-bar-h) + 1rem + env(safe-area-inset-bottom))}
@media(max-width:1023px){
  .hero-copy{position:relative;grid-area:1/1;z-index:2;justify-self:start;align-self:center;margin-inline-start:2.5%;width:min(44%,40rem);min-width:0;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:clamp(.2rem,1vw,.55rem);padding:clamp(.35rem,2vw,.85rem);border-radius:.4rem;background:linear-gradient(270deg,rgba(44,24,115,.97),rgba(44,24,115,.86));color:#fff;text-align:start;direction:rtl}
  .hero-copy h2{font-size:clamp(.8rem,2.2vw,1.3rem);line-height:1.5;font-weight:900;overflow-wrap:anywhere}
  .hero-copy p{font-size:clamp(.65rem,1.6vw,.9rem);line-height:1.65;overflow-wrap:anywhere}
  .hero-copy a{display:inline-flex;align-items:center;gap:.3rem;max-width:100%;padding:clamp(.22rem,.7vw,.45rem) clamp(.4rem,1vw,.7rem);border-radius:.25rem;background:#fff;color:#32205f;font-size:clamp(.62rem,1.45vw,.8rem);font-weight:800;white-space:nowrap}
}
@media(max-width:359px){
  #heroSlider{aspect-ratio:16/10}
  #heroSlides .hero-slide img{object-position:32% center}
  .hero-copy{width:51%;inset-block:5%;padding:.35rem}
  .hero-copy h2{font-size:.78rem}
  .hero-copy p{font-size:.62rem}
  .hero-copy a{font-size:.62rem;padding:.2rem .35rem}
  #pdVars{grid-template-columns:repeat(2,minmax(0,1fr))}
  #pdVars button:last-child:nth-child(odd){grid-column:1/-1}
  .sb-bar{display:grid;grid-template-columns:2.75rem minmax(0,1fr) auto}
  .sb-add{grid-column:1/-1;width:100%;min-height:2.75rem}
  html.pd-sb{--sticky-bar-h:7rem}
}
@media(min-width:360px){#heroSlider{aspect-ratio:16/9}}
@media(max-width:479px){
  .sb-bar{display:grid;grid-template-columns:2.75rem minmax(0,1fr) auto}
  .sb-add{grid-column:1/-1;width:100%;min-height:2.75rem}
  html.pd-sb{--sticky-bar-h:7rem}
}
@media(min-width:480px){
  :root{--sticky-bar-h:4rem}
  .sb-bar{flex-wrap:nowrap}
  .sb-add{min-width:8rem}
  html.pd-sb{--sticky-bar-h:4rem}
}
@media(min-width:600px){
  .cat-strip{grid-template-columns:repeat(3,minmax(0,1fr))}
  .cat-strip>.cat-tile:last-child:nth-child(odd){grid-column:auto}
  #related.products{grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem}
  .products{grid-template-columns:repeat(3,minmax(0,1fr))}
  .cat-layout .products,.pc-panel .products{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(min-width:600px) and (max-width:1023px){#heroSlider{aspect-ratio:21/9}}
@media(min-width:768px){
  :root{--site-max:45rem}
  .cat-strip{grid-template-columns:repeat(4,minmax(0,1fr))}
  .cat-strip>.cat-tile:last-child:nth-child(odd){grid-column:2/4;justify-self:center;width:calc(50% - .375rem)}
  #related.products{grid-template-columns:repeat(4,minmax(0,1fr))}
  .products{grid-template-columns:repeat(4,minmax(0,1fr))}
  .cat-layout .products,.pc-panel .products{grid-template-columns:repeat(4,minmax(0,1fr))}
  .pd-grid{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);align-items:start}
  .pd-buybox{grid-column:1/-1;position:static}
  .pd-thumbs{overflow:visible;flex-wrap:wrap}
}
@media(min-width:768px) and (hover:none){
  #related .card-actions{opacity:1;pointer-events:auto;transform:none}
  #related .card-actions [data-quick],#related .card-actions [data-compare]{display:none}
}
@media(min-width:768px) and (hover:hover){
  #related .card-actions [data-quick],#related .card-actions [data-compare]{display:grid}
}
@media(min-width:768px) and (hover:none){#heroSlider .hero-prev,#heroSlider .hero-next{display:none}}
@media(min-width:768px) and (hover:hover){
  #heroSlider .hero-prev,#heroSlider .hero-next{display:grid;opacity:0}
  #heroSlider:hover .hero-prev,#heroSlider:hover .hero-next,#heroSlider :focus-visible.hero-prev,#heroSlider :focus-visible.hero-next{opacity:1}
}
@media(min-width:1024px){
  :root{--site-max:60rem}
  #heroSlider{aspect-ratio:3/1}
  #heroSlides .hero-slide img{object-position:var(--hero-focus,32%) center}
  .hero-copy{position:relative;grid-area:1/1;z-index:2;justify-self:start;align-self:center;margin-inline-start:0;width:min(40%,40rem);min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:clamp(.4rem,1vw,1rem);padding:clamp(1rem,2vw,2rem);border-radius:.6rem;background:linear-gradient(270deg,rgba(44,24,115,.99),rgba(44,24,115,.94));color:#fff;text-align:start;direction:rtl}
  .hero-copy h2{font-size:clamp(1.25rem,.7rem + 2.2vw,2.5rem);line-height:1.45;font-weight:900;overflow-wrap:anywhere}
  .hero-copy p{font-size:clamp(.9rem,.6rem + 1.2vw,1.25rem);line-height:1.65;overflow-wrap:anywhere}
  .hero-copy a{display:inline-flex;align-items:center;gap:.4rem;max-width:100%;padding:clamp(.45rem,1vw,.8rem) clamp(.75rem,1.4vw,1.3rem);border-radius:.3rem;background:#fff;color:#32205f;font-size:clamp(.8rem,.6rem + .6vw,1rem);font-weight:800;white-space:nowrap}
  .cat-strip{grid-template-columns:repeat(5,minmax(0,1fr))}
  .products{grid-template-columns:repeat(5,minmax(0,1fr))}
  .cat-layout .products,.pc-panel .products{grid-template-columns:repeat(5,minmax(0,1fr))}
  .pd-grid{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);align-items:start}
  .pd-buybox{grid-column:1/-1;position:static}
  .pd-gallery{position:static}
  .sb-bar{display:none}
  html.pd-sb body{padding-block-end:0}
  html.pd-sb .scroll-top{inset-block-end:1rem}
}
@media(min-width:1280px){
  :root{--site-max:75rem}
  .cat-strip{grid-template-columns:repeat(5,minmax(0,1fr))}
  .products{grid-template-columns:repeat(6,minmax(0,1fr))}
  .cat-layout .products,.pc-panel .products{grid-template-columns:repeat(6,minmax(0,1fr))}
  #related.products{grid-template-columns:repeat(6,minmax(0,1fr))}
  .pd-grid{grid-template-columns:minmax(18rem,.82fr) minmax(25rem,1.28fr) minmax(22rem,24rem);align-items:start}
  .pd-buybox{grid-column:auto;position:sticky;inset-block-start:5rem}
  .pd-gallery{position:sticky;inset-block-start:5rem}
}
@media(min-width:1536px){html{font-size:112.5%}:root{--site-max:87.5rem;--page-gutter:3rem}}
@media(min-width:1920px){html{font-size:125%}:root{--site-max:100rem;--page-gutter:3.5rem}}
@media(min-width:2560px){html{font-size:150%}:root{--site-max:115rem;--page-gutter:4vw}.cat-strip{grid-template-columns:repeat(5,minmax(0,1fr))}.products{grid-template-columns:repeat(8,minmax(0,1fr))}.cat-layout .products,.pc-panel .products{grid-template-columns:repeat(8,minmax(0,1fr))}#related.products{grid-template-columns:repeat(8,minmax(0,1fr))}}
@media(min-width:3840px){html{font-size:200%}:root{--site-max:125rem;--page-gutter:5vw}}
@media(orientation:landscape) and (max-height:500px) and (max-width:900px){#heroSlider{aspect-ratio:21/9}.pd-main{aspect-ratio:16/9;max-height:65vh}}
@media(hover:none){
  #related .card-actions{opacity:1;pointer-events:auto;transform:none}
  #related .card-actions [data-quick],#related .card-actions [data-compare]{display:none}
  #related .ca-btn{min-width:2.25rem;min-height:2.25rem}
}
@supports(height:100dvh){.sf-card{max-height:calc(100dvh - 2rem)}}
@media(prefers-reduced-motion:reduce){
  #heroSlides{scroll-behavior:auto}
  .hero-prev,.hero-next,.hero-dots button,.sb-bar{transition:none}
}
@media(min-width:2560px){
  a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid var(--primary);outline-offset:3px}
  .hero-prev,.hero-next,.pc-cta,.primary-btn,.buy-btn{min-block-size:3.5rem}
  .hero-prev,.hero-next{min-inline-size:3.5rem}
  .ca-btn{min-inline-size:3.5rem;min-block-size:3.5rem}
}
/* اسلایدر فقط تصویر و کنترل‌های جابه‌جایی را نشان می‌دهد. */
.hero-copy{display:none}
/* تناسب بنر و گرید دسته‌بندی به مقادیر پایهٔ قالب برمی‌گردد. */
#heroSlider{aspect-ratio:2116 / 496}
.cat-strip{grid-template-columns:repeat(5,1fr)}
.cat-strip>.cat-tile:last-child:nth-child(odd){grid-column:auto;justify-self:stretch;width:auto}
@media(max-width:760px){.cat-strip{grid-template-columns:repeat(3,1fr)}}
@media(max-width:480px){.cat-strip{grid-template-columns:repeat(2,1fr)}}
