/* ===== قفل اسکرول افقی + اسکرول داخلی جدول‌ها ===== */
html,body{overflow-x:hidden;overflow-x:clip;max-width:100%}
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
table.inv{min-width:540px}
.inv-body{overflow-x:visible}
@media(max-width:560px){
  .inv-body{padding:16px}
  .inv-head{padding:18px}
  .inv-meta{grid-template-columns:1fr 1fr}
}

/* ===== فقط یک سبد در موبایل: سبد هدر مخفی، سبد داک فعال ===== */
@media(max-width:900px){
  .site-header .cart-btn{display:none}
}

/* ===== داک خلاقانه پایین ===== */
.m-bottomnav{display:none!important}
.m-social{display:none!important}
.m-dock{display:none}
.m-soc-pop{display:none}
@media(max-width:900px){
  body{padding-bottom:104px}
  .m-dock{
    display:flex;position:fixed;bottom:calc(12px + env(safe-area-inset-bottom));left:12px;right:12px;z-index:95;
    height:66px;align-items:center;justify-content:space-between;padding:6px 8px;
    background:rgba(255,253,249,.78);
    -webkit-backdrop-filter:blur(16px) saturate(1.4);backdrop-filter:blur(16px) saturate(1.4);
    border:1px solid var(--line);border-radius:26px;
    box-shadow:0 18px 44px rgba(30,20,5,.18), inset 0 1px 0 rgba(255,255,255,.5);
  }
  html[data-theme="dark"] .m-dock{background:rgba(23,30,39,.78);box-shadow:0 18px 44px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.06)}
  .m-dock-item{
    position:relative;flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;border:none;background:none;
    font-family:inherit;font-size:10.5px;font-weight:800;color:var(--muted);padding:2px 0;cursor:pointer;
  }
  .m-dock-item i{
    font-style:normal;font-size:20px;line-height:1;padding:9px 15px;border-radius:17px;
    transition:transform .35s cubic-bezier(.3,1.6,.5,1), background .3s, box-shadow .3s;
  }
  .m-dock-item:active i{animation:dockPop .45s}
  @keyframes dockPop{0%{transform:scale(1)}45%{transform:scale(1.22) translateY(-5px)}100%{transform:scale(1)}}
  .m-dock-item.on{color:var(--brand)}
  .m-dock-item.on i{background:linear-gradient(135deg,var(--brand),var(--brand-dark));color:#fff;transform:translateY(-7px);box-shadow:0 10px 22px rgba(0,0,0,.28)}
  .m-dock-item .cart-count{top:0;left:calc(50% - 26px)}
  .m-fab{
    position:relative;flex:0 0 auto;width:62px;height:62px;border-radius:50%;
    border:5px solid var(--bg);margin:0 2px;
    background:linear-gradient(135deg,var(--brand),#c2452d);color:#fff;font-size:24px;
    display:grid;place-items:center;transform:translateY(-30px);
    box-shadow:0 16px 34px rgba(200,90,10,.45);transition:transform .25s;
  }
  .m-fab:active{transform:translateY(-30px) scale(.9)}
  .m-fab.on{box-shadow:0 16px 34px rgba(200,90,10,.45), 0 0 0 5px var(--brand-soft)}
  .m-soc-pop{
    display:flex;flex-direction:column;gap:8px;
    position:fixed;left:14px;bottom:calc(96px + env(safe-area-inset-bottom));z-index:96;
    background:var(--surface);border:1px solid var(--line);border-radius:22px;padding:10px;
    box-shadow:0 20px 50px rgba(0,0,0,.25);
    opacity:0;visibility:hidden;transform:translateY(16px) scale(.85);transform-origin:bottom left;
    transition:.32s cubic-bezier(.3,1.4,.5,1);
  }
  .m-soc-pop.show{opacity:1;visibility:visible;transform:none}
  .m-soc-pop a{width:46px;height:46px;border-radius:15px;display:grid;place-items:center;font-size:21px;background:var(--bg);transition:.2s}
  .m-soc-pop a:active{transform:scale(.88)}
  .m-soc-pop.show a{animation:socIn .4s both}
  .m-soc-pop.show a:nth-child(2){animation-delay:.05s}
  .m-soc-pop.show a:nth-child(3){animation-delay:.1s}
  .m-soc-pop.show a:nth-child(4){animation-delay:.15s}
  @keyframes socIn{from{opacity:0;transform:translateY(10px) scale(.7)}to{opacity:1;transform:none}}
  .toast{bottom:118px}
}
/*v13*/
/* ===== v13: گالری بدون اسکرول ===== */
.pd-thumbs{display:grid;grid-template-columns:repeat(auto-fill,minmax(64px,1fr));gap:8px;overflow:visible;padding:12px 2px;scroll-snap-type:none}
.pd-thumb{width:100%;height:64px;flex:none;scroll-snap-align:start}
/* ===== v13: ستاره میانگین یک ردیف ===== */
.starbox{white-space:nowrap;display:inline-block}
.starbox .fill{white-space:nowrap}
.cmt-score{min-width:110px}
/* ===== v13: تب‌های ویترین کوچک‌تر در یک ردیف ===== */
.section .tabs{display:flex;flex-wrap:nowrap;gap:6px;overflow:hidden}
.section .tab-btn{flex:1 1 0;font-size:.78rem;padding:8px 4px;white-space:nowrap}
/* ===== v14: هدر موبایل بدون جای خالی ===== */
@media(max-width:900px){
  .header-in{display:flex!important;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}
  .header-in .logo{order:1;margin:0}
  .header-in .h-actions{order:2;margin:0}
  .header-in .search{order:3;width:100%;margin:8px 0 0}
  .header-in .burger{display:none!important}
}
/* ===== v14: عکس محصول کامل + تامبنیل مربع + لایت‌باکس ===== */
.pd-img img{object-fit:contain!important;background:#fff}
.pd-thumb{width:72px;height:72px;flex:0 0 72px}
.pd-thumb img{width:100%;height:100%;object-fit:cover}
.lightbox{position:fixed;inset:0;background:rgba(0,0,0,.92);z-index:99999;display:none;align-items:center;justify-content:center;padding:14px}
.lightbox.open{display:flex}
.lightbox img{max-width:100%;max-height:100%;object-fit:contain;border-radius:12px}
.lightbox .lb-close{position:absolute;top:12px;left:12px;width:44px;height:44px;border-radius:50%;border:none;background:rgba(255,255,255,.15);color:#fff;font-size:18px;cursor:pointer}
/* ===== v14: نشان تنوع رنگ/سایز ===== */
.p-media{position:relative}
.p-vars{position:absolute;bottom:8px;right:8px;display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end;z-index:2}
.p-var{background:rgba(255,255,255,.94);color:#334155;font-size:.62rem;font-weight:800;padding:3px 9px;border-radius:50px;box-shadow:0 2px 8px rgba(0,0,0,.15)}
/* ===== v14: اخیراً دیده‌شده‌ها ===== */
.recent-row{display:flex;gap:10px;overflow-x:auto;padding-bottom:8px;-webkit-overflow-scrolling:touch}
.recent-card{flex:0 0 140px;background:var(--surface);border:1.5px solid var(--line);border-radius:16px;padding:10px;text-decoration:none;color:inherit}
.recent-card img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:12px}
.recent-card b{display:block;font-size:.75rem;margin-top:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.recent-card span{font-size:.7rem;color:var(--brand);font-weight:800}
/* ===== v19: کارت محصول — مهار قیمت داخل کادر ===== */
.p-card{overflow:hidden}
.p-body{min-width:0;overflow:hidden}
.p-title{font-size:.85rem;line-height:1.6}
.p-price{display:flex;flex-wrap:wrap;align-items:baseline;gap:3px 6px;margin-top:6px}
.p-price strong{font-size:.9rem;color:var(--brand);word-break:break-word;line-height:1.5}
.p-price del{font-size:.68rem;color:var(--muted)}
.p-price small{font-size:.6rem;color:var(--muted)}
.p-add{font-size:.72rem;padding:8px 10px}

/* ===== v19: فروشگاه — دسته‌بندی‌ها در موبایل (نوار افقی Story-like) ===== */
@media(max-width:820px){
  .cat-row,.shop-cats,.cat-chips,div:has(> .cat-item),div:has(> .scat){
    display:flex;flex-wrap:nowrap;overflow-x:auto;gap:8px;justify-content:flex-start;
    -webkit-overflow-scrolling:touch;padding:4px 2px 12px;scrollbar-width:none;
    -webkit-mask-image:linear-gradient(to left,transparent,#000 26px,#000 calc(100% - 26px),transparent);
    mask-image:linear-gradient(to left,transparent,#000 26px,#000 calc(100% - 26px),transparent);
  }
  .cat-row::-webkit-scrollbar,.shop-cats::-webkit-scrollbar,.cat-chips::-webkit-scrollbar{display:none}
  .cat-item,.scat{flex:0 0 auto;margin:0}
  .cat-item{display:flex;align-items:center;gap:6px;padding:9px 16px;border-radius:99px}
  .cat-item .cat-icon{width:30px;height:30px;font-size:.95rem;margin:0;border-radius:50%}
  .cat-item span:not(.cat-icon){font-size:.75rem;font-weight:700}
  .cat-item.on,.scat.on{border-color:var(--brand);background:var(--brand-soft);color:var(--brand-dark)}
}
/*v15*/
.p-media{position:relative}
.p-vars{position:absolute;bottom:8px;right:8px;display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end;z-index:2}
.p-var{background:rgba(255,255,255,.94);color:#334155;font-size:.62rem;font-weight:800;padding:3px 9px;border-radius:50px;box-shadow:0 2px 8px rgba(0,0,0,.15)}
.recent-row{display:flex;gap:10px;overflow-x:auto;padding-bottom:8px;-webkit-overflow-scrolling:touch}
.recent-card{flex:0 0 140px;background:var(--surface);border:1.5px solid var(--line);border-radius:16px;padding:10px;text-decoration:none;color:inherit}
.recent-card img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:12px}
.recent-card b{display:block;font-size:.75rem;margin-top:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.recent-card span{font-size:.7rem;color:var(--brand);font-weight:800}

/*reveal-fix*/
.reveal{opacity:1!important;transform:none!important;transition:none!important}
