/* ==========================================================================
   مریوان کالا — استایل‌های تکمیلی نسخه پویا (روی style.css قالب)
   ========================================================================== */
[hidden] { display: none !important; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 300; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 700; transition: top .2s; }
.skip-link:focus { top: 12px; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.cur { font-size: .78em; font-weight: 500; color: var(--muted); }
.flash-wrap { display: grid; gap: 8px; padding-top: 16px; }
.note--red { background: var(--red-50); color: var(--red-deep); }
.badge-inline { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding-inline: 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 800; margin-inline-start: 4px; }
.page > .hero { padding-top: 0; }
.chip--blue { background: var(--blue-50); color: var(--blue); box-shadow: none; }
.is-busy { opacity: .6; pointer-events: none; }
.is-disabled { opacity: .45; cursor: not-allowed; }
.is-disabled:hover { border-color: var(--line); }
mark { background: #FFE9A8; color: inherit; border-radius: 3px; padding-inline: 1px; }

/* ---------- مودال ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; }
.modal__bg { position: absolute; inset: 0; background: rgba(18, 22, 31, .5); backdrop-filter: blur(3px); animation: fade .2s; }
.modal__box { position: relative; width: min(640px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--pop); padding: 22px; animation: pop .25s var(--ease); }
.modal__box h2 { margin: 0 0 16px; font-size: 18px; font-weight: 800; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ---------- وبلاگ ---------- */
.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.post-card { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 0 var(--line); transition: box-shadow .25s, transform .25s var(--ease); }
.post-card:hover { box-shadow: var(--lift); transform: translateY(-2px); }
.post-card__img { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--well); }
.post-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.post-card:hover .post-card__img img { transform: scale(1.04); }
.post-card__body { display: grid; gap: 8px; padding: 16px 18px 18px; align-content: start; flex: 1; }
.post-card__body .chip { justify-self: start; height: 24px; font-size: 12px; }
.post-card h3 { margin: 0; font-size: 16px; line-height: 1.7; font-weight: 800; text-wrap: balance; }
.post-card h3 a:hover { color: var(--blue); }
.post-card p { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.post-card .muted { font-size: 12.5px; margin-top: auto; }

.article { max-width: 820px; margin-inline: auto; }
.article__head { display: grid; gap: 10px; margin-bottom: 18px; }
.article__head .chip { justify-self: start; }
.article__head h1 { margin: 0; font-size: clamp(24px, 3.4vw, 34px); line-height: 1.5; font-weight: 900; text-wrap: balance; }
.article__head .muted { font-size: 13px; }
.article__cover { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: var(--r-lg); margin-bottom: 22px; }
.article__body { font-size: 16px; line-height: 2.1; }
.article__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.page-body { max-width: 860px; }
.prose img { border-radius: var(--r-md); height: auto; }
.prose table { width: 100%; border-collapse: collapse; margin-block: 14px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: right; }
.prose th { background: var(--well); }
.prose blockquote { margin: 16px 0; padding: 12px 18px; border-inline-start: 4px solid var(--blue); background: var(--blue-50); border-radius: 0 var(--r-sm) var(--r-sm) 0; }

/* ---------- برندها ---------- */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.brand-card { display: grid; justify-items: center; gap: 8px; padding: 22px 14px 16px; background: var(--surface); border-radius: var(--r-lg); box-shadow: 0 1px 0 var(--line); text-align: center; transition: box-shadow .25s, transform .25s var(--ease); }
.brand-card:hover { box-shadow: var(--lift); transform: translateY(-2px); }
.brand-card__logo { width: 92px; height: 60px; display: grid; place-items: center; font-size: 18px; font-weight: 900; color: #9AA1AD; direction: ltr; }
.brand-card__logo img { max-height: 60px; width: auto; object-fit: contain; }
.brand-card b { font-size: 15px; }
.brand-card span:not(.brand-card__logo) { font-size: 12.5px; color: var(--muted); }
.brands img { max-height: 46px; width: auto; max-width: 80%; object-fit: contain; filter: grayscale(1); opacity: .7; transition: filter .2s, opacity .2s; }
.brands a:hover img { filter: none; opacity: 1; }

/* ---------- فروشگاه ---------- */
.toolbar__sort a { display: inline-flex; align-items: center; height: 34px; padding-inline: 12px; border-radius: 9px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.toolbar__sort a:hover { color: var(--ink); }
.toolbar__sort a[aria-pressed="true"] { background: var(--ink); color: #fff; }
.active-filters a { display: inline-flex; align-items: center; gap: 6px; }
.active-filters a .i { width: 14px; height: 14px; }
a.soldout { display: block; text-align: center; color: var(--muted); font-weight: 700; font-size: 13px; padding: 9px; border-radius: 10px; background: var(--well); }
a.soldout:hover { color: var(--blue); background: var(--blue-50); }
.local-note { display: inline-block; margin-inline-start: 6px; padding: 0 8px; border-radius: 99px; background: var(--amber-50); color: var(--amber); font-size: 11.5px; font-weight: 700; }

/* ---------- صفحه محصول ---------- */
.gallery__off { position: absolute; top: 16px; inset-inline-start: 16px; z-index: 2; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span { display: block; width: 38px; height: 38px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); outline: 2px solid transparent; outline-offset: 3px; transition: outline-color .2s; }
.swatch em { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.swatch input:checked + span { outline-color: var(--ink); }
.swatch input:focus-visible + span { outline-color: var(--blue); }
.swatch.is-out { cursor: not-allowed; opacity: .4; }
.swatch.is-out span::after { content: ""; position: absolute; inset: 50% 4px auto; height: 2px; background: var(--red); transform: rotate(-45deg); }
.stock-alert { display: grid; gap: 10px; padding: 16px; border-radius: var(--r-md); background: var(--amber-50); }
.stock-alert p { margin: 0; color: #7A4A04; font-size: 13.5px; }
.review__reply { margin-top: 10px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--blue-50); color: var(--blue-ink); font-size: 13.5px; }

/* ---------- سبد و سفارش ---------- */
.coupon-on { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--green-50); color: #075E42; font-size: 13.5px; }
.coupon-on span { display: inline-flex; align-items: center; gap: 6px; }
.coupon-on button { color: var(--red); font-weight: 700; font-size: 13px; }
.od-prod { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.od-prod img { width: 52px; height: 52px; object-fit: contain; border-radius: 10px; background: var(--well); flex-shrink: 0; }
.od-prod a { font-weight: 700; }
.od-prod a:hover { color: var(--blue); }
.od-prod small { display: block; color: var(--muted); font-size: 12px; }
.od-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.od-addr { font-style: normal; line-height: 2; color: var(--ink-2); font-size: 14px; padding: 14px 16px; border-radius: var(--r-md); background: var(--well); }
.od-sum { display: grid; gap: 4px; }
.done--failed .done__icon { background: var(--red-50); color: var(--red); }
.done--failed .done__icon::before { border-color: var(--red-50); }
.hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.hist li { position: relative; display: grid; gap: 2px; padding: 0 22px 16px 0; font-size: 14px; border-inline-start: 0; }
.hist li::before { content: ""; position: absolute; right: 4px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.hist li::after { content: ""; position: absolute; right: 8px; top: 20px; bottom: 0; width: 1px; background: var(--line-2); }
.hist li:last-child::after { display: none; }
.hist .muted { font-size: 12.5px; }

/* ---------- حساب کاربری ---------- */
.notifs { list-style: none; margin: 0; padding: 0; display: grid; }
.notifs li { display: flex; gap: 14px; padding: 16px 4px; border-bottom: 1px solid var(--line); }
.notifs li:last-child { border-bottom: 0; }
.notifs li > div { min-width: 0; flex: 1; }
.notifs p { margin: 2px 0 4px; color: var(--ink-2); font-size: 13.5px; }
.notifs li > div > span, .notifs .muted { font-size: 12px; color: var(--muted); }
.notifs__icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--well); color: var(--muted); flex-shrink: 0; }
.notifs li.is-new .notifs__icon { background: var(--blue-50); color: var(--blue); }
.notifs li.is-new b::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-inline-start: 8px; vertical-align: middle; }
.chat { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.chat li { max-width: 78%; padding: 12px 16px; border-radius: 16px; font-size: 14px; }
.chat li b { display: block; font-size: 12.5px; margin-bottom: 4px; }
.chat li p { margin: 0; line-height: 1.9; }
.chat li span { display: block; margin-top: 6px; font-size: 11.5px; opacity: .7; }
.chat .is-me { justify-self: start; background: var(--ink); color: #fff; border-start-start-radius: 4px; }
.chat .is-staff { justify-self: end; background: var(--well); border-start-end-radius: 4px; }

/* ---------- ریسپانسیو ---------- */
@media (max-width: 1024px) {
  .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .posts { grid-template-columns: minmax(0, 1fr); }
  .od-grid { grid-template-columns: minmax(0, 1fr); }
  .brand-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat li { max-width: 92%; }
  .modal { place-items: end center; padding: 0; }
  .modal__box { border-radius: var(--r-lg) var(--r-lg) 0 0; width: 100%; padding-bottom: max(22px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- کد تأیید ۵ رقمی: جلوگیری از بیرون‌زدن خانه‌ها ---------- */
.otp { grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; }
.otp input { min-width: 0; width: 100%; padding: 0; box-sizing: border-box; font-family: inherit; color: var(--ink); }
.auth__form { min-width: 0; }

/* ==========================================================================
   طراحی موبایل (نسخه ۲) — ظاهر اپلیکیشنی
   ========================================================================== */
.mchips { display: none; }
@media (max-width: 820px) {
  /* نوار بالا: متن پیشنهاد هم دیده شود */
  .utility .wrap { min-height: 32px; justify-content: center; }
  .utility p { min-width: 0; font-size: 11.5px; }
  .utility p span { display: block !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .utility { background: linear-gradient(90deg, #12161F, #1E4FC2 140%); }

  /* هدر */
  .header { box-shadow: 0 6px 24px -14px rgba(18, 22, 31, .25); border-radius: 0 0 22px 22px; }
  .header__main { padding-block: 8px 10px; }
  .hbtn.burger { background: var(--well); border-radius: 14px; }
  .hbtn--cart { width: 46px; height: 46px; padding: 0; justify-content: center; border-radius: 15px; box-shadow: 0 8px 18px -8px rgba(18, 22, 31, .55); }
  .hbtn--cart .badge { top: -5px; left: -5px; box-shadow: 0 0 0 2px var(--surface); }
  .search__bar { height: 48px; border-radius: 16px; background: var(--well); box-shadow: none; border-color: transparent; }
  .search__bar:focus-within { background: var(--surface); border-color: var(--blue); }

  /* دسترسی سریع (چیپ‌های افقی) */
  .mchips { display: block; padding: 0 0 12px; }
  .mchips__row { display: flex; gap: 8px; overflow-x: auto; padding-inline: var(--gr, 16px) var(--gl, 16px); scroll-snap-type: x proximity; scrollbar-width: none; }
  .mchips__row::-webkit-scrollbar { display: none; }
  .mchip { flex: none; scroll-snap-align: start; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding-inline: 12px 14px; border-radius: 99px; background: var(--well); color: var(--ink-2); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
  .mchip .i { width: 16px; height: 16px; color: var(--blue); }
  .mchip img { width: 24px; height: 24px; border-radius: 50%; object-fit: contain; background: #fff; mix-blend-mode: multiply; }
  .mchip--hot { background: var(--red-50); color: var(--red-deep); }
  .mchip--hot .i { color: var(--red); }

  /* اسلایدر: کارت فشرده افقی به‌جای تصویر تمام‌صفحه */
  .hero { padding-top: 12px; }
  .slider { border-radius: 24px; background: var(--tint, #E9EEF6); }
  .slide { grid-template-columns: minmax(0, 1fr) 42%; align-items: center; gap: 8px; padding: 22px 18px 42px; background: radial-gradient(120% 90% at 0% 0%, rgba(255, 255, 255, .85), transparent 60%), var(--tint, #E9EEF6); }
  .slide__media { order: 0; }
  .slide__media::before { width: 96%; }
  .slide__media { height: auto; }
  .slide__media img { width: 100%; max-width: 170px; height: auto; }
  .slide .chip { height: 24px; font-size: 11px; padding-inline: 8px; }
  .slide h1, .slide h2 { font-size: 19px; margin: 10px 0 4px; line-height: 1.5; }
  .slide h1 em, .slide h2 em { font-size: 12px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .slide__price { margin: 10px 0 12px; gap: 8px; flex-wrap: wrap; }
  .slide__price strong { font-size: 18px; }
  .slide__price del { font-size: 12px; }
  .slide .btns { gap: 6px; }
  .slide .btns .btn { height: 38px; padding-inline: 12px; font-size: 12.5px; border-radius: 12px; }
  .slide .btns .btn + .btn { display: none; }
  .slider__nav { padding: 0 18px 14px; display: flex !important; justify-content: center; gap: 6px; }
  .slider__tab { font-size: 0; width: 18px; padding-top: 0; height: 6px; }
  .slider__tab::before, .slider__tab i { height: 6px; border-radius: 6px; }
  .slider__tab.is-on { width: 34px; }

  /* بنرهای کنار اسلایدر: دو ستونه */
  .hero__side { grid-template-columns: 1fr 1fr !important; grid-template-rows: none; gap: 10px !important; }
  .tile { min-height: 150px; border-radius: 20px; }
  .tile img { inset: auto 0 0 auto; left: 0; right: auto; top: auto; width: 62%; height: 56%; object-fit: contain; object-position: left bottom; -webkit-mask-image: radial-gradient(75% 80% at 35% 70%, #000 55%, transparent 100%); mask-image: radial-gradient(75% 80% at 35% 70%, #000 55%, transparent 100%); }
  .tile__copy { width: 100% !important; z-index: 1; }
  .tile__copy b { max-width: 70%; }
  .tile__copy { padding: 14px !important; }
  .tile__copy small, .tile__copy span { font-size: 11px; }
  .tile__copy b { font-size: 14px !important; line-height: 1.5; }
  .tile .round { display: none; }

  /* مزایا: اسکرول افقی */
  .perks ul { display: flex !important; overflow-x: auto; gap: 8px; background: none; scrollbar-width: none; }
  .perks ul::-webkit-scrollbar { display: none; }
  .perks li { flex: none; display: flex !important; background: var(--surface); border-radius: 16px; border: 0 !important; padding: 12px 14px !important; }
  .perks li + li { border: 0; }

  /* عنوان بخش‌ها */
  .head h2 { position: relative; padding-right: 12px; }
  .head h2::before { content: ""; position: absolute; right: 0; top: 18%; bottom: 18%; width: 4px; border-radius: 4px; background: linear-gradient(var(--red), var(--blue)); }

  /* دسته‌ها: دایره‌های رنگی */
  .cat__img { background: linear-gradient(145deg, #fff, var(--well)); box-shadow: 0 6px 16px -10px rgba(18, 22, 31, .35), inset 0 0 0 1px var(--line); }
  .cat:nth-child(4n+1) .cat__img { background: linear-gradient(145deg, #fff, #EEF3FD); }
  .cat:nth-child(4n+2) .cat__img { background: linear-gradient(145deg, #fff, #FDEDEE); }
  .cat:nth-child(4n+3) .cat__img { background: linear-gradient(145deg, #fff, #E7F7F0); }
  .cat:nth-child(4n+4) .cat__img { background: linear-gradient(145deg, #fff, #FFF5E0); }

  /* کارت کالا */
  .card { border-radius: 18px; box-shadow: 0 1px 0 var(--line), 0 10px 22px -18px rgba(18, 22, 31, .4); }
  .card__media { border-radius: 14px; }

  /* معرفی فروشگاه: فشرده */
  .story__img { min-height: 210px; }
  .story__copy { padding: 22px 18px !important; gap: 10px; }
  .story__copy h2 { font-size: 21px; }
  .story__copy > p { font-size: 13.5px; line-height: 2; }

  /* نوار پایین شناور */
  body { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  .tabbar { inset: auto 12px calc(10px + env(safe-area-inset-bottom, 0px)) !important; padding: 6px !important; border-radius: 22px; background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(14px) saturate(1.6); backdrop-filter: blur(14px) saturate(1.6); box-shadow: 0 0 0 1px rgba(18, 22, 31, .06), 0 16px 34px -12px rgba(18, 22, 31, .35) !important; }
  .tabbar a { padding-block: 7px 6px; border-radius: 16px; font-size: 11px; transition: background .2s, color .2s; }
  .tabbar a[aria-current="page"] { background: var(--ink); color: #fff; }
  .tabbar a[aria-current="page"] .i { color: #fff; }
  .tabbar .badge { box-shadow: 0 0 0 2px #fff; }
  .to-top, .toast { bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important; }
  body.has-buybar .buybar { border-radius: 22px 22px 0 0; }

  /* فوتر */
  .footer { border-radius: 26px 26px 0 0; border-top: 0; box-shadow: 0 -10px 30px -22px rgba(18, 22, 31, .4); }
  .footer__top { grid-template-columns: 1fr 1fr !important; gap: 24px 16px !important; padding-block: 30px 22px; }
  .footer__top > :first-child, .footer__top > :last-child { grid-column: 1 / -1; }
  .footer ul { gap: 6px; }
  .footer ul a { font-size: 13px; }
  .footer__bottom .wrap { justify-content: center; text-align: center; font-size: 12px; }
}

/* ---------- منوی دسکتاپ: هر آیتم در یک خط ---------- */
@media (min-width: 821px) {
  .menu__row { flex-wrap: nowrap; min-width: 0; }
  .menu__all, .menu__link, .menu__loc { white-space: nowrap; flex-shrink: 0; }
  .menu__loc { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}
@media (min-width: 821px) and (max-width: 1440px) {
  .menu__link { padding-inline: 10px; font-size: 13.5px; }
  .menu__link::after { inset-inline: 10px; }
  .menu__loc { display: none; }
}
@media (min-width: 821px) and (max-width: 1100px) {
  .menu__link { padding-inline: 8px; font-size: 13px; }
  .menu__link .i { display: none; }
}

/* ---------- صفحه کالا: بدنه دو ستونه (محتوا + خلاصه خرید چسبان) ---------- */
.pbody { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: start; }
.pbody__main { min-width: 0; }
.pbody .prose { max-width: none; }
.pbody .spec-table { max-width: none; }
.pbody__side { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 200px); display: grid; gap: 12px; padding-top: 28px; }
.pside { display: grid; gap: 14px; padding: 18px; border-radius: var(--r-lg); background: var(--well); }
.pside__head { display: flex; gap: 12px; align-items: center; }
.pside__head img { width: 64px; height: 64px; flex: none; object-fit: contain; border-radius: 12px; background: #fff; mix-blend-mode: multiply; }
.pside__head b { font-size: 13.5px; line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pside .btn--block { width: 100%; justify-content: center; }
.pside__list { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px dashed var(--line-2); display: grid; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.pside__list li { display: flex; align-items: center; gap: 8px; }
.pside__list .i { width: 17px; height: 17px; color: var(--blue); flex: none; }
.pside--help { grid-template-columns: auto 1fr; align-items: center; gap: 12px; background: var(--blue-50); color: var(--blue-ink, var(--ink)); }
.pside--help > .i { width: 34px; height: 34px; padding: 7px; border-radius: 12px; background: #fff; color: var(--blue); }
.pside--help b { display: block; font-size: 13.5px; }
.pside--help small { font-size: 12.5px; color: var(--ink-2); }
@media (max-width: 1100px) {
  .pbody { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .pbody__side { display: none; }
}
