/* XAVIA Home — mobile-first + fixed columns (جلوگیری از کارت بزرگ/تک‌ردیفه) */
:root{
  --brand:#0d9488;
  --brand-dark:#0f766e;
  --xv-bg:#f8fafc;
  --xv-card:#fff;
  --xv-text:#0f172a;
  --xv-muted:#64748b;
  --xv-radius:14px;
  --xv-shadow:0 4px 16px rgba(15,23,42,.06);
  --xv-cols:2;
  --xv-cols-md:3;
  --xv-cols-lg:4;
  --xv-img-max:200px;
  --xv-card-max:240px;
}
.xv-home{background:var(--xv-bg);color:var(--xv-text);direction:rtl}
.xv-home a{text-decoration:none;color:inherit}
.xv-home img{max-width:100%}
.xv-home .container{max-width:1320px}

/* هیچ عکسی بزرگ‌تر از این محدوده رندر نمی‌شود */
.xv-home img{max-height:60vh}

/* Banner / Hero */
.xv-hero{padding:.75rem 0 .25rem}
.xv-hero .container{padding-left:.75rem;padding-right:.75rem}
.xv-banner{
  border-radius:var(--xv-radius);overflow:hidden;
  position:relative;color:#fff;
  box-shadow:var(--xv-shadow);
  aspect-ratio:12/5;
  max-height:210px;
  background:linear-gradient(135deg,#0d9488,#14b8a6 50%,#99f6e4);
}
.xv-banner-pic{position:absolute;inset:0;display:block}
.xv-banner-pic picture,.xv-banner-pic img{
  position:absolute;inset:0;width:100%;height:100%;
  object-fit:cover;object-position:center;display:block;
}
.xv-banner.no-img{display:flex;align-items:center;padding:.9rem 1rem}
.xv-banner h2{margin:0;font-size:1rem;font-weight:800;line-height:1.35}
.xv-banner p{margin:.2rem 0 .6rem;font-size:.78rem;opacity:.92}
.xv-banner .content{position:relative;z-index:2}
.xv-banner.has-caption:not(.no-img) .content{
  position:absolute;inset:auto 0 0 0;
  padding:1.5rem .9rem .8rem;
  background:linear-gradient(to top, rgba(3,10,15,.78), rgba(3,10,15,.35) 60%, rgba(3,10,15,0));
}
.btn-banner{
  display:inline-block;background:#fff;color:var(--brand-dark);
  font-size:.78rem;font-weight:700;border-radius:999px;padding:.35rem .9rem;
}
.xv-sec{padding:.85rem 0}
.xv-sec-head{
  display:flex;align-items:center;justify-content:space-between;
  margin-bottom:.65rem;gap:.5rem;
}
.xv-sec-head h3{margin:0;font-size:1rem;font-weight:800}
.xv-sec-head a{font-size:.8rem;color:var(--brand);font-weight:700}

/* Categories / Brands scroll */
.xv-cats,.xv-brands{display:flex;overflow-x:auto;gap:.55rem;padding-bottom:.35rem;-webkit-overflow-scrolling:touch}
.xv-cats::-webkit-scrollbar,.xv-brands::-webkit-scrollbar{height:4px}
.xv-cat{
  flex:0 0 auto;width:78px;text-align:center;
  background:#fff;border-radius:12px;border:1px solid #eef2f7;
  padding:.55rem .35rem;box-shadow:var(--xv-shadow);
}
.xv-cat .ico{
  width:48px;height:48px;margin:0 auto .3rem;border-radius:12px;
  background:#f1f5f9;display:flex;align-items:center;justify-content:center;
  overflow:hidden;font-size:1.2rem;color:var(--brand);
}
.xv-cat .ico img{width:100%;height:100%;object-fit:contain}
.xv-cat span{font-size:.7rem;font-weight:600;display:block;line-height:1.3;max-height:2.6em;overflow:hidden}
.xv-brand-chip{
  flex:0 0 auto;display:flex;align-items:center;gap:.4rem;
  background:#fff;border:1px solid #eef2f7;border-radius:999px;
  padding:.35rem .75rem .35rem .4rem;box-shadow:var(--xv-shadow);
  font-size:.78rem;font-weight:600;
}
.xv-brand-logo{
  width:36px;height:36px;border-radius:50%;background:#f1f5f9;
  overflow:hidden;display:flex;align-items:center;justify-content:center;
}
.xv-brand-logo img{max-width:100%;max-height:100%;object-fit:contain}

.xv-cols-switch{display:none;align-items:center;gap:3px;background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:3px}
.xv-cols-switch button{
  border:0;background:transparent;width:28px;height:26px;border-radius:7px;
  color:#64748b;font-weight:700;cursor:pointer;font-size:.75rem;
}
.xv-cols-switch button.active{background:var(--brand);color:#fff}
@media(min-width:768px){.xv-cols-switch{display:flex}}

/* Special strip */
.xv-special-wrap{
  background:linear-gradient(90deg,#ecfdf5,#ccfbf1);
  border-radius:var(--xv-radius);padding:.75rem;margin-bottom:.25rem;
}

/* ========== Product grid — ستون ثابت (دیگر تک‌ردیفه/بزرگ نمی‌شود) ========== */
.xv-grid{
  display:grid;
  grid-template-columns:repeat(var(--xv-cols, 2), minmax(0, 1fr));
  gap:.6rem;
  justify-content:center;
}
@media(min-width:576px){
  .xv-grid{grid-template-columns:repeat(var(--xv-cols-md, 3), minmax(0, 1fr)); gap:.75rem}
}
@media(min-width:992px){
  .xv-grid{
    grid-template-columns:repeat(var(--xv-cols-lg, 4), minmax(0, 1fr));
    gap:1rem;
  }
}
/* وقتی تعداد محصول کم است، کارت‌ها وسط‌چین و محدود عرض بمانند */
.xv-grid > .xv-card{
  max-width:var(--xv-card-max, 240px);
  width:100%;
  margin-inline:auto;
}

/* Product card */
.xv-card{
  background:var(--xv-card);border-radius:var(--xv-radius);
  border:1px solid #eef2f7;box-shadow:var(--xv-shadow);
  overflow:hidden;display:flex;flex-direction:column;height:100%;
}
.xv-card .img-box{
  position:relative;
  aspect-ratio:1/1;
  max-height:var(--xv-img-max);
  background:#f1f5f9;
  overflow:hidden;
}
.xv-card .img-box img{
  width:100%!important;height:100%!important;
  object-fit:contain!important;padding:8px;display:block;
}
.xv-badge-off{
  position:absolute;top:8px;right:8px;z-index:2;
  background:#ef4444;color:#fff;font-size:11px;font-weight:800;
  border-radius:8px;padding:2px 7px;
}
.xv-badge-grp{
  position:absolute;top:8px;left:8px;z-index:2;
  background:#0ea5e9;color:#fff;font-size:10px;font-weight:700;
  border-radius:8px;padding:2px 6px;
}
.xv-card .body{
  padding:.65rem .7rem .75rem;
  display:flex;flex-direction:column;gap:.25rem;flex:1;
}
.xv-card .title{
  font-size:.8rem;font-weight:700;line-height:1.45;color:var(--xv-text);
  height:2.3em;overflow:hidden;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
}
.xv-card .sku{font-size:.68rem;color:var(--xv-muted)}
.xv-card .price-row{margin-top:auto;padding-top:.35rem}
.xv-card .price-old{font-size:.72rem;color:#94a3b8;text-decoration:line-through;margin-left:.25rem}
.xv-card .price-now{font-size:.92rem;font-weight:800;color:var(--brand-dark)}
.xv-card .actions{display:flex;gap:.35rem;margin-top:.45rem}
.xv-btn-cart{
  flex:1;border:none;border-radius:10px;background:var(--brand);color:#fff;
  font-size:.75rem;font-weight:700;padding:.45rem;
  display:flex;align-items:center;justify-content:center;gap:.25rem;cursor:pointer;
}
.xv-btn-cart:hover{background:var(--brand-dark)}
.xv-btn-wish{
  width:36px;border:1px solid #e2e8f0;border-radius:10px;background:#fff;color:#94a3b8;
  display:flex;align-items:center;justify-content:center;cursor:pointer;
}

.xv-sale-timer{
  display:inline-flex;align-items:center;gap:.3rem;
  background:#fff7ed;border:1px solid #fdba74;color:#c2410c;
  border-radius:8px;padding:.2rem .5rem;font-size:.72rem;font-weight:800;
  margin-top:.25rem;font-family:Vazirmatn,Tahoma,sans-serif;direction:ltr;
}
.xv-sale-timer .xv-timer{direction:ltr;unicode-bidi:isolate}
.xv-sale-timer i{font-size:.85rem}

/* Promos */
.xv-promos{display:grid;grid-template-columns:1fr;gap:.55rem}
@media(min-width:768px){.xv-promos{grid-template-columns:repeat(3,1fr)}}
.xv-promo{
  border-radius:12px;padding:.9rem 1rem;min-height:90px;
  display:flex;flex-direction:column;justify-content:center;gap:.25rem;
}
.xv-promo h4{margin:0;font-size:.9rem;font-weight:800}
.xv-promo p{margin:0;font-size:.75rem;opacity:.85}
.xv-promo a{font-size:.75rem;font-weight:700;color:inherit;text-decoration:underline}

/* Trust */
.xv-trust{
  display:grid;grid-template-columns:repeat(2,1fr);gap:.55rem;
  padding:.25rem 0 .75rem;
}
@media(min-width:768px){.xv-trust{grid-template-columns:repeat(4,1fr)}}
.xv-trust-item{
  background:#fff;border-radius:12px;border:1px solid #eef2f7;
  padding:.7rem;text-align:center;box-shadow:var(--xv-shadow);
}
.xv-trust-item i{font-size:1.25rem;color:var(--brand)}
.xv-trust-item strong{display:block;font-size:.78rem;margin-top:.25rem}
.xv-trust-item span{font-size:.68rem;color:var(--xv-muted)}

/* Newsletter */
.xv-news{
  background:#0f172a;color:#fff;border-radius:var(--xv-radius);
  padding:1.1rem 1.15rem;margin:.5rem 0 1rem;
  display:flex;flex-wrap:wrap;gap:.75rem;align-items:center;justify-content:space-between;
}
.xv-news h4{margin:0;font-size:.95rem}
.xv-news p{margin:.2rem 0 0;font-size:.78rem;opacity:.8}
.xv-news form{display:flex;gap:.35rem;flex:1;min-width:200px;max-width:340px}
.xv-news input{flex:1;border:none;border-radius:999px;padding:.5rem .9rem;font-size:.82rem}
.xv-news button{
  border:none;border-radius:999px;background:var(--brand);color:#fff;
  padding:.5rem 1rem;font-weight:700;font-size:.82rem;
}

/* Bottom nav mobile */
.xv-bottom-nav{
  display:none;position:fixed;bottom:0;left:0;right:0;z-index:200;
  background:#fff;border-top:1px solid #e2e8f0;
  padding:.4rem 0 calc(.4rem + env(safe-area-inset-bottom));
  justify-content:space-around;align-items:center;
}
.xv-bottom-nav a{
  display:flex;flex-direction:column;align-items:center;gap:2px;
  font-size:.65rem;color:#64748b;font-weight:600;padding:.2rem .5rem;
}
.xv-bottom-nav a.active,.xv-bottom-nav a:hover{color:var(--brand)}
.xv-bottom-nav i{font-size:1.15rem}
@media(max-width:767.98px){
  .xv-bottom-nav{display:flex}
  .xv-home{padding-bottom:64px}
  .xv-banner{max-height:160px}
}
@media(min-width:768px){
  .xv-banner{max-height:220px}
}
