/* ============================================================
   PHARMASHID · Clinical  ·  v2.0
   طراحی از پایه — الهام از داروخانه‌های آنلاین اروپایی
   زبان بصری: برچسب نسخه — خط باریک، فاصله، عدد دقیق، واحد جدا
   همه کلاس‌ها با پیشوند .p- ، هیچ کلاس قدیمی بازنویسی نمی‌شود
   ============================================================ */

/* ---------- توکن ---------- */
:root {
    /* جوهر و کاغذ */
    --ink: #10242E;
    --ink-2: #5A6E78;
    --ink-3: #8B9BA3;
    --paper: #FFFFFF;
    --paper-2: #F7F9FA;
    --line: #E4EAEC;
    --line-strong: #CFD9DD;

    /* برند */
    --brand: #0B7490;
    --brand-deep: #1D5473;
    --brand-wash: #EFF7F9;

    /* نشانه‌ها */
    --verify: #1B7F5A;
    --tag: #A63A3A;
    --near: #9A6412;
    --near-wash: #FDF6E9;

    /* شکل — کلینیکال یعنی گوشه‌های کم */
    --r: 8px;
    --r-lg: 12px;
    --r-btn: 6px;

    /* ریتم */
    --gap: 12px;
    --pad: 16px;
    --bottomnav: 62px;
}

body.black-mode {
    --ink: #E7EFF2;
    --ink-2: #9BAEB7;
    --ink-3: #6E828C;
    --paper: #0F1D24;
    --paper-2: #16272F;
    --line: #22383F;
    --line-strong: #2E4750;
    --brand: #3FA6C4;
    --brand-wash: #14303A;
    --near-wash: #2A2213;
}

/* ---------- قلم ---------- */
@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

body {
    font-family: 'Vazirmatn', Tahoma, system-ui, sans-serif;
    background: var(--paper);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

@media (max-width: 991.98px) {
    body {
        padding-bottom: calc(var(--bottomnav) + env(safe-area-inset-bottom, 0px));
    }
}

/* ارقام هم‌عرض — مثل برچسب دارو */
.p-fig {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* عنوان ریز با فاصله حروف — «ایبرو» برچسب */
.p-eyebrow {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .09em;
    color: var(--ink-3);
    line-height: 1.6;
}

/* ---------- ظرف ---------- */
.p-wrap {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 var(--pad);
}

@media (min-width: 992px) {
    :root { --pad: 24px; }
}

/* ---------- نوار خدمات ---------- */
.p-strip {
    background: var(--brand-deep);
    color: rgba(255, 255, 255, .9);
    font-size: 11.5px;
    line-height: 1.6;
}

.p-strip__in {
    max-width: 1320px;
    margin: 0 auto;
    padding: 7px var(--pad);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.p-strip a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

/* شماره داروساز — عنصر اصلی این نوار */
.p-strip__tel {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    letter-spacing: .01em;
}

.p-strip__tel i { font-size: 12px; }

.p-strip__dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .45);
    flex-shrink: 0;
}

/* روی صفحه‌های باریک فقط شماره و گارانتی می‌مانند تا نوار دو خط نشود */
@media (max-width: 575.98px) {
    .p-strip__opt { display: none; }
}

/* ---------- هدر ---------- */
.p-head {
    position: sticky;
    top: 0;
    z-index: 900;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.p-head__in {
    max-width: 1320px;
    margin: 0 auto;
    padding: 10px var(--pad);
    display: flex;
    align-items: center;
    gap: 12px;
}

.p-logo img {
    height: 32px;
    width: auto;
    display: block;
}

@media (min-width: 992px) {
    .p-logo img { height: 42px; }
}

/* جستجو — عنصر اصلی هدر */
.p-find {
    flex: 1;
    position: relative;
    min-width: 0;
}

.p-find__box {
    display: flex;
    align-items: center;
    height: 40px;
    background: var(--paper-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    overflow: hidden;
    transition: border-color .15s, background .15s;
}

.p-find__box:focus-within {
    border-color: var(--brand);
    background: var(--paper);
}

.p-find__in {
    flex: 1;
    border: 0;
    background: transparent;
    outline: none;
    font: inherit;
    font-size: 13.5px;
    color: var(--ink);
    padding: 0 12px;
    min-width: 0;
}

.p-find__in::placeholder { color: var(--ink-3); }

.p-find__go {
    border: 0;
    background: transparent;
    color: var(--ink-2);
    width: 42px;
    height: 100%;
    display: grid;
    place-items: center;
    cursor: pointer;
    border-inline-start: 1px solid var(--line);
}

.p-find__go:hover { color: var(--brand); }
.p-find__go i { font-size: 15px; }

.p-find__res {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline: 0;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: 0 12px 32px rgba(16, 36, 46, .12);
    max-height: 60vh;
    overflow-y: auto;
    z-index: 1000;
    padding: 4px;
}

.p-find__res > div { border-radius: var(--r-btn); }
.p-find__res > div:hover { background: var(--brand-wash); }
.p-find__res a { text-decoration: none; color: var(--ink); display: block; }
.p-find__res img {
    width: 42px !important;
    max-width: 42px !important;
    height: 42px;
    object-fit: contain;
    border-radius: 4px;
}
.p-find__res p { margin: 0; font-size: 12.5px; line-height: 1.75; }

/* آیکون‌های هدر */
.p-acts { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }

.p-ico {
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    color: var(--ink-2);
    display: grid;
    place-items: center;
    position: relative;
    border-radius: var(--r-btn);
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s;
}

.p-ico:hover { background: var(--paper-2); color: var(--brand); }
.p-ico i { font-size: 18px; }

.p-ico__n {
    position: absolute;
    top: 3px;
    left: 3px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--tag);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: grid;
    place-items: center;
}

/* ---------- ناوبری دسکتاپ ---------- */
.p-nav { display: none; border-bottom: 1px solid var(--line); background: var(--paper); }

@media (min-width: 1100px) { .p-nav { display: block; } }

.p-nav__in {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 var(--pad);
    display: flex;
    align-items: center;
    gap: 2px;
}

.p-nav__l {
    color: var(--ink);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    padding: 12px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}

.p-nav__l:hover { color: var(--brand); border-bottom-color: var(--brand); }

/* زیرمنو با هاور — بدون جاوااسکریپت */
.p-dd { position: relative; }

.p-dd > .p-nav__l::after {
    content: '';
    position: absolute;
    top: 100%;
    inset-inline: 0;
    height: 8px;
}

.p-dd__menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: 0 14px 34px rgba(16, 36, 46, .13);
    padding: 5px;
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity .14s, transform .14s, visibility .14s;
    z-index: 1000;
}

.p-dd:hover > .p-dd__menu,
.p-dd:focus-within > .p-dd__menu,
.p-dd__i:hover > .p-dd__menu,
.p-dd__i:focus-within > .p-dd__menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
}

.p-dd__i { position: relative; }

.p-dd__i > .p-dd__menu {
    top: -5px;
    right: 100%;
    transform: translateX(4px);
}

.p-dd__menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 13px;
    color: var(--ink);
    text-decoration: none;
    border-radius: var(--r-btn);
    white-space: nowrap;
    transition: background .13s, color .13s;
}

.p-dd__menu a:hover { background: var(--brand-wash); color: var(--brand); }

.p-dd__i:has(> .p-dd__menu) > a::after {
    content: '‹';
    margin-inline-start: auto;
    color: var(--ink-3);
    font-size: 15px;
    line-height: 1;
}

/* ---------- نوار پایین موبایل ---------- */
/* پس‌زمینه فیروزه‌ای خیلی کمرنگ، و دکمه‌ها با فیروزه‌ای تیره
   تا روی آن پس‌زمینه روشن کاملاً خوانا بمانند. */
.p-tab {
    position: fixed;
    bottom: 0;
    inset-inline: 0;
    height: calc(var(--bottomnav) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #E4F4F8;
    border-top: 1px solid #B9DFE9;
    box-shadow: 0 -4px 16px rgba(11, 116, 144, .10);
    display: flex;
    z-index: 950;
}

@media (min-width: 992px) { .p-tab { display: none; } }

.p-tab a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: #2C6B7D;
    font-size: 10.5px;
    font-weight: 600;
    position: relative;
    padding-top: 3px;
}

/* آیکون داخل یک قرص — صفحه فعال کاملاً مشخص می‌شود */
.p-tab__ic {
    width: 42px;
    height: 26px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    transition: background .15s, color .15s;
}

.p-tab a i { font-size: 19px; line-height: 1; }

.p-tab a.on { color: #0A5F78; font-weight: 700; }

.p-tab a.on .p-tab__ic {
    background: #0B7490;
    color: #fff;
}

.p-tab a:active .p-tab__ic { background: rgba(11, 116, 144, .14); }

.p-tab__n {
    position: absolute;
    top: 2px;
    left: 50%;
    margin-left: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #D6304A;
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    display: grid;
    place-items: center;
    border: 1.5px solid #E4F4F8;
}

/* حالت شب */
body.black-mode .p-tab {
    background: #14313C;
    border-top-color: #1F4A59;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .3);
}

body.black-mode .p-tab a { color: #8FB6C3; }
body.black-mode .p-tab a.on { color: #B7E2EE; }
body.black-mode .p-tab a.on .p-tab__ic { background: #2A8AA6; }
body.black-mode .p-tab__n { border-color: #14313C; }

/* ---------- بخش ---------- */
.p-sec { margin-top: 34px; }

@media (min-width: 992px) { .p-sec { margin-top: 52px; } }

.p-sec__hd {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.p-sec__t {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    line-height: 1.6;
    letter-spacing: -.01em;
}

@media (min-width: 992px) { .p-sec__t { font-size: 21px; } }

.p-sec__sub {
    font-size: 12px;
    color: var(--ink-2);
    display: none;
}

@media (min-width: 768px) { .p-sec__sub { display: block; } }

.p-sec__more {
    margin-inline-start: auto;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.p-sec__more:hover { text-decoration: underline; }

/* ---------- راهنمای انتخاب ---------- */
.p-guide { padding-top: 26px; }

.p-guide__q {
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.7;
    letter-spacing: -.015em;
}

@media (min-width: 768px) { .p-guide__q { font-size: 25px; } }

.p-guide__s {
    font-size: 13px;
    color: var(--ink-2);
    margin: 0 0 16px;
    line-height: 1.9;
}

.p-guide__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

@media (min-width: 640px) { .p-guide__grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 992px) { .p-guide__grid { grid-template-columns: repeat(4, 1fr); gap: 10px; } }

.p-tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    min-height: 74px;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--paper);
    text-decoration: none;
    color: var(--ink);
    transition: border-color .15s, background .15s;
}

.p-tile:hover {
    border-color: var(--brand);
    background: var(--brand-wash);
}

.p-tile__n {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.65;
}

@media (min-width: 992px) { .p-tile__n { font-size: 14px; } }

.p-tile__m {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10.5px;
    color: var(--ink-3);
}

.p-tile__arrow { color: var(--brand); font-size: 13px; line-height: 1; }

/* ---------- بنر: هرگز بریده نمی‌شود ---------- */
.p-promo {
    display: grid;
    gap: var(--gap);
    margin-top: 26px;
}

@media (min-width: 768px) {
    .p-promo--2 { grid-template-columns: 1fr 1fr; }
}

.p-promo a {
    display: block;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--paper-2);
    line-height: 0;
}

/* نسبت طبیعی تصویر حفظ می‌شود؛ فقط متناسب کوچک می‌شود */
.p-promo img {
    width: 100%;
    height: auto;
    display: block;
}

/* نوار بنر افقی وقتی چند بنر داریم */
.p-promo--rail {
    display: flex;
    gap: var(--gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.p-promo--rail::-webkit-scrollbar { display: none; }

.p-promo--rail > a {
    flex: 0 0 88%;
    scroll-snap-align: center;
}

@media (min-width: 768px) {
    .p-promo--rail > a { flex: 0 0 48%; }
}

/* ---------- شبکه محصول ---------- */
.p-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap);
}

@media (min-width: 560px) { .p-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .p-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1180px) { .p-grid { grid-template-columns: repeat(5, 1fr); } }

/* ریل افقی — فقط برای مجموعه‌های منتخب و محدود */
.p-rail {
    display: flex;
    gap: var(--gap);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.p-rail::-webkit-scrollbar { display: none; }

.p-rail > * {
    flex: 0 0 150px;
    scroll-snap-align: start;
}

@media (min-width: 768px) { .p-rail > * { flex-basis: 186px; } }

/* ---------- کارت محصول ---------- */
.p-card {
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
    position: relative;
}

.p-card:hover {
    border-color: var(--line-strong);
    box-shadow: 0 6px 18px rgba(16, 36, 46, .07);
}

.p-card__img {
    display: block;
    position: relative;
    background: #fff;
    padding: 4px;
    border-bottom: 1px solid var(--line);
}

body.black-mode .p-card__img { background: var(--paper-2); }

.p-card__img img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    display: block;
}

/* برچسب — تخت، بدون گرد شدن زیاد، مثل لیبل قفسه */
.p-tagline {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--tag);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-bottom-left-radius: var(--r-btn);
    line-height: 1.6;
    z-index: 2;
}

.p-tagline--near { background: var(--near); }
.p-tagline--out { background: var(--ink-3); }

.p-card__b {
    padding: 8px 9px 9px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.p-card__n {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.75;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 42px;
}

.p-card__n a { color: var(--ink); text-decoration: none; }

@media (min-width: 768px) {
    .p-card__n { font-size: 13px; min-height: 46px; }
}

/* ---------- کنترل تعداد روی تصویر ---------- */
/* وسط و پایین تصویر می‌نشیند. تا وقتی چیزی در سبد نیست فقط یک
   دایره سبز «+» است؛ با اولین افزودن به یک قرص سه‌بخشی باز می‌شود. */
.p-qty {
    position: absolute;
    bottom: 7px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    align-items: stretch;
    height: 34px;
    border-radius: 11px;
    overflow: hidden;
    background: var(--paper);
    border: 1px solid var(--line-strong);
    box-shadow: 0 3px 12px rgba(16, 36, 46, .2);
    transition: border-radius .16s;
}

/* حالت جمع: فقط دکمه سبز، به شکل دایره */
.p-qty:not(.is-open) {
    border-radius: 50%;
    border-color: transparent;
    background: transparent;
    box-shadow: 0 3px 10px rgba(27, 127, 90, .35);
}

.p-qty__b {
    width: 36px;
    border: 0;
    padding: 0;
    font: inherit;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: #fff;
    transition: background .14s;
}

.p-qty__b--add { background: #1B7F5A; }
.p-qty__b--add:hover { background: #16694A; }
.p-qty__b--add:active { background: #125639; }

.p-qty__b--del { background: #D6304A; }
.p-qty__b--del:hover { background: #BC2440; }
.p-qty__b--del:active { background: #A11C35; }

.p-qty__b svg { width: 15px; height: 15px; display: block; }

/* عدد وسط — روی زمینه سفید، جدا از دکمه‌ها */
.p-qty__n {
    min-width: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    background: var(--paper);
    font-variant-numeric: tabular-nums;
    padding: 0 2px;
}

/* اجزای کناری فقط وقتی چیزی در سبد هست دیده می‌شوند */
.p-qty__side,
.p-qty__n { display: none; }

.p-qty.is-open .p-qty__side { display: grid; }
.p-qty.is-open .p-qty__n { display: flex; }

/* منها یا سطل زباله — بسته به اینکه تعداد ۱ است یا بیشتر */
.p-qty__trash { display: none; }
.p-qty.is-one .p-qty__trash { display: block; }
.p-qty.is-one .p-qty__minus { display: none; }

.p-qty--wait { opacity: .55; pointer-events: none; }

body.black-mode .p-qty { background: var(--paper-2); }
body.black-mode .p-qty__n { background: var(--paper-2); }

/* حالت‌های خاص: متغیر و ناموجود */
.p-pick {
    position: absolute;
    bottom: 7px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    height: 34px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    background: var(--brand);
    border: 0;
    border-radius: 11px;
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 3px 12px rgba(11, 116, 144, .3);
}

.p-pick:hover { background: var(--brand-deep); color: #fff; }

/* وضعیت موجودی — نقطه سبز داروخانه */
.p-stock {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 600;
    color: var(--verify);
}

.p-stock::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--verify);
    flex-shrink: 0;
}

.p-stock--out { color: var(--ink-3); }
.p-stock--out::before { background: var(--ink-3); }

/* روز تا انقضا */
.p-days {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 600;
    color: var(--near);
    background: var(--near-wash);
    border-radius: var(--r-btn);
    padding: 3px 6px;
}

.p-days__bar {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: rgba(154, 100, 18, .18);
    overflow: hidden;
}

.p-days__fill { display: block; height: 100%; background: var(--near); }

/* قیمت — با خط جداکننده بالای آن، مثل برچسب */
.p-price {
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px solid var(--line);
}

.p-price__was {
    display: block;
    font-size: 10.5px;
    color: var(--ink-3);
    text-decoration: line-through;
    line-height: 1.6;
    min-height: 17px;
}

.p-price__now {
    display: flex;
    align-items: baseline;
    gap: 3px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.5;
    letter-spacing: -.01em;
}

.p-price__u {
    font-size: 10px;
    font-weight: 500;
    color: var(--ink-2);
    letter-spacing: 0;
}

.p-price__now--sm { font-size: 12px; font-weight: 600; }
.p-price__now--off { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.p-price__now--free { color: var(--verify); }

/* دکمه — خطی، پر شدن در هاور */
.p-btn {
    width: 100%;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 0;
    border-radius: var(--r-btn);
    border: 1px solid var(--brand);
    background: transparent;
    color: var(--brand);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-decoration: none;
    transition: background .14s, color .14s;
}

.p-btn:hover { background: var(--brand); color: #fff; }
.p-btn:active { transform: translateY(1px); }

.p-btn--solid { background: var(--brand); color: #fff; }
.p-btn--solid:hover { background: var(--brand-deep); border-color: var(--brand-deep); }

.p-btn--off {
    border-color: var(--line-strong);
    color: var(--ink-3);
    cursor: not-allowed;
}

.p-btn--off:hover { background: transparent; color: var(--ink-3); }

/* ---------- تاریخ نزدیک ---------- */
.p-near {
    margin-top: 34px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
}

@media (min-width: 992px) { .p-near { margin-top: 52px; } }

.p-near__hd {
    padding: 14px var(--pad);
    background: var(--near-wash);
    border-bottom: 1px solid var(--line);
}

.p-near__t {
    font-size: 15.5px;
    font-weight: 700;
    margin: 0 0 3px;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.6;
}

@media (min-width: 992px) { .p-near__t { font-size: 18px; } }

.p-near__t .p-sec__more { color: var(--near); }

.p-near__s {
    font-size: 12px;
    color: var(--ink-2);
    margin: 0;
    line-height: 1.9;
    max-width: 66ch;
}

.p-near__body { padding: 14px var(--pad); }

/* ---------- فلش اسکرول ریل (فقط دسکتاپ) ---------- */
.p-railwrap { position: relative; }

.p-arw {
    /* روی موبایل و پیش از لود شدن استایل کامل، اصلاً چیزی دیده نشود */
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: var(--paper);
    color: var(--brand-deep);
    cursor: pointer;
    z-index: 6;
    place-items: center;
    box-shadow: 0 2px 4px rgba(16, 36, 46, .08), 0 6px 20px rgba(16, 36, 46, .16);
    transition: background .15s, color .15s, border-color .15s, opacity .18s, visibility .18s;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
}

@media (min-width: 992px) {
    .p-arw { display: grid; }
}

.p-arw:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.p-arw:active { transform: translateY(-50%) scale(.94); }

.p-arw svg {
    width: 17px;
    height: 17px;
    display: block;
}

/* در RTL: «بعدی» سمت چپ، «قبلی» سمت راست.
   کمی داخل نشسته‌اند تا لبه گرد کادر آن‌ها را نبُرد. */
.p-arw--next { left: 8px; }
.p-arw--prev { right: 8px; }

/* وقتی به ابتدا یا انتهای ریل رسیدیم، فلش آن سمت محو می‌شود */
.p-arw[disabled] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.black-mode .p-arw {
    color: #B7E2EE;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .25), 0 6px 20px rgba(0, 0, 0, .35);
}

/* ---------- لود خودکار ادامه ریل ---------- */
.p-more {
    flex: 0 0 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    align-self: stretch;
    min-height: 240px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--r);
    color: var(--ink-3);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    padding: 10px;
    text-decoration: none;
}

.p-more__spin {
    width: 20px;
    height: 20px;
    border: 2px solid var(--line-strong);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: p-spin .7s linear infinite;
}

@keyframes p-spin { to { transform: rotate(360deg); } }

.p-more--end {
    border-style: solid;
    color: var(--ink-2);
}

.p-more--end .p-more__all {
    color: var(--brand);
    font-weight: 700;
    font-size: 11.5px;
}

/* ---------- مقاله ---------- */
.p-art {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    text-decoration: none;
    background: var(--paper);
    height: 100%;
    transition: border-color .15s;
}

.p-art:hover { border-color: var(--line-strong); }

.p-art img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    display: block;
}

.p-art__b { padding: 11px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }

/* یک خط، با سه‌نقطه — تا ارتفاع همه کارت‌های مقاله دقیقاً یکی شود */
.p-art__t {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.9;
    margin: 0;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.p-art__m {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10.5px;
    color: var(--ink-3);
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.p-art__m b { color: var(--brand); font-weight: 600; }

.p-rail--art > * { flex-basis: 235px; }

@media (min-width: 768px) { .p-rail--art > * { flex-basis: 290px; } }

/* ---------- تضمین‌ها ---------- */
.p-assure {
    margin-top: 34px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
}

@media (min-width: 768px) { .p-assure { grid-template-columns: repeat(4, 1fr); } }

.p-assure__i {
    padding: 16px 14px;
    border-inline-start: 1px solid var(--line);
    border-top: 1px solid var(--line);
}

.p-assure__i:nth-child(-n+2) { border-top: 0; }
.p-assure__i:nth-child(2n+1) { border-inline-start: 0; }

@media (min-width: 768px) {
    .p-assure__i { border-top: 0; }
    .p-assure__i:first-child { border-inline-start: 0; }
    .p-assure__i:nth-child(2n+1) { border-inline-start: 1px solid var(--line); }
    .p-assure__i:first-child { border-inline-start: 0; }
}

.p-assure__t {
    font-size: 12.5px;
    font-weight: 700;
    margin: 6px 0 3px;
    line-height: 1.6;
}

.p-assure__d {
    font-size: 11px;
    color: var(--ink-2);
    margin: 0;
    line-height: 1.85;
}

.p-assure__i i { font-size: 19px; color: var(--brand); }

/* ---------- عنوان صفحه ---------- */
.p-lede { padding: 30px 0 0; max-width: 62ch; }

.p-lede h1 {
    font-size: 19px;
    font-weight: 700;
    margin: 6px 0 8px;
    line-height: 1.8;
    letter-spacing: -.015em;
}

@media (min-width: 992px) { .p-lede h1 { font-size: 24px; } }

.p-lede p { font-size: 13px; color: var(--ink-2); line-height: 2.1; margin: 0; }

/* ---------- فوتر ---------- */
.p-foot { margin-top: 56px; border-top: 1px solid var(--line); background: var(--paper-2); }

.p-foot__in {
    max-width: 1320px;
    margin: 0 auto;
    padding: 32px var(--pad) 20px;
    display: grid;
    gap: 28px;
}

@media (min-width: 768px) { .p-foot__in { grid-template-columns: 1.5fr 1fr 1.3fr; gap: 36px; } }

.p-foot h3 {
    font-size: 12.5px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--ink);
}

.p-foot p { font-size: 12.5px; line-height: 2.1; color: var(--ink-2); margin: 0 0 10px; }

.p-foot__links { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; }

.p-foot__links a {
    font-size: 12.5px;
    color: var(--ink-2);
    text-decoration: none;
    padding: 6px 0;
    transition: color .14s;
}

.p-foot__links a:hover { color: var(--brand); }

.p-foot__seals { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.p-foot__seals > * {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-btn);
    padding: 5px;
    line-height: 0;
}

.p-foot__seals img { max-height: 72px; width: auto; }

.p-foot__end {
    border-top: 1px solid var(--line);
    padding: 14px var(--pad);
    max-width: 1320px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    font-size: 11px;
    color: var(--ink-3);
}

.p-foot__end a { color: var(--ink-2); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.p-foot__end img { height: 16px; }

/* ---------- کشوی دسته‌بندی ---------- */
.p-drawer-l {
    display: block;
    padding: 12px 4px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}

.p-drawer-s {
    display: block;
    padding: 9px 4px 9px 14px;
    font-size: 12.5px;
    color: var(--ink-2);
    text-decoration: none;
}

.p-drawer-x {
    display: block;
    padding: 7px 4px 7px 26px;
    font-size: 12px;
    color: var(--ink-3);
    text-decoration: none;
}

/* ---------- سرعت و دسترسی ---------- */
.p-sec,
.p-promo,
.p-assure { content-visibility: auto; contain-intrinsic-size: auto 400px; }

.p-guide,
.p-near { content-visibility: visible; }

.p-btn:focus-visible,
.p-ico:focus-visible,
.p-tile:focus-visible,
.p-tab a:focus-visible,
.p-find__in:focus-visible,
.p-nav__l:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}