@font-face {
  font-family: 'IRANSansX';
  font-style: normal;
  font-weight: 100;
  src: url('/static/core/fonts/woff/IRANSansXFaNum-Thin.woff') format('woff'),
       url('/static/core/fonts/woff2/IRANSansXFaNum-Thin.woff2') format('woff2');
}

@font-face {
  font-family: 'IRANSansX';
  font-style: normal;
  font-weight: 200;
  src: url('/static/core/fonts/woff/IRANSansXFaNum-UltraLight.woff') format('woff'),
       url('/static/core/fonts/woff2/IRANSansXFaNum-UltraLight.woff2') format('woff2');
}

@font-face {
  font-family: 'IRANSansX';
  font-style: normal;
  font-weight: 300;
  src: url('/static/core/fonts/woff/IRANSansXFaNum-Light.woff') format('woff'),
       url('/static/core/fonts/woff2/IRANSansXFaNum-Light.woff2') format('woff2');
}

@font-face {
  font-family: 'IRANSansX';
  font-style: normal;
  font-weight: 400;
  src: url('/static/core/fonts/woff/IRANSansXFaNum-Regular.woff') format('woff'),
       url('/static/core/fonts/woff2/IRANSansXFaNum-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'IRANSansX';
  font-style: normal;
  font-weight: 500;
  src: url('/static/core/fonts/woff/IRANSansXFaNum-Medium.woff') format('woff'),
       url('/static/core/fonts/woff2/IRANSansXFaNum-Medium.woff2') format('woff2');
}

@font-face {
  font-family: 'IRANSansX';
  font-style: normal;
  font-weight: 600;
  src: url('/static/core/fonts/woff/IRANSansXFaNum-DemiBold.woff') format('woff'),
       url('/static/core/fonts/woff2/IRANSansXFaNum-DemiBold.woff2') format('woff2');
}

@font-face {
  font-family: 'IRANSansX';
  font-style: normal;
  font-weight: 800;
  src: url('/static/core/fonts/woff/IRANSansXFaNum-ExtraBold.woff') format('woff'),
       url('/static/core/fonts/woff2/IRANSansXFaNum-ExtraBold.woff2') format('woff2');
}

@font-face {
  font-family: 'IRANSansX';
  font-style: normal;
  font-weight: 900;
  src: url('/static/core/fonts/woff/IRANSansXFaNum-Black.woff') format('woff'),
       url('/static/core/fonts/woff2/IRANSansXFaNum-Black.woff2') format('woff2');
}

@font-face {
  font-family: 'IRANSansX';
  font-style: normal;
  font-weight: 950;
  src: url('/static/core/fonts/woff/IRANSansXFaNum-ExtraBlack.woff') format('woff'),
       url('/static/core/fonts/woff2/IRANSansXFaNum-ExtraBlack.woff2') format('woff2');
}

@font-face {
  font-family: 'IRANSansX';
  font-style: normal;
  font-weight: 1000;
  src: url('/static/core/fonts/woff/IRANSansXFaNum-Heavy.woff') format('woff'),
       url('/static/core/fonts/woff2/IRANSansXFaNum-Heavy.woff2') format('woff2');
}

@font-face {
  font-family: 'IRANSansX';
  font-style: normal;
  font-weight: bold;
  src: url('/static/core/fonts/woff/IRANSansXFaNum-Bold.woff') format('woff'),
       url('/static/core/fonts/woff2/IRANSansXFaNum-Bold.woff2') format('woff2');
}



:root{
  --text: rgba(0,0,0,0.90);
  --muted: rgba(0,0,0,0.55);
  --line: rgba(0,0,0,0.06);
  --block: rgba(0,0,0,0.04);
}

*{ box-sizing: border-box; }

.x-body{
  margin:0;
  background:#fff;
  color: var(--text);
  font-family: IRANSansX, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial !important;
}
.x-header, .x-header *{
  font-family: IRANSansX, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial !important;
}

/* Header (existing, keep untouched) */
.x-header{
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: transform .22s ease;
}
.x-header.is-hidden{ transform: translateY(-110%); }

.x-header__inner{
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 14px 10px;
  display:flex;
  flex-direction: column;
  gap: 10px;
}

/* Row 1 */
.x-topbar{
  display:flex;
  align-items:center;
  gap: 10px;
  width: 100%;
  min-width: 0;
}
/* بلوک لوگو+تگ‌لاین */
.x-brand{
  display:flex;
  align-items:center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
}
/* فرم باید فضای اصلی را بگیرد */
.x-topbar__form{
  flex: 1 1 auto;
  min-width: 0;
  display:flex;
  gap: 10px;
}
.x-logo{ display:flex; align-items:center; text-decoration:none; flex: 0 0 auto; }
.x-logo__img{ width: 28px; height: 28px; object-fit: contain; display:block; }

.x-search{
  flex: 1 1 auto;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.02);
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 12px;
  outline: none;
  min-width: 0;
}
.x-select{
  flex: 0 0 120px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #fff;
  border-radius: 999px;
  padding: 10px 10px;
  font-size: 12px;
  outline: none;
}
@media (max-width: 520px){ .x-select{ flex-basis: 104px; } }

/* Row 2 tags */
.x-tagrow{ position: relative; }
.x-tagrow__scroller{
  display:flex; gap: 10px; overflow-x: auto;
  padding: 2px 30px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  
}
.x-tagrow__scroller::-webkit-scrollbar{ display:none; }

.x-tagpill{
  flex: 0 0 auto;
  text-decoration:none;
  color: rgba(0,0,0,0.78);
  display:flex;
  flex-direction: column;
  align-items:center;
  gap: 6px;
  width: 66px;
}
.x-tagpill__img{
  width: 50px; height: 50px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(0,0,0,0.03);
  display:block;
}
.x-tagpill__img--ph{ background: rgba(0,0,0,0.06); }
.x-tagpill__txt{
  font-size: 11px;
  text-align:center;
  line-height: 1.2;
  max-width: 66px;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.x-tagpill.is-active .x-tagpill__img{ border-color: rgba(0,0,0,0.22); }
.x-tagpill.is-active .x-tagpill__txt{ font-weight: 800; color: rgba(0,0,0,0.90); }

.x-tagrow__arrow{
  position:absolute;
  top: 20px;
  width: 26px; height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.92);
  color: rgba(0,0,0,0.70);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index: 2;
  line-height: 1;
}
.x-tagrow__arrow--right{ right: 0; }
.x-tagrow__arrow--left{ left: 0; }
.x-tagrow__arrow[disabled]{ opacity: .35; cursor: default; }

/* Explore main */
.x-main{
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 14px 64px;
}
.x-grid{ column-gap: 16px; }
@media (max-width: 820px){ .x-grid{ column-count: 2; } }
@media (min-width: 821px){ .x-grid{ column-width: 280px; column-count: auto; } }

.x-item{ break-inside: avoid; }
.x-item--block{
  background: var(--block);
  border-radius: 14px;
  padding: 10px;
}
.x-media{
  display:block;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(0,0,0,0.03);
  text-decoration:none;
  color: inherit;
}
.x-media__img{ width: 100%; height: auto; display:block; }
.x-media__img--ph{ height: 280px; }

.x-media__top{
  position:absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 3;
  pointer-events:none;
}
.x-infchip{
  position: relative;          /* 🔴 کلیدی */
  overflow: visible;
  display:inline-flex;
  align-items:center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(0,0,0,0.06);
  max-width: 92%;
}
.x-infchip__avatar{ width: 20px; height: 20px; border-radius: 999px; object-fit: cover; display:block; }
.x-infchip__avatar--ph{ width: 20px; height: 20px; border-radius: 999px; background: rgba(0,0,0,0.08); display:inline-block; }
.x-infchip__name{
  font-size: 12px;
  font-weight: 800;
  color: rgba(0,0,0,0.86);
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.x-itemhead{ margin-bottom: 8px; }
.x-infchiplink{ text-decoration:none; color: inherit; display:inline-block; }

.x-infchip--click{
  pointer-events: auto; /* ✅ چیپ کلیک‌پذیر */
  cursor: pointer;
  position: relative;
  max-width: 92%;
}

.x-rail{
  margin-top: 10px;
  display:flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-left: 16px;
}
.x-rail::-webkit-scrollbar{ display:none; }
.x-rail::after{ content:""; flex: 0 0 28px; }


.x-prod{ flex: 0 0 auto; width: 60px; text-decoration:none; color: inherit; }
.x-prod__img{ width: 60px; height: 60px; border-radius: 12px; object-fit: cover; background: rgba(0,0,0,0.03); display:block; }
.x-prod__img--ph{ background: rgba(0,0,0,0.06); }

/* Detail page */
.x-detailpage{
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 14px 30px;
}
.x-detaillayout{
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
/* ===============================
   Desktop: fix embed column width
   =============================== */
   @media (min-width: 980px){

    /* کنترل کل گرید */
    .x-detaillayout{
      grid-template-columns: 420px 1fr; /* قبلاً 1fr 520px یا auto بوده */
      align-items: start;
    }
  
    /* محدود کردن عرض ستون embed */
    .x-embedcol{
      max-width: 420px;
    }
  
    /* اطمینان از اینکه کارت embed بیرون نزنه */
    .x-detailcard--embed{
      max-width: 420px;
      margin: 0 auto;
    }
  
    /* خود iframe اینستاگرام */
    .x-embedcrop--detail{
      max-width: 420px;
      height: 640px; /* متناسب با عرض جدید */
    }
  }
  

.x-detailcard{
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  padding: 10px;
  overflow: hidden;
  background: #fff;
}

.x-embedcrop{
  max-width: 520px;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
  background: #fff;
}
.x-embedcrop--detail{ height: 520px; }                 /* mobile crop */
@media (min-width: 980px){ .x-embedcrop--detail{ height: 760px; } } /* desktop */

.x-embedscreen--detail{
  transform: scale(0.92);
  transform-origin: top center;
  width: 112%;
  margin-right: -6%;
  margin-left: -6%;
}

/* Shop button */
.x-shopbtn{
  display:inline-flex;
  justify-content:center;
  align-items:center;
  text-decoration:none;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.88);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  padding: 10px 12px;
}

/* Product grid */
.x-prodgrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (min-width: 980px){
  .x-prodgrid{ grid-template-columns: repeat(4, 1fr); gap: 12px; }
}
.x-prodtile{
  text-decoration:none;
  color: inherit;
  border: 1px solid rgba(0,0,0,0.06);
  background: #fff;
  border-radius: 14px;
  overflow:hidden;
}
.x-prodtile__img{
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: rgba(0,0,0,0.03);
  display:block;
}
.x-prodtile__img--ph{ background: rgba(0,0,0,0.06); }
.x-prodtile__name{
  padding: 10px 10px 12px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(0,0,0,0.72);
  line-height: 1.3;
  height: 3.9em;
  overflow:hidden;
}

/* Bottom tipbar */
.x-tipbar{
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
}
.x-tipbar.is-visible{
  opacity: 1;
  transform: translateY(0);
}
.x-tipbar__inner{
  margin: 0 auto;
  max-width: 720px;
  background: rgba(0,0,0,0.78);
  color: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  font-family: IRANSansX, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial !important;
}

/* =========================================================
   NEW: simple header (logo right, back left)
   ========================================================= */
.x-simpleheader{
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.x-simpleheader__inner{
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 14px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}
.x-backbtn{
  font-family: IRANSansX, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial !important;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.02);
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(0,0,0,0.78);
  cursor: pointer;
  text-decoration: none;
}
.x-selorabrand{
  display:flex;
  align-items:center;
  gap: 8px;
  text-decoration:none;
  color: rgba(0,0,0,0.86);
}
.x-selorabrand__img{
  width: 26px;
  height: 26px;
  object-fit: contain;
  display:block;
}

/* =========================================================
   NEW: products header (desktop: texts right, button left)
   ========================================================= */
.x-prodhead{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 12px;
}
.x-prodhead__texts{
  text-align: right;
}
.x-prodtitle{
  margin: 0;
  font-size: 14px;
  font-weight: 900;
  color: rgba(0,0,0,0.86);
}
.x-prodsubtitle{
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 800;
  color: rgba(0,0,0,0.58);
}
.x-shopbtn--head{
  width: auto;
  min-width: 140px;
  white-space: nowrap;
}
@media (max-width: 979px){
  .x-prodhead{
    flex-direction: column;
    align-items: stretch;
  }
  .x-shopbtn--head{
    width: 100%;
    padding: 12px 12px;
  }
  .x-prodhead__texts{
    text-align: center;
  }
}

/* =========================================================
   NEW: stats as TWO separate boxes
   - Mobile: stack
   - Desktop: inline
   ========================================================= */
.x-statwrap{
  margin-top: 12px;
  display:flex;
  gap: 10px;
  flex-direction: column;
}
@media (min-width: 980px){
  .x-statwrap{
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
  }
}

.x-statbox{
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(0,0,0,0.02);
  border-radius: 999px;
  padding: 10px 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: rgba(0,0,0,0.68);
  line-height: 1.55;
  width: 100%;
}
@media (min-width: 980px){
  .x-statbox{
    width: auto;
    min-width: 280px;
  }
}

.x-statnum{ font-weight: 900; color: rgba(0,0,0,0.88); }


.x-railhint{
  margin-top: 8px;
  font-size: 12px;
  font-weight: 900;
  color: rgba(0,0,0,0.78);
}
.x-railhint__muted{
  font-weight: 800;
  color: rgba(0,0,0,0.55);
}

/* Default: desktop behavior (keep current layout) */
.x-shopbtn--mobilebottom{ display: none; }

/* Mobile: button goes to bottom under stats */
@media (max-width: 979px){
  /* hide desktop header button */
  .x-shopbtn--desktop{ display: none; }

  /* show bottom button */
  .x-shopbtn--mobilebottom{
    display: inline-flex;
    width: 100%;
    margin-top: 10px;
    padding: 12px 12px;
    justify-content: center;
  }
}

/* ===============================
   Product rail arrows (overlay)
   =============================== */
   /* wrapper باید overflow hidden داشته باشه تا fade معلوم شه */
.x-railwrap{
  position: relative;
  overflow: hidden;
}

/* فلش‌ها روی محصول باشند */
.x-rail__arrow{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.75);
  color: rgba(0,0,0,0.75);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index: 20;              /* مهم: بالاتر از هر چی */
  line-height: 1;
  backdrop-filter: blur(8px);
  pointer-events: auto;     /* مهم */
}
.x-rail__arrow--right{ right: 6px; }
.x-rail__arrow--left{ left: 6px; }
.x-rail__arrow[disabled]{ opacity: .35; cursor: default; }

/* وقتی فلش‌ها هستن کمی padding بده که محصول زیر فلش نره */
.x-railwrap .x-rail{
  padding-left: 34px;
  padding-right: 34px;
}



/* کوچیک‌تر کردن فلش و fade */
.x-railwrap{
  position: relative;
  overflow: hidden;
}

/* فلش کوچیک (طبق خواسته‌ات) */
.x-rail__arrow{
  width: 20px !important;
  height: 20px !important;
  font-size: 14px !important;
  z-index: 3;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(6px);
}
.x-rail__arrow--right{ right: 4px !important; }
.x-rail__arrow--left{ left: 4px !important; }

/* تگ‌لاین: کوتاه، جمع‌وجور، بدون خراب کردن فرم */
.x-header__hint{
  font-family: IRANSansX;
  font-size: 12px;
  font-weight: 900;
  color: rgb(0,0,0);
  margin: 0;
  white-space: nowrap;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* موبایل: تگ‌لاین کوچک‌تر و جاگیر نباشد */
@media (max-width: 520px){
  .x-header__hint{
    max-width: 70px;
    font-size: 12px;
  }
}

/* =========================
   Bottom Nav v2 (panel-like)
   ========================= */
   .x-bottomnav2{
    position: fixed;
    bottom: 0;
    inset-inline: 0;
    height: 64px;
    display: flex;
    background: rgba(255,255,255,0.96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(10px);
    z-index: 120;
  }
  
  .x-bottomnav2__item{
    flex: 1;
    text-decoration: none;
    color: rgba(0,0,0,0.60);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    padding-top: 6px;
  }
  
  .x-bottomnav2__icon{
    width: 28px;
    height: 28px;
    border-radius: 12px;
    display:flex;
    align-items:center;
    justify-content:center;
  }
  
  .x-bottomnav2__icon img{
    width: 22px;
    height: 22px;
    display:block;
    color: currentColor;
  }
  
  .x-bottomnav2__txt{
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
  }
  
  .x-bottomnav2__item.is-active{
    color: rgba(0,0,0,0.92);
  }
  
  .x-bottomnav2__item.is-active::after{
    content:"";
    position:absolute;
    top: 0;
    width: 38px;
    height: 3px;
    border-radius: 999px;
    background: rgba(0,0,0,0.88);
  }
  
  /* space for nav */
  .x-main{ padding: 14px 14px 84px; }

  
/* ================================
   Explore OTP Modal (Shop-like)
================================ */

/* Backdrop */
.x-otpbackdrop{
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 10000;
  align-items: flex-end;     /* bottom sheet */
  justify-content: center;
  padding: 0;
}

/* When modal is NOT hidden */
.x-otpbackdrop:not([hidden]){
  display: flex;
}

/* Sheet */
.x-otpsheet{
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 14px 14px 16px;
  box-shadow: 0 -10px 30px rgba(0,0,0,.18);
  animation: xOtpUp .18s ease-out forwards;
  font-family: IRANSansX;
  margin: 0;
  transform: none;
}

@keyframes xOtpUp{
  from{ transform: translateY(14px); opacity: .98; }
  to{ transform: translateY(0); opacity: 1; }
}

.x-otphead{ text-align: center; padding-bottom: 8px; }
.x-otpdrag{
  width: 44px;
  height: 5px;
  border-radius: 999px;
  margin: 4px auto 10px;
  background: #e5e7eb;
}
.x-otptitle{ margin: 0; font-size: 1.05rem; font-weight: 900; }
.x-otpsubtitle{
  margin: 6px 0 0;
  font-size: .78rem;
  color: #555;
  line-height: 1.5;
}

.x-otpmsg{
  min-height: 18px;
  margin: 8px 0 10px;
  font-size: .85rem;
  text-align: center;
}
.x-otpmsg.error{ color: #c0392b; }
.x-otpmsg.ok{ color: #2e7d32; }

.x-otpstep{ margin-top: 8px; }

.x-otplabel{
  display: block;
  font-size: .85rem;
  font-weight: 800;
  margin: 8px 0 6px;
  color: #222;
}

.x-otprow{
  display: flex;
  gap: 8px;
  align-items: center;
}

.x-otpinput{
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  height: 44px;
  padding: 0 12px;
  font-size: 14px;
  line-height: 1.2;
  outline: none;
  box-sizing: border-box;
  font-family: IRANSansX;
}
.x-otpinput:focus{ border-color: rgba(0,0,0,.25); }

.x-otpcode{
  text-align: center;
  letter-spacing: 6px;
  font-weight: 900;
}

.x-otpbtn{
  border: none;
  border-radius: 12px;
  height: 44px;
  padding: 0 12px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1.2;
  font-family: IRANSansX;
  box-sizing: border-box;
}

.x-otpbtn--primary{
  background: var(--button-bg);
  color: var(--button-fg);
}

.x-otpbtn--secondary{
  background: #f3f4f6;
  color: #111;
}

.x-otptimer{
  margin-top: 8px;
  font-size: .78rem;
  color: #666;
  text-align: center;
}

.x-otpactions{
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.x-otpactions .x-otpbtn{ flex: 1; }

.x-otpstephead{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.x-otplink{
  border: none;
  background: transparent;
  color: var(--button-bg);
  font-weight: 900;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 10px;
  font-family: IRANSansX;
}

/* hide helper */
.x-otphidden{ display: none !important; }

/* safe-area bottom */
.x-otpbackdrop{
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Desktop: center sheet + rounded all corners */
@media (min-width: 768px){
  .x-otpbackdrop{ align-items: center; padding: 18px; }
  .x-otpsheet{ border-radius: 18px; }
}

   /* جلوگیری از اینکه فوتر روی کیبورد/مودال بیاد */
   .x-bottomnav2{ z-index: 120; }
   
   .x-chipbtn{
    pointer-events: auto;
    border: 0;
    background: rgba(79,70,229,0.10);
    color: #4f46e5;
    font-size: 11px;
    font-weight: 900;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
  }
  
  .x-savebtn{
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    border: 0;
    background: rgba(255,255,255,0.92);
    color: #4f46e5;
    font-size: 11px;
    font-weight: 900;
    padding: 7px 10px;
    border-radius: 999px;
    cursor: pointer;
    pointer-events: auto;
    border: 1px solid rgba(0,0,0,0.06);
  }
  .x-savebtn.is-active{
    background: #4f46e5;
    color: #fff;
    border-color: rgba(79,70,229,0.30);
  }
  

  /* =========================
   Floating action buttons (Follow / Save)
   ========================= */
.x-fabwrap{
  position:absolute;
  inset: 0;
  pointer-events: none; /* فقط خود دکمه‌ها کلیک‌پذیر باشند */
  z-index: 6;
}

.x-fab{
  pointer-events: auto;
  position: absolute;
  left: 10px;             /* چون RTL هستی، LEFT یعنی گوشه چپ */
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.92);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.10);
}

.x-fab--follow{ top: 10px; }
.x-fab--save{ bottom: 10px; }

.x-fab__icon{
  width: 22px;
  height: 22px;
  display:block;
}

/* Active states */
.x-fab.is-active{
  background: #4f46e5;
  border-color: rgba(79,70,229,0.35);
}
.x-fab.is-active .x-fab__icon{
  filter: brightness(0) invert(1);
}

/* Press feedback */
.x-fab:active{
  transform: scale(0.96);
}

/* Follow pill (+ / ✓) on image */
.x-followpill{
  position:absolute;
  top: 10px;
  left: 10px;
  z-index: 7;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.92);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  font-size: 18px;
  font-weight: 1000;
  line-height: 1;
  color: #4f46e5;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.10);
  pointer-events: auto;
}

.x-followpill.is-active{
  background: #4f46e5;
  color: #fff;
  border-color: rgba(79,70,229,0.35);
}

/* Meta row under image */
.x-cardmeta{
  margin-top: 10px;
  display:flex;
  align-items:center;
  gap: 10px;
}

/* Save icon button */
.x-saveicon{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(79,70,229,0.18);
  background: rgba(79,70,229,0.06);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  padding: 0;
}

.x-saveicon__svg{
  width: 20px;
  height: 20px;
  display:block;
}

/* outline vs filled toggle */
.x-saveicon .is-filled{ display:none; }
.x-saveicon.is-active .is-filled{ display:block; }
.x-saveicon.is-active .is-outline{ display:none; }

/* Caption one-line */
.x-cardmeta__caption{
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  color: rgba(0,0,0,0.70);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}
/* chip must be positioned for corner button */
.x-infchip{
  position: relative;
  padding-left: 28px; /* جا برای دکمه گوشه چپ داخل چیپ */
}

.x-followcorner{
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 0;
  background: #fff;
  color: #4f46e5;
  font-size: 13px;
  font-weight: 1000;
  line-height: 1;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
  z-index: 5;
}
.x-followcorner.is-active{ background:#4f46e5; color:#fff; }




/* wrapper so caption can sit outside card */
.x-itemwrap{
  break-inside: avoid;
  margin-bottom: 16px;
}

/* caption row under article, very small, one-line */
.x-captionrow{
  margin-top: 6px;
  padding: 0 6px;                 /* ✅ فاصله افقی از لبه‌ها بیشتر */
  display:flex;
  align-items:center;
  gap: 10px;                      /* ✅ فاصله بین متن و آیکن بیشتر */
  direction: rtl;
}

/* Save icon: at left end, no box */
.x-savesmall{
  flex: 0 0 auto;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-right: 0;                /* RTL: این باعث میشه به چپ تمایل پیدا کنه */
}

.x-savesmall__svg{
  width: 16px;
  height: 16px;
  display:block;
}

/* outline/filled toggle */
.x-savesmall .is-filled{ display:none; }
.x-savesmall.is-active .is-filled{ display:block; }
.x-savesmall.is-active .is-outline{ display:none; }

/* caption text starts from right and truncates */
.x-captionrow__txt{
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11px;
  font-weight: 800;
  color: rgba(0,0,0,0.60);
  text-align: right;              /* ✅ شروع از سمت راست */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;        /* ✅ ... */
}


.x-followlist{ display:flex; flex-direction:column; gap: 10px; }

.x-followcard{
  border: 1px solid rgba(0,0,0,0.06);
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}

.x-followcard__left{ display:flex; align-items:center; gap: 10px; min-width:0; }
.x-followcard__avatar{ width: 42px; height: 42px; border-radius: 999px; object-fit: cover; }
.x-followcard__avatar--ph{ background: rgba(0,0,0,0.08); display:inline-block; }
.x-followcard__meta{ min-width:0; }
.x-followcard__name{ font-size: 13px; font-weight: 900; color: rgba(0,0,0,0.86); white-space:nowrap; overflow:hidden; text-overflow: ellipsis; max-width: 240px; }
.x-followcard__sub{ font-size: 11px; font-weight: 800; color: rgba(0,0,0,0.55); margin-top: 2px; }

.x-followcard__actions{ display:flex; gap: 8px; flex: 0 0 auto; }
.x-followbtn{
  text-decoration:none;
  background: #4f46e5;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  padding: 10px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.x-followbtn--ghost{
  background: rgba(79,70,229,0.10);
  color: #4f46e5;
}
/* --- keep room for sticky footer --- */
.x-body--hasstickyfooter { padding-bottom: 84px; }

/* --- header title --- */
.x-simpleheader--detail .x-simpleheader__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.x-headtitle{
  flex:1;
  text-align:center;
  font-weight:800;
  font-size:14px;
  line-height:1.2;
  opacity:.95;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* --- shop row above embed --- */
.x-shoprow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px;
  border-bottom:1px solid rgba(0,0,0,.06);
}
.x-shoprow__left{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color:inherit;
  min-width:0;
}
.x-shopavatar{
  width:36px;
  height:36px;
  border-radius:12px;
  overflow:hidden;
  flex:0 0 36px;
  background:rgba(79,70,229,.08);
  border:1px solid rgba(79,70,229,.18);
  display:flex;
  align-items:center;
  justify-content:center;
}
.x-shopavatar img{ width:100%; height:100%; object-fit:cover; display:block; }
.x-shopavatar__ph{ width:100%; height:100%; display:block; }
.x-shopmeta{ display:flex; flex-direction:column; min-width:0; }
.x-shopname{
  font-weight:900;
  font-size:13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.x-shopsub{
  font-size:12px;
  opacity:.7;
  direction:ltr;
  text-align:right;
}

/* --- Follow button (IranSansX) --- */
.x-followbtn{
  height:36px;
  padding:0 12px;
  border-radius:12px;
  border:1px solid rgba(79,70,229,.25);
  background:#fff;
  color:#4f46e5;
  font-weight:900;
  cursor:pointer;
  white-space:nowrap;
  font-family: "IRANSansX", "IRANSans", Vazirmatn, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
.x-followbtn.is-following{
  background:#4f46e5;
  color:#fff;
  border-color:#4f46e5;
}

/* --- actions row left aligned in RTL --- */
.x-contentactions{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px 6px;
}
.x-contentactions--left{
  direction:ltr;
  justify-content:flex-start;
}

/* 1) FIX icon jump (بدون حذف border) */
.x-iconbtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  border-radius:12px;
  border:1px solid rgba(79,70,229,.25);
  background:#fff;
  cursor:pointer;
  position:relative;
  padding:0;
  line-height:0;
}

/* ===== savesmallincontent (NEW) ===== */
/* Save/Share icon wrapper */
.savesmallincontent{
  width:20px;
  height:20px;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
}
.savesmallincontent__svg{
  width:20px;
  height:20px;
  display:block;
}

/* saved swap */
.savesmallincontent__svg.is-filled{
  position:absolute;
  inset:0;
  opacity:0;
}
.js-save-toggle[data-saved="1"] .savesmallincontent__svg.is-outline{ opacity:0; }
.js-save-toggle[data-saved="1"] .savesmallincontent__svg.is-filled{ opacity:1; }



/* Caption */
.x-caption{
  padding:8px 12px 14px;
  font-size:13px;
  line-height:1.9;
  opacity:.92;
  border-top:1px solid rgba(0,0,0,.06);
}

/* 3) Caption clamp + prevent >100% width */
.x-caption{ max-width:100%; overflow:hidden; }
.x-caption__text{
  max-width:100%;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.x-caption__text.is-clamped{
  display:-webkit-box;
  -webkit-line-clamp:4;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
/* Caption "more / less" like Instagram (text, not button) */
.x-caption__more{
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin-top: 6px;

  font-family: "IRANSansX", "IRANSans", Vazirmatn, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  font-weight: 800;

  color: rgba(0,0,0,0.45);   /* کمرنگ */
  cursor: pointer;
  text-align: right;

  line-height: 1.6;
}

/* hover خیلی ظریف (دسکتاپ) */
@media (hover: hover){
  .x-caption__more:hover{
    color: rgba(0,0,0,0.65);
  }
}

/* فوکوس کیبورد – بدون قاب زشت */
.x-caption__more:focus{
  outline: none;
}

/* حالت active خیلی نرم */
.x-caption__more:active{
  opacity: 0.7;
}

/* Sticky footer */
.x-stickyfooter{
  position:fixed;
  left:0; right:0; bottom:0;
  z-index:50;
  padding:10px 12px;
  background:rgba(255,255,255,.92);
  backdrop-filter:saturate(1.2) blur(10px);
  border-top:1px solid rgba(0,0,0,.08);
}
.x-shopbtn--sticky{
  width:100%;
  display:flex;
  justify-content:center;
  align-items:center;
  height:48px;
  border-radius:14px;
  font-weight:800;
}

@media (min-width: 992px){
  .x-body--hasstickyfooter { padding-bottom: 0; }
  .x-stickyfooter{ display:none; }
}


/* =========================
   Content detail overrides
   ========================= */
   .x-body--detail .x-detailiconbtn{
    position: static !important;   /* مهم: جلوی absolute شدن */
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
  
    display: inline-flex;
    align-items: center;
    justify-content: center;
  
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(79,70,229,.25);
    background:rgba(0, 0, 0, 0.02);
    cursor: pointer;
    padding: 0;
    line-height: 0;
  }
  
  /* مطمئن شو action row به هم نریزه */
  .x-body--detail .x-contentactions{
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px 12px 6px;
  }
  .x-body--detail .x-contentactions--left{
    direction:ltr;
    justify-content:flex-start;
  }
  
  /* savesmallincontent: در جای درست، بدون جهش */
  .x-body--detail .savesmallincontent{
    width:20px;
    height:20px;
    display:flex;
    align-items:center;
    justify-content:center;
    position:relative;
  }
  .x-body--detail .savesmallincontent__svg{
    width:20px;
    height:20px;
    display:block;
  }
  .x-body--detail .savesmallincontent__svg.is-filled{
    position:absolute;
    inset:0;
    opacity:0;
  }
  .x-body--detail .js-save-toggle[data-saved="1"] .savesmallincontent__svg.is-outline{ opacity:0; }
  .x-body--detail .js-save-toggle[data-saved="1"] .savesmallincontent__svg.is-filled{ opacity:1; }
  
  /* کپشن: هیچ‌وقت از عرض صفحه نزنه بیرون */
  .x-body--detail .x-caption,
  .x-body--detail .x-caption__text{
    max-width:100%;
    overflow:hidden;
  }
  .x-body--detail .x-caption__text{
    overflow-wrap:anywhere;
    word-break:break-word;
  }
  

  .x-body--detail .x-followbtn--detail{
    height:36px;
    padding:0 12px;
    border-radius:12px;
    border:1px solid rgba(79,70,229,.25);
    background:rgba(0,0,0,0.02);
    color:#4f46e5;
    font-weight:900;
    cursor:pointer;
    white-space:nowrap;
    font-family: IRANSansX, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial !important;
  }
  .x-body--detail .x-followbtn--detail.is-following{
    background:#4f46e5;
    color:#fff;
    border-color:#4f46e5;
  }
  

  /* ================================
   Header v2 (Explore) - NEW
   ================================ */

.x-topbar--v2{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  min-width:0;
}

.x-topbar--v2 .x-topbar__right{
  display:flex;
  align-items:center;
  gap:10px;
  flex:0 0 auto;
}

.x-topbar--v2 .x-topbar__center{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  align-items:center;
}

.x-topbar--v2 .x-topbar__left{
  flex:0 0 auto;
  display:flex;
  align-items:center;
}

/* دکمه‌های آیکنی مخصوص هدر (با x-iconbtn تداخل نداشته باشد) */
.x-hiconbtn{
  width:38px;
  height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(0,0,0,0.06);
  background: rgba(0,0,0,0.02);
  border-radius:12px;
  cursor:pointer;
  padding:0;
  line-height:0;
}

.x-hiconbtn:active{ transform: scale(0.98); }

.x-hico{
  width:20px;
  height:20px;
  display:block;
}

/* متن وسط هدر باید بیشترین فضا را بگیرد */
.x-header__hint--v2{
  max-width:none !important;         /* overrideِ max-width قبلی */
  font-size:15px !important;
  font-weight:900 !important;
  color: rgba(0,0,0,0.80) !important;
  margin:0 !important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Search reveal row */
.x-searchbar{
  padding: 0 0 6px 0;
}

.x-searchbar[hidden]{ display:none !important; }

.x-searchbar__form{
  display:flex;
  gap:10px;
  align-items:center;
  width:100%;
}

.x-searchbar__input{
  flex:1 1 auto;
  min-width:0;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.02);
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 12px;
  outline: none;
}

/* Drawer overlay */
.x-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 999;
}
.x-overlay[hidden]{ display:none !important; }

/* Drawer */
.x-drawer{
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(360px, 90vw);
  background: #fff;
  transform: translateX(100%);
  transition: transform .22s ease;
  z-index: 1000;
  display:flex;
  flex-direction: column;
  box-shadow: -18px 0 40px rgba(0,0,0,0.12);
}
.x-drawer.is-open{ transform: translateX(0); }

.x-drawer__head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 10px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.x-drawer__title{
  font-weight: 900;
  font-size: 13px;
  color: rgba(0,0,0,0.85);
}

.x-drawer__close{
  width:38px;
  height:38px;
  border:1px solid rgba(0,0,0,0.06);
  background: rgba(0,0,0,0.02);
  border-radius:12px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
  line-height:0;
}


.x-catgrid{
  padding: 12px 14px 18px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
  overflow: auto;
}
/* ✅ Drawer account actions move to TOP */
.x-drawer__account--top{
  margin-top: 0 !important;              /* قبلاً auto بود */
  flex: 0 0 auto;
  padding: 12px 14px;
  border-top: 0 !important;
  border-bottom: 1px solid rgba(0,0,0,.08);
  background: #fff;
}


.x-cat{
  text-decoration:none;
  color:inherit;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  padding: 8px 6px;
  border-radius: 14px;
}

.x-cat:active{ transform: scale(.99); }

.x-cat__img{
  width:56px;
  height:56px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(0,0,0,0.10);
  background:#f5f5f5;
  display:block;
}

.x-cat__img--ph{
  border: 1px dashed rgba(0,0,0,0.18);
  background:#fafafa;
}

.x-cat__txt{
  font-size: 12px;
  font-weight: 900;
  text-align:center;
  line-height:1.25;
  max-width: 140px;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.x-cat__img--all{
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(79,70,229,0.08);
  border:1px solid rgba(79,70,229,0.25);
  color:#4f46e5;
}
.x-cat__img--all svg{
  width:26px;
  height:26px;
}

/* =========================
   Drawer head v2 (actions in header)
   ========================= */

   .x-drawer__head{
    padding: 12px 14px 10px 14px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    display:flex;
    flex-direction: row-reverse;
    gap: 10px;
  }
  
  .x-drawer__headrow{
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap: 10px;
  }
  
  /* actions container (login/logout) */
  .x-drawer__headactions{
    display:flex;
    align-items:center;
    gap: 10px;
    min-width: 0;
  }
  
  .x-drawer__usermini{
    font-size: 12px;
    font-weight: 900;
    color: rgba(0,0,0,0.70);
    direction: ltr;             /* برای شماره */
    text-align: right;
    max-width: 170px;
    overflow:hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  /* mini buttons in header */
  .x-drawer__btnmini{
    border: 1px solid rgba(0,0,0,0.08);
    background: rgba(0,0,0,0.02);
    color: rgba(0,0,0,0.78);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
    font-family: IRANSansX, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial !important;
  }
  
  .x-drawer__btnmini:active{ transform: scale(0.98); }
  
  .x-drawer__btnmini--danger{
    background: #e53935;
    border-color: #e53935;
    color: #fff;
  }
  
  /* logout form inline */
  .x-drawer__logoutform--inline{
    margin: 0;
  }
  
  /* title under actions row */
  .x-drawer__title--sub{
    font-size: 13px;
    font-weight: 1000;
    color: rgba(0,0,0,0.85);
  }
  
  /* =========================
     Drawer layout: grid scroll
     ========================= */
  .x-drawer{
    display:flex;
    flex-direction:column;
  }
  
  .x-catgrid{
    flex: 1 1 auto;
    overflow: auto;
    align-content: start;
    padding: 12px 14px 18px 14px; /* مطمئن شو همون پدینگ خوبه */
  }
  
  /* ✅ چون اکانت پایین حذف شد، اگر قبلاً اینو داشتی، دیگه لازم نیست */
  .x-drawer__account{ display:none !important; }
  

/* =========================
   Base Button (x-btn)
   ========================= */
   .x-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
  
    border: 0;  
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 900;
  
    cursor: pointer;
    white-space: nowrap;
  
    background: #4f46e5;
    color: #fff;
  
    font-family: IRANSansX, ui-sans-serif, system-ui, -apple-system,
                 Segoe UI, Roboto, Helvetica, Arial !important;
  
    transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
    text-decoration:none;
    border-radius: 100px;
  }
  
  .x-btn:active{
    transform: scale(0.98);
  }
  
  .x-btn:disabled{
    opacity: .5;
    cursor: default;
  }

  /* =========================
   Header search submit
   ========================= */
.x-searchbar__submit{
  height: 40px;               /* هماهنگ با input */
  padding: 0 16px;

  font-size: 12px;
  font-weight: 900;

  border-radius: 999px;
}

/* infinite loader */
.x-infinite{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding: 18px 0 6px;
  color: rgba(0,0,0,0.55);
  font-size: 12px;
  font-weight: 800;
}
.x-infinite__spinner{
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,0.10);
  border-top-color: rgba(79,70,229,0.70);
  display:none;
  animation: xspin .8s linear infinite;
}
.x-infinite.is-loading .x-infinite__spinner{ display:block; }

@keyframes xspin { to { transform: rotate(360deg); } }


/* Influencer header follow button */
.x-simpleheader .x-followbtn--detail{
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
}

/* --- header detail v2: logo+title right, back left --- */
.x-simpleheader__inner--detail2{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

/* right group: logo + title */
.x-headright{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;      /* خیلی مهم برای ellipsis */
  flex:1 1 auto;
}

/* title sticks to logo (no center) */
.x-headtitle--right{
  flex: 1 1 auto;
  min-width:0;

  text-align:right;
  font-weight:900;
  font-size:14px;
  line-height:1.2;
  opacity:.95;

  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.x-simpleheader__inner--infl{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

/* make hint behave like a title and truncate nicely */
.x-header__hint--infl{
  margin:0;
  max-width:none;          /* override old max-width */
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* keep follow button on the left in RTL */
.x-simpleheader__inner--infl .x-followbtn{
  flex:0 0 auto;
  margin-inline-start:auto; /* در RTL => میره تهِ چپ */
}

/* ensure back button stays on the left in RTL */
.x-simpleheader__inner--detail2 .x-backbtn{
  flex: 0 0 auto;
  margin-inline-start: auto; /* در RTL => هل میده میره سمت چپ */
}


/* =========================================
   Following page (scoped) - FIXES
   ========================================= */

/* header compact (no back button) */
.x-body--following .x-simpleheader__inner--compact{
  justify-content: flex-start;
  gap: 10px;
}

.x-body--following .x-simpleheader__titleblock{
  display:flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  min-width: 0;
}

.x-body--following .x-simpleheader__title{
  font-weight: 900;
  font-size: 13px;
  color: rgba(0,0,0,0.86);
}

.x-body--following .x-simpleheader__subtitle{
  font-weight: 800;
  font-size: 11px;
  color: rgba(0,0,0,0.55);
}

/* --- FIX actions layout (desktop + mobile) --- */
.x-body--following .x-followcard{
  align-items: center;
}

.x-body--following .x-followcard__actions{
  display:flex;
  align-items:center;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

/* ⚠️ چون .x-followbtn چند بار تو CSS شما override میشه،
   اینجا برای صفحه following دوباره دقیق استایل می‌دیم */
.x-body--following .x-followbtn{
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;

  height: 36px;
  padding: 0 12px;
  border-radius: 999px;

  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;

  border: 1px solid rgba(79,70,229,0.25);
  font-family: IRANSansX, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial !important;
}

.x-body--following .x-followbtn--primary{
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}

.x-body--following .x-followbtn--ghost{
  background: rgba(79,70,229,0.10);
  color: #4f46e5;
}

/* Mobile: buttons stack and become full width */
@media (max-width: 520px){
  .x-body--following .x-followcard{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .x-body--following .x-followcard__left{
    justify-content: flex-start;
  }

  .x-body--following .x-followcard__actions{
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .x-body--following .x-followbtn{
    width: 100%;
  }

  .x-body--following .x-followcard__name{
    max-width: 100%;
  }
}

/* --- Empty state nicer --- */
.x-body--following .x-emptystate--boxed{
  margin-top: 12px;
  border: 1px dashed rgba(0,0,0,0.18);
  background: rgba(0,0,0,0.02);
  border-radius: 18px;
  padding: 18px 14px;
  text-align: center;
}

.x-body--following .x-emptystate__icon{
  font-size: 26px;
  margin-bottom: 8px;
}

.x-body--following .x-emptystate__title{
  margin: 0;
  font-size: 14px;
  font-weight: 1000;
  color: rgba(0,0,0,0.85);
}

.x-body--following .x-emptystate__desc{
  margin: 8px 0 14px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(0,0,0,0.58);
  line-height: 1.7;
}

/* =========================================
   Following page - HARD OVERRIDE (FINAL)
   - info block on RIGHT
   - buttons block on LEFT (left-aligned)
   - always same ROW
   ========================================= */

   .x-body--following .x-followcard{
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
  
    direction: rtl !important;               /* ✅ تضمین RTL داخل کارت */
    justify-content: flex-start !important;  /* چیدمان از راست شروع شود */
  }
  
  /* بلاک اطلاعات: راست کارت */
  .x-body--following .x-followcard__left{
    display:flex !important;
    align-items:center !important;
    gap: 10px !important;
  
    flex: 1 1 auto !important;
    min-width: 0 !important;
  
    justify-content: flex-start !important;  /* داخل بلاک، آیتم‌ها طبیعی */
    text-align: right !important;
  }
  
  .x-body--following .x-followcard__meta{
    min-width: 0 !important;
    text-align: right !important;
  }
  
  .x-body--following .x-followcard__name{
    text-align: right !important;
    max-width: 100% !important;
  }
  
  /* بلاک دکمه‌ها: هل بده به چپ + چپ‌چین واقعی */
  .x-body--following .x-followcard__actions{
    display:flex !important;
    align-items:center !important;
    gap: 8px !important;
  
    flex: 0 0 auto !important;
    margin-inline-start: auto !important;    /* ✅ در RTL => می‌ره تهِ چپ */
  
    direction: ltr !important;               /* ✅ دکمه‌ها چپ‌چین و مرتب */
    justify-content: flex-start !important;
    text-align: left !important;
  
    flex-wrap: nowrap !important;            /* ✅ همیشه یک ردیف */
  }
  
  /* دکمه‌ها */
  .x-body--following .x-followbtn{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
  
    height: 36px !important;
    padding: 0 12px !important;
    border-radius: 999px !important;
  
    white-space: nowrap !important;
  }
  
  /* ❌ خنثی کردن قانون قبلی موبایل که column می‌کرد */
  @media (max-width: 520px){
    .x-body--following .x-followcard{
      flex-direction: row !important;        /* ✅ نه ستونی */
      align-items: center !important;
    }
    .x-body--following .x-followcard__actions{
      width: auto !important;
      flex-direction: row !important;        /* ✅ نه ستونی */
      align-items: center !important;
    }
    .x-body--following .x-followbtn{
      width: auto !important;                /* ✅ نه تمام‌عرض */
    }
  }
  
  /* =========================================
   SAVED PAGE (Scoped) – FINAL
   ========================================= */

/* --- Header (no back button) --- */
.x-body--saved .x-simpleheader__inner--saved{
  justify-content: flex-start;
  gap: 10px;
}

.x-body--saved .x-simpleheader__titleblock{
  display:flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  min-width: 0;
}

.x-body--saved .x-simpleheader__title{
  font-weight: 900;
  font-size: 13px;
  color: rgba(0,0,0,0.86);
}

.x-body--saved .x-simpleheader__subtitle{
  font-weight: 800;
  font-size: 11px;
  color: rgba(0,0,0,0.55);
}

/* --- Empty state boxed --- */
.x-body--saved .x-emptystate--boxed{
  margin-top: 12px;
  border: 1px dashed rgba(0,0,0,0.18);
  background: rgba(0,0,0,0.02);
  border-radius: 18px;
  padding: 18px 14px;
  text-align: center;
}

.x-body--saved .x-emptystate__icon{
  font-size: 26px;
  margin-bottom: 8px;
}

.x-body--saved .x-emptystate__title{
  margin: 0;
  font-size: 14px;
  font-weight: 1000;
  color: rgba(0,0,0,0.85);
}

.x-body--saved .x-emptystate__desc{
  margin: 8px 0 14px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(0,0,0,0.58);
  line-height: 1.7;
}

.x-drawer{
  display:flex;
  flex-direction:column;
}

/* Head همون بالا بمونه */
.x-drawer__head{
  flex: 0 0 auto;
}

.x-catgrid{
  flex: 1 1 auto;
  overflow: auto;
  /* این دو تا مهمن که grid فشرده بمونه و کش نیاد */
  align-content: start;
}

.x-drawer__account{
  margin-top: auto;
  flex: 0 0 auto;
  padding: 12px;
  border-top: 1px solid rgba(0,0,0,.08);
}

.x-drawer__user{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
  font-size:13px;
}

.x-drawer__userphone{
  direction:ltr; /* چون شماره */
  font-weight:600;
}

.x-drawer__btn{
  width:100%;
  border:0;
  border-radius:12px;
  padding:10px 12px;
  cursor:pointer;
  font-family: IRANSansX;
}

.x-drawer__btn--danger{
  color:#fff;
  background:#e53935;
}

/* ===============================
   Embed source-specific behavior
   - Instagram: keep crop/scale (existing)
   - Aparat/Upload: no scale, fit iframe/video
   =============================== */

/* Aparat: remove instagram-style zoom/crop */
.x-embedcrop--aparat,
.x-embedcrop--upload{
  background: #000;                 /* بهتر برای ویدیو */
}

/* برای آپارات و آپلود، screen نباید scale بشه */
.x-embedscreen--aparat,
.x-embedscreen--upload{
  transform: none !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
}

/* iframe آپارات باید کل باکس رو پر کنه */
.x-embedscreen--aparat iframe{
  width: 100% !important;
  height: 100% !important;
  display: block;
  border: 0;
}

/* ویدیو آپلودی هم همینطور */
.x-embedscreen--upload video{
  width: 100% !important;
  height: 100% !important;
  display: block;
  border: 0;
  object-fit: contain;              /* مهم: کراپ نشه */
  background: #000;
}

/* ✅ نسبت تصویر بهتر برای Aparat (چون خیلی هاش 16:9 هستن)
   روی موبایل و دسکتاپ ارتفاع رو کمی کم/منطقی کن تا کش نیاد */
.x-embedcrop--detail.x-embedcrop--aparat{
  height: auto !important;
  aspect-ratio: 16 / 9;
}

/* اگر آپلودها هم عمدتاً 16:9 هستن، این رو هم فعال کن */
.x-embedcrop--detail.x-embedcrop--upload{
  height: auto !important;
  max-height: 70vh;
}

/* ولی اینستاگرام همون قدیمی بمونه (ریلز عمودی) */
.x-embedcrop--detail.x-embedcrop--instagram{
  height: 520px; /* همون چیزی که داری */
}
@media (min-width: 980px){
  .x-embedcrop--detail.x-embedcrop--instagram{
    height: 760px; /* همون چیزی که داری */
  }
}

/* ===============================
   Upload video: NEVER crop
   =============================== */

/* باکس ویدیو آپلودی: ارتفاع ثابت detail را خنثی کن */

.x-embedscreen--upload .x-video--upload{
  width:100% !important;
  height:auto !important;
  max-height:70vh;
  object-fit: contain !important;
}

.x-media__wrap{
  display:block;
  width:100%;
  position:relative;
  overflow:hidden;
  border-radius:14px;
}

.x-media__img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transition:opacity .25s ease;
}

.x-imageviewer {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.x-imageviewer__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ───────── Add to Home Screen Mini Prompt ───────── */

.x-a2hsbackdrop[hidden] {
  display: none !important;
}

.x-a2hsbackdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  background: rgba(15, 23, 42, 0.32);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  pointer-events: auto;
}

.x-a2hssheet {
  position: relative;
  z-index: 2147483647;
  width: min(100%, 360px);
  background: #ffffff;
  border-radius: 22px;
  padding: 16px 14px 12px;
  box-shadow: 0 -12px 34px rgba(15, 23, 42, 0.18);
  direction: rtl;
  pointer-events: auto;
  animation: xA2hsMiniUp 0.22s ease-out;
}

@keyframes xA2hsMiniUp {
  from {
    transform: translateY(18px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.x-a2hsclose {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  pointer-events: auto;
  touch-action: manipulation;
}

.x-a2hsminihead {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-left: 34px;
}

.x-a2hslogo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  object-fit: contain;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  padding: 5px;
  flex: 0 0 auto;
}

.x-a2hstitle {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 900;
  color: #111827;
}

.x-a2hssubtitle {
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
  color: #64748b;
}

.x-a2hshint {
  margin-top: 12px;
  padding: 9px 10px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  color: #475569;
  font-size: 12px;
  line-height: 1.8;
}

.x-a2hsactions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 8px;
  margin-top: 12px;
}

.x-a2hsprimary,
.x-a2hssecondary {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.x-a2hsprimary {
  border-radius: 14px;
  padding: 10px 12px;
  background: #111827;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.x-a2hssecondary {
  border-radius: 14px;
  padding: 10px 12px;
  background: #f1f5f9;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}



@media (min-width: 769px) {
  .x-a2hsbackdrop {
    display: none !important;
  }
}