/* ============================================================
   Shadi Clinic — UI/UX Polish v3
   هدف: Medical Luxury، اسلایدرهای RTL، دارک‌مود کامل و کنترل‌های شناور
   این فایل عمداً بعد از campaign-ui-2026.css بارگذاری می‌شود.
   ============================================================ */
:root {
    --v3-primary: #0E897E;
    --v3-primary-dark: #086C64;
    --v3-primary-deep: #064B46;
    --v3-gold: #D5A04C;
    --v3-gold-dark: #B9853A;
    --v3-ink: #172321;
    --v3-muted: #5E6B69;
    --v3-bg: #FFFFFF;
    --v3-surface: #F6FAF9;
    --v3-border: #DDE8E6;
    --v3-radius-sm: 12px;
    --v3-radius-md: 18px;
    --v3-radius-lg: 26px;
    --v3-shadow-sm: 0 8px 28px rgba(13, 59, 54, .07);
    --v3-shadow-md: 0 20px 54px rgba(13, 59, 54, .12);
    --v3-section: clamp(64px, 7vw, 96px);
}

/* رفع ریشه‌ای فضای خالی پایین صفحه: قانون نسخه قبل position عناصر fixed را overwrite می‌کرد. */
body.site-public > .public-float-dock,
body.site-public > .chat-widget,
body.site-public > .app-modal,
body.site-public > .cookie-banner,
body.site-public > .mobile-cta-bar,
body.site-public > .c555-promo,
body.site-public > .site-scroll-progress,
body.site-public > .site-ambient {
    position: fixed;
}
body.site-public > script { position: static; }
html, body { min-height: 100%; }
body.site-public { min-height: 100vh; }
.site-footer { margin-bottom: 0 !important; }

/* شفافیت و تمرکز بصری؛ افکت‌ها نسبت به v2 کنترل‌شده‌تر هستند. */
.section { padding-block: var(--v3-section); }
.section-alt { border-block: 1px solid rgba(14, 137, 126, .08); }
.section-header { max-width: 920px; margin-inline: auto; margin-bottom: clamp(30px, 4vw, 48px); }
.section-title { text-wrap: balance; }
.section-desc { text-wrap: pretty; }
.service-card, .device-card, .blog-card, .doctor-card, .testimonial-card,
.method-card, .result-card, .doctor-directory-card {
    box-shadow: var(--v3-shadow-sm);
}
.service-card:hover, .device-card:hover, .blog-card:hover, .doctor-card:hover,
.testimonial-card:hover, .method-card:hover, .result-card:hover,
.doctor-directory-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--v3-shadow-md);
}

/* هدر سبک‌تر و پایدار */
.site-header { transition: min-height .25s ease, background .25s ease, box-shadow .25s ease; }
.site-header.is-scrolled .header-inner { min-height: 70px; }
.site-header.is-scrolled .logo-img { max-height: 56px; }
.header-inner { transition: min-height .25s ease; }
.logo-img { transition: max-height .25s ease; }

/* هیرو موبایل: CTA در اولین viewport */
.page-index .hero-inner { align-items: center; }
.hero-actions .btn { min-height: 48px; }
.hero-stats .stat-item strong { white-space: nowrap; }

/* ============================================================
   کنترل‌های شناور — تماس و چت کنار هم در پایین راست
   اعلان کمپین مستقل در پایین چپ
   ============================================================ */
.public-float-dock {
    right: 22px;
    bottom: 22px;
    z-index: 990;
    display: flex;
    align-items: center;
    gap: 10px;
    direction: rtl;
}
.public-float-dock .call-float,
.public-float-dock .support-float {
    position: relative !important;
    inset: auto !important;
    margin: 0;
}
.public-float-dock .call-float {
    min-height: 58px;
    padding: 0 20px;
    color: #fff !important;
    background: linear-gradient(135deg, var(--v3-primary), var(--v3-primary-dark));
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: 0 14px 34px rgba(6, 76, 70, .25);
}
.public-float-dock .support-float {
    width: 58px;
    height: 58px;
    color: #fff;
    background: linear-gradient(135deg, var(--v3-primary), var(--v3-primary-deep));
    box-shadow: 0 14px 34px rgba(6, 76, 70, .25);
    animation: none;
}
.public-float-dock .support-float__label {
    right: auto;
    left: 68px;
}
.public-float-dock .call-float:hover,
.public-float-dock .support-float:hover { transform: translateY(-3px); }
.chat-widget { right: 22px !important; left: auto !important; bottom: 92px !important; }
.c555-promo { left: 22px !important; right: auto !important; bottom: 22px !important; }

/* ============================================================
   Carousel عمومی RTL — روش‌ها، نمونه‌کار، پزشکان و نظرات
   ============================================================ */
.auto-carousel-shell {
    position: relative;
    padding: 12px;
    border: 1px solid rgba(14, 137, 126, .12);
    border-radius: 30px;
    background: rgba(255,255,255,.72);
    box-shadow: var(--v3-shadow-sm);
    isolation: isolate;
}
.auto-carousel-rail {
    direction: rtl;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(310px, 31.5%);
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    padding: 4px 4px 12px;
}
.auto-carousel-rail::-webkit-scrollbar { display: none; }
.auto-carousel-rail > * { scroll-snap-align: start; min-width: 0; }
.carousel-control {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(14, 137, 126, .18);
    border-radius: 50%;
    color: var(--v3-ink);
    background: rgba(255,255,255,.96);
    box-shadow: 0 9px 24px rgba(16, 58, 54, .13);
    transform: translateY(-50%);
    cursor: pointer;
}
.carousel-control:hover { color: #fff; background: var(--v3-primary); }
.carousel-control--prev { right: -18px; }
.carousel-control--next { left: -18px; }
/* مسیرهای درمان */
.methods-scroll { padding: 4px; }
.method-card {
    min-height: 310px;
    padding: 30px 26px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: right;
}
.method-card__icon { flex: 0 0 auto; }
.method-card__title { margin-top: 22px; }
.method-card__desc { flex: 1; }
.method-card__link { margin-top: auto; }

/* نمونه‌کارها */
.results-shell { padding: 12px; }
.results-rail { grid-auto-columns: minmax(320px, 31.5%); }
.result-card { height: 100%; }
.result-card__image { aspect-ratio: 4 / 3; }
.result-card__body { min-height: 142px; }
.result-card__head h2 { font-size: 1.05rem; }

/* گالری کامل: اسلایدر بالا + فهرست کلاسیک پایین */
.gallery-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 26px;
}
.gallery-filter-tabs .filter-tab { min-height: 42px; }
.gallery-archive-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin: 52px 0 24px;
}
.gallery-archive-title h2 { margin: 0; }
.gallery-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}
.gallery-archive-card {
    overflow: hidden;
    border: 1px solid rgba(14,137,126,.13);
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--v3-shadow-sm);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.gallery-archive-card:hover { transform: translateY(-4px); box-shadow: var(--v3-shadow-md); border-color: rgba(213,160,76,.45); }
.gallery-archive-card[hidden] { display: none; }
.gallery-archive-card__image {
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 0;
    padding: 0;
    display: block;
    overflow: hidden;
    cursor: zoom-in;
    background: #eef6f4;
}
.gallery-archive-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.gallery-archive-card:hover img { transform: scale(1.025); }
.gallery-archive-card__body { padding: 18px; }
.gallery-archive-card__body h3 { margin: 0 0 7px; font-size: 1.02rem; }
.gallery-archive-card__meta { display: flex; flex-wrap: wrap; gap: 7px 12px; color: var(--v3-muted); font-size: .78rem; }
.gallery-archive-card__note { margin-top: 10px; color: var(--v3-muted); font-size: .84rem; line-height: 1.8; }

/* پزشکان صفحه اصلی مطابق نمونه: پرتره دایره‌ای، اطلاعات و CTA */
.home-doctors-shell .auto-carousel-rail { grid-auto-columns: minmax(310px, 31.5%); }
.home-doctor-card {
    min-height: 500px;
    padding: 38px 30px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid rgba(14,137,126,.13);
    border-radius: 28px;
    background:
        radial-gradient(circle at 50% 12%, rgba(14,137,126,.10), transparent 28%),
        linear-gradient(145deg,#fff,#f6faf9);
    box-shadow: var(--v3-shadow-sm);
}
.home-doctor-card.is-lead { border-color: rgba(213,160,76,.55); }
.home-doctor-card .doctor-avatar {
    width: 154px;
    height: 154px;
    margin: 0 auto 24px;
    border: 5px solid #fff;
    box-shadow: 0 15px 34px rgba(8, 63, 58, .15);
    overflow: hidden;
}
.home-doctor-card .doctor-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.home-doctor-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    margin: 14px 0 20px;
    padding: 0 14px;
    border-radius: 999px;
    color: var(--v3-muted);
    background: rgba(14,137,126,.07);
    font-size: .82rem;
}
.home-doctor-card__badge i { color: var(--v3-primary); }
.home-doctor-card .doctor-name { font-size: clamp(1.35rem, 2vw, 1.7rem); }
.home-doctor-card .doctor-specialty { min-height: 52px; font-size: .94rem; line-height: 1.8; }
.home-doctor-card__actions { width: 100%; margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.home-doctor-card__actions .btn { padding-inline: 10px; font-size: .82rem; }

/* نظرات */
.testimonials-rail { grid-auto-columns: minmax(320px, 31.5%); }
.testimonial-card {
    min-height: 330px;
    padding: 30px;
}
.testimonial-card__source {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 7px;
    color: var(--v3-muted);
    font-size: .72rem;
}
.testimonial-card__date { margin-right: auto; }

/* فوتر جمع‌وجور و بدون فضای اضافه */
.site-footer { padding: 66px 0 24px; }
.footer-grid { margin-bottom: 42px; }
.footer-bottom { min-height: 58px; }

/* ============================================================
   دارک‌مود کامل: همه کامپوننت‌های اصلی به سطح تیره واقعی تبدیل می‌شوند.
   ============================================================ */
html:not([data-theme="light"]) { color-scheme: dark; }
html:not([data-theme="light"]) body.site-public { --v3-ink:#F2F7F6; --v3-muted:#A8BAB6; --v3-bg:#08100F; --v3-surface:#101B19; --v3-border:#253734; }
html:not([data-theme="light"]) .section-alt { background: rgba(255,255,255,.018); border-color: rgba(255,255,255,.055); }
html:not([data-theme="light"]) .auto-carousel-shell,
html:not([data-theme="light"]) .gallery-filter-tabs,
html:not([data-theme="light"]) .home-doctor-card,
html:not([data-theme="light"]) .gallery-archive-card,
html:not([data-theme="light"]) .service-card,
html:not([data-theme="light"]) .device-card,
html:not([data-theme="light"]) .device-page-card,
html:not([data-theme="light"]) .blog-card,
html:not([data-theme="light"]) .doctor-card,
html:not([data-theme="light"]) .method-card,
html:not([data-theme="light"]) .testimonial-card,
html:not([data-theme="light"]) .result-card,
html:not([data-theme="light"]) .trust-card,
html:not([data-theme="light"]) .staff-card,
html:not([data-theme="light"]) .director-inner,
html:not([data-theme="light"]) .treatment-feature__inner,
html:not([data-theme="light"]) .doctor-video-card,
html:not([data-theme="light"]) .doctor-directory-card,
html:not([data-theme="light"]) .doctor-content-card,
html:not([data-theme="light"]) .doctor-booking-card,
html:not([data-theme="light"]) .doctor-note,
html:not([data-theme="light"]) .contact-info-card,
html:not([data-theme="light"]) .booking-form,
html:not([data-theme="light"]) .booking-form-page,
html:not([data-theme="light"]) .aside-card,
html:not([data-theme="light"]) .detail-section,
html:not([data-theme="light"]) .device-detail__main,
html:not([data-theme="light"]) .account-sidebar,
html:not([data-theme="light"]) .account-main,
html:not([data-theme="light"]) .account-section,
html:not([data-theme="light"]) .auth-wrap {
    color: #E8F0EE;
    background: linear-gradient(145deg,#111D1B,#0C1615);
    border-color: rgba(255,255,255,.085);
    box-shadow: 0 16px 44px rgba(0,0,0,.24);
}
html:not([data-theme="light"]) .method-card__title,
html:not([data-theme="light"]) .method-card__desc,
html:not([data-theme="light"]) .method-card__link,
html:not([data-theme="light"]) .home-doctor-card .doctor-name,
html:not([data-theme="light"]) .home-doctor-card .doctor-specialty,
html:not([data-theme="light"]) .result-card__head h2,
html:not([data-theme="light"]) .gallery-archive-card h3,
html:not([data-theme="light"]) .testimonial-card p,
html:not([data-theme="light"]) .testimonial-card footer strong,
html:not([data-theme="light"]) .service-card h3,
html:not([data-theme="light"]) .device-card h3,
html:not([data-theme="light"]) .blog-card h3 { color: #F2F7F6 !important; }
html:not([data-theme="light"]) .method-card__desc,
html:not([data-theme="light"]) .service-desc,
html:not([data-theme="light"]) .device-card__desc,
html:not([data-theme="light"]) .blog-excerpt,
html:not([data-theme="light"]) .gallery-archive-card__meta,
html:not([data-theme="light"]) .gallery-archive-card__note,
html:not([data-theme="light"]) .testimonial-card footer span,
html:not([data-theme="light"]) .home-doctor-card__badge { color: #A8BAB6 !important; }
html:not([data-theme="light"]) .home-doctor-card__badge,
html:not([data-theme="light"]) .result-card__head > span,
html:not([data-theme="light"]) .gallery-filter-tabs .filter-tab:not(.active) { background: rgba(255,255,255,.055); }
html:not([data-theme="light"]) .carousel-control { color:#EAF3F1; background:#14211F; border-color:rgba(255,255,255,.10); }
html:not([data-theme="light"]) .carousel-control:hover { background:var(--v3-primary); }
html:not([data-theme="light"]) .result-card__image,
html:not([data-theme="light"]) .gallery-archive-card__image { background:#0A1413; }
html:not([data-theme="light"]) input,
html:not([data-theme="light"]) select,
html:not([data-theme="light"]) textarea,
html:not([data-theme="light"]) .auth-input {
    color:#E8F0EE !important;
    background:#0A1413 !important;
    border-color:rgba(255,255,255,.12) !important;
}
html:not([data-theme="light"]) input::placeholder,
html:not([data-theme="light"]) textarea::placeholder { color:#7F918D !important; }
html:not([data-theme="light"]) .main-nav { border-color:rgba(255,255,255,.07); }
html:not([data-theme="light"]) .mobile-cta-bar { background:rgba(8,16,15,.96); border-color:rgba(255,255,255,.08); }
html:not([data-theme="light"]) .mobile-cta-bar__item { color:#C9D8D5; }
html:not([data-theme="light"]) .chat-widget { background:#101B19; border-color:rgba(255,255,255,.10); }
html:not([data-theme="light"]) .c555-promo__link { color:#17302d; }

/* دسترس‌پذیری */
.auto-carousel-rail:focus-visible { outline: 3px solid rgba(213,160,76,.55); outline-offset: 5px; }
.carousel-control:focus-visible { outline: 3px solid rgba(213,160,76,.55); outline-offset: 3px; }

@media (max-width: 1100px) {
    .auto-carousel-rail, .results-rail, .home-doctors-shell .auto-carousel-rail, .testimonials-rail { grid-auto-columns: minmax(300px, 47%); }
    .gallery-archive-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 900px) {
    .page-index .hero-visual { order: 2 !important; }
    .page-index .hero-content { order: 1; }
    .header-actions .btn-account { display:none; }
}

@media (max-width: 760px) {
    body.site-public { padding-bottom: 72px; }
    .topbar { display:none; }
    .header-inner { min-height: 66px; }
    .header-actions { gap: 7px; }
    .header-actions .theme-toggle { width:40px; height:40px; }
    .header-actions .btn-booking { min-height:40px; padding:0 12px; font-size:.78rem; }
    .logo-img { max-height:54px; width:auto; }
    .page-index .hero { padding-top: 12px; }
    .page-index .hero-inner { padding: 22px 16px 20px; gap: 22px; }
    .hero-badge { font-size:.72rem; padding:7px 10px; }
    .hero-title { font-size:clamp(2rem,10vw,2.75rem); line-height:1.25; }
    .hero-desc { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; line-height:1.85; }
    .hero-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
    .hero-actions .btn { width:100%; font-size:.82rem; padding-inline:10px; }
    .hero-actions .btn-ghost { display:none; }
    .hero-stats { grid-template-columns:repeat(3,1fr); gap:6px; margin-top:18px; }
    .hero-stats .stat-item { display:block; padding:10px 6px; text-align:center; border-radius:13px; }
    .hero-stats .stat-item strong { font-size:1rem; }
    .hero-stats .stat-item span { display:block; font-size:.61rem; line-height:1.45; }
    .page-index .hero-visual { width:100%; }
    .video-slider { border-radius:22px; }
    .video-poster__body { padding:14px 16px 17px; }
    .video-poster__title { font-size:1rem; }
    .video-poster__desc { display:none; }
    .section { padding-block:54px; }
    .auto-carousel-shell { padding:8px; border-radius:22px; }
    .auto-carousel-rail, .results-rail, .home-doctors-shell .auto-carousel-rail, .testimonials-rail { grid-auto-columns: 88%; gap:12px; }
    .carousel-control { display:none; }
    .method-card { min-height:285px; padding:24px 20px; }
    .home-doctor-card { min-height:470px; padding:30px 20px 22px; }
    .home-doctor-card .doctor-avatar { width:132px; height:132px; }
    .home-doctor-card__actions { grid-template-columns:1fr; }
    .gallery-archive-grid { grid-template-columns:1fr; }
    .gallery-archive-title { align-items:flex-start; flex-direction:column; }
    .public-float-dock { display:none; }
    .chat-widget { right:12px !important; left:12px !important; bottom:82px !important; width:auto !important; }
    .c555-promo { left:10px !important; right:10px !important; bottom:82px !important; width:auto !important; }
    .mobile-cta-bar { position:fixed !important; }
    .site-footer { padding-top:52px; }
}

@media (max-width: 420px) {
    .header-actions .theme-toggle { display:none; }
    .hero-actions { grid-template-columns:1fr; }
    .hero-actions .btn-outline { display:none; }
    .auto-carousel-rail, .results-rail, .home-doctors-shell .auto-carousel-rail, .testimonials-rail { grid-auto-columns: 92%; }
}

@media (prefers-reduced-motion: reduce) {
    .auto-carousel-rail { scroll-behavior:auto; }
    .public-float-dock *, .c555-promo * { animation:none !important; }
}


/* تکمیل پولیش v3.1 */
.testimonial-card { display:flex; flex-direction:column; }
.testimonial-card > p { flex:1; font-size:1rem; line-height:2.05; }
.testimonial-card footer { display:grid; grid-template-columns:1fr auto; gap:4px 12px; align-items:center; border-top:1px solid rgba(14,137,126,.12); padding-top:18px; }
.testimonial-card footer strong, .testimonial-card footer span { min-width:0; }
.testimonial-card__source { grid-column:1 / -1; }
.testimonial-card__date { color:var(--v3-muted); font-size:.72rem; }
.testimonial-consent-note { display:flex; align-items:center; justify-content:center; gap:7px; margin:18px 0 0; color:var(--v3-muted); font-size:.8rem; }
.gallery-archive-title > p { margin:0; color:var(--v3-muted); }
.gallery-note { margin-top:28px; }
.methods-carousel .auto-carousel-rail { grid-auto-columns:minmax(300px,31.5%); }
.results-lightbox[aria-hidden="true"] { display:none; }
.results-lightbox.is-open { display:grid; }

/* جلوگیری از ورود عناصر کمکی و لایه‌های مخفی به جریان صفحه */
body.site-public > .public-float-dock,
body.site-public > .chat-widget,
body.site-public > .app-modal,
body.site-public > .cookie-banner,
body.site-public > .mobile-cta-bar,
body.site-public > .c555-promo,
body.site-public > .results-lightbox { position:fixed !important; }
body.site-public > [hidden] { display:none !important; }

/* کنتراست کامل تم شب برای اجزایی که در نسخه قبل روشن باقی می‌ماندند */
html[data-theme="dark"] .methods,
html[data-theme="dark"] .gallery,
html[data-theme="dark"] .doctors,
html[data-theme="dark"] .testimonials { color:#E8F0EE; }
html[data-theme="dark"] .filter-tab { color:#C9D8D5; border-color:rgba(255,255,255,.10); background:#101B19; }
html[data-theme="dark"] .filter-tab.active { color:#fff; background:var(--v3-primary); border-color:var(--v3-primary); }
html[data-theme="dark"] .method-card__icon { color:#52C4B7; background:rgba(14,137,126,.14); border-color:rgba(82,196,183,.30); }
html[data-theme="dark"] .result-card__details,
html[data-theme="dark"] .result-card__body > p,
html[data-theme="dark"] .carousel-status,
html[data-theme="dark"] .testimonial-consent-note,
html[data-theme="dark"] .gallery-archive-title > p { color:#A8BAB6; }
html[data-theme="dark"] .testimonial-card footer { border-color:rgba(255,255,255,.08); }
html[data-theme="dark"] .home-doctor-card .doctor-avatar { border-color:#14211F; }
html[data-theme="dark"] .home-doctor-card { background:radial-gradient(circle at 50% 12%,rgba(14,137,126,.14),transparent 30%),linear-gradient(145deg,#111D1B,#0C1615); }
html[data-theme="dark"] .results-lightbox { background:rgba(2,8,7,.94); }

@media (max-width:760px) {
    .testimonial-card { min-height:300px; padding:24px 20px; }
    .methods-carousel .auto-carousel-rail { grid-auto-columns:88%; }
    .gallery-filter-tabs { justify-content:flex-start; flex-wrap:nowrap; overflow-x:auto; padding-bottom:8px; scrollbar-width:none; }
    .gallery-filter-tabs::-webkit-scrollbar { display:none; }
}

.booking-form .form-row > label, .booking-form > label { display:block; min-width:0; }
.booking-form .form-row > label input { margin-bottom:0; }
.booking-form fieldset.form-field-group { min-width:0; padding:0; border:0; }
.booking-form fieldset.form-field-group legend { padding:0; }


/* ============================================================
   v3.2 — ریل‌های دستی، پزشکان ثابت و تکمیل تم شب
   ============================================================ */
.carousel-status,
.auto-carousel-shell::after,
.auto-carousel-rail::after,
.results-rail.is-paused::after { display:none !important; content:none !important; }

.home-doctors-grid {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:24px;
    align-items:stretch;
}
.home-doctors-grid .home-doctor-card { min-width:0; width:100%; height:100%; }

/* تنظیم پایه ریل‌ها؛ موتور حلقه‌ای v3.4 در انتهای فایل اعمال می‌شود. */
.auto-carousel-rail,
.results-rail,
.testimonials-rail,
.methods-scroll {
    direction:rtl;
    overscroll-behavior-inline:contain;
    scroll-behavior:smooth;
    touch-action:pan-x pan-y;
}

/* تم شب کامل برای کامپوننت‌هایی که در فایل‌های قدیمی رنگ سفید ثابت داشتند */
html[data-theme="dark"] {
    --ux-ink:#EAF2F0;
    --ux-muted:#A8BAB6;
    --ux-line:rgba(255,255,255,.10);
    --ux-soft:#101B19;
    --ux-shadow:0 18px 50px rgba(0,0,0,.30);
}
html[data-theme="dark"] .doctors-intro-strip,
html[data-theme="dark"] .doctor-directory-card,
html[data-theme="dark"] .doctor-profile-page,
html[data-theme="dark"] .doctor-profile-hero__media,
html[data-theme="dark"] .doctor-profile-facts span,
html[data-theme="dark"] .doctor-anchor-nav,
html[data-theme="dark"] .doctor-content-card,
html[data-theme="dark"] .doctor-booking-card,
html[data-theme="dark"] .doctor-note,
html[data-theme="dark"] .doctor-related-card,
html[data-theme="dark"] .gallery-context-banner,
html[data-theme="dark"] .result-card,
html[data-theme="dark"] .gallery-note,
html[data-theme="dark"] .gallery-archive-card,
html[data-theme="dark"] .service-card,
html[data-theme="dark"] .device-card,
html[data-theme="dark"] .blog-card,
html[data-theme="dark"] .testimonial-card,
html[data-theme="dark"] .booking-form,
html[data-theme="dark"] .contact-card,
html[data-theme="dark"] .value-box,
html[data-theme="dark"] .faq-item,
html[data-theme="dark"] details,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .content-card,
html[data-theme="dark"] .article-body,
html[data-theme="dark"] .post-content {
    background:#101B19 !important;
    color:#EAF2F0 !important;
    border-color:rgba(255,255,255,.10) !important;
}
html[data-theme="dark"] .doctor-profile-page { background:linear-gradient(#08100F,#0A1413 580px) !important; }
html[data-theme="dark"] .doctor-profile-hero__media { border-color:#14211F !important; }
html[data-theme="dark"] .doctor-directory-card__media,
html[data-theme="dark"] .doctor-action-grid figure,
html[data-theme="dark"] .result-card__image,
html[data-theme="dark"] .gallery-archive-card__image { background:#0A1413 !important; }
html[data-theme="dark"] .doctor-directory-card__media em,
html[data-theme="dark"] .doctor-kicker {
    background:#182321 !important;
    color:#E4BC75 !important;
    border-color:rgba(213,160,76,.35) !important;
}
html[data-theme="dark"] .doctor-anchor-nav { background:rgba(8,16,15,.92) !important; }
html[data-theme="dark"] .gallery-note { color:#D9C29B !important; }
html[data-theme="dark"] .results-control,
html[data-theme="dark"] .carousel-control { background:#14211F !important; color:#EAF2F0 !important; }
html[data-theme="dark"] .results-control:hover,
html[data-theme="dark"] .carousel-control:hover { background:var(--v3-primary) !important; color:#fff !important; }
html[data-theme="dark"] table,
html[data-theme="dark"] th,
html[data-theme="dark"] td { border-color:rgba(255,255,255,.10) !important; }
html[data-theme="dark"] th { background:#14211F !important; color:#EAF2F0 !important; }
html[data-theme="dark"] option { background:#0A1413; color:#EAF2F0; }
html[data-theme="dark"] hr { border-color:rgba(255,255,255,.10); }

@media (max-width:1100px) {
    .home-doctors-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:760px) {
    .home-doctors-grid { grid-template-columns:1fr; gap:16px; }
    .home-doctors-grid .home-doctor-card { min-height:auto; }
}

html[data-theme="dark"] .c555-promo__link {
    background:radial-gradient(circle at 10% 10%,rgba(213,160,76,.10),transparent 32%),linear-gradient(135deg,#14211F,#0B1514) !important;
    color:#EAF2F0 !important;
    border-color:rgba(82,196,183,.22) !important;
}
html[data-theme="dark"] .c555-promo__title { color:#7DD1C7 !important; }
html[data-theme="dark"] .c555-promo__prize { color:#B9CAC6 !important; }
html[data-theme="dark"] .c555-promo__close { background:#14211F !important; color:#C9D8D5 !important; }
html[data-theme="dark"] .section-alt,
html[data-theme="dark"] .page-header,
html[data-theme="dark"] .booking-cta { background-color:#0A1413 !important; }

/* ============================================================
   v3.3 — Carousel افقی خودکار، چیدمان کامل تجهیزات، کنترل‌های
   شناور دوطرفه و تکمیل سراسری Dark Mode
   ============================================================ */

/* هیچ متن وضعیت یا برچسب توضیحی زیر Carousel نمایش داده نشود. */
.carousel-status,
.carousel-helper,
.carousel-autoplay-label,
.auto-carousel-shell::after,
.auto-carousel-rail::after,
.results-rail::after,
.results-rail.is-paused::after {
    display: none !important;
    content: none !important;
}

/* مکانیک Scroll در همه مرورگرها LTR است؛ محتوای داخل کارت‌ها RTL می‌ماند.
   در نتیجه افزایش scrollLeft فقط محتوای ریل را از راست به چپ حرکت می‌دهد
   و هیچ تغییری در اسکرول عمودی صفحه رخ نمی‌دهد. */
.auto-carousel-rail,
.results-rail,
.testimonials-rail,
.methods-scroll {
    direction: ltr !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: none;
    touch-action: pan-x pan-y;
    scrollbar-width: none;
}
.auto-carousel-rail > *,
.results-rail > *,
.testimonials-rail > *,
.methods-scroll > * {
    direction: rtl;
    scroll-snap-align: start;
}
.auto-carousel-rail::-webkit-scrollbar,
.results-rail::-webkit-scrollbar,
.testimonials-rail::-webkit-scrollbar,
.methods-scroll::-webkit-scrollbar { display:none; }
.carousel-control[hidden] { display:none !important; }

/* تجهیزات صفحه اصلی: ۸ کارت در ۴ ستون و سپس ۲ ستون؛ هیچ ردیف تک‌کارت
   یا جای خالی سه‌ستونه ایجاد نمی‌شود. */
.page-index .devices-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 20px !important;
}
@media (max-width: 1100px) {
    .page-index .devices-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 580px) {
    .page-index .devices-grid { grid-template-columns: 1fr !important; }
}

/* تماس در راست، پشتیبانی در چپ؛ اعلان کمپین بالای پشتیبانی. */
.public-float-dock {
    position: fixed !important;
    inset: 0 !important;
    width: 0 !important;
    height: 0 !important;
    display: block !important;
    z-index: 990 !important;
    pointer-events: none !important;
}
.public-float-dock .call-float,
.public-float-dock .support-float {
    position: fixed !important;
    margin: 0 !important;
    pointer-events: auto !important;
}
.public-float-dock .call-float {
    right: 22px !important;
    left: auto !important;
    bottom: 22px !important;
}
.public-float-dock .support-float {
    left: 22px !important;
    right: auto !important;
    bottom: 22px !important;
}
.public-float-dock .support-float__label {
    left: 68px !important;
    right: auto !important;
}
.chat-widget {
    left: 22px !important;
    right: auto !important;
    bottom: 92px !important;
}
.c555-promo {
    left: 22px !important;
    right: auto !important;
    bottom: 98px !important;
}

/* Dark Mode: متغیرهای پایه */
html[data-theme="dark"] {
    color-scheme: dark;
    --color-bg: #08100F;
    --color-bg-alt: #0A1413;
    --color-bg-deep: #07100F;
    --color-surface: #101B19;
    --color-surface-2: #14211F;
    --color-primary: #F1F7F5;
    --color-text: #EAF2F0;
    --color-text-muted: #A8BAB6;
    --color-text-soft: #829793;
    --color-border: rgba(255,255,255,.10);
    --color-border-soft: rgba(255,255,255,.07);
    --color-header-bg: rgba(8,16,15,.92);
    --campaign-cream: #08100F;
    --campaign-white: #101B19;
    --campaign-ink: #EAF2F0;
    --campaign-muted: #A8BAB6;
    --campaign-teal-soft: rgba(14,137,126,.14);
    --campaign-gold-soft: rgba(213,160,76,.12);
    --campaign-line: rgba(255,255,255,.10);
    --campaign-line-gold: rgba(213,160,76,.30);
}
html[data-theme="dark"] body.site-public {
    background:
        radial-gradient(circle at 9% 4%, rgba(213,160,76,.055), transparent 24rem),
        radial-gradient(circle at 91% 18%, rgba(14,137,126,.08), transparent 28rem),
        #08100F !important;
    color: #EAF2F0 !important;
}
html[data-theme="dark"] body.site-public::before {
    background-image:
        linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px) !important;
}
html[data-theme="dark"] .section,
html[data-theme="dark"] .director-section,
html[data-theme="dark"] .methods,
html[data-theme="dark"] .treatment-feature,
html[data-theme="dark"] .dr-action,
html[data-theme="dark"] .staff,
html[data-theme="dark"] .services,
html[data-theme="dark"] .devices,
html[data-theme="dark"] .gallery,
html[data-theme="dark"] .doctors,
html[data-theme="dark"] .doctor-videos,
html[data-theme="dark"] .testimonials,
html[data-theme="dark"] .blog {
    background-color: transparent !important;
    color: #EAF2F0 !important;
}
html[data-theme="dark"] .section-alt {
    background:
        radial-gradient(circle at 12% 0, rgba(213,160,76,.045), transparent 24rem),
        linear-gradient(180deg, rgba(13,25,23,.94), rgba(8,16,15,.98)) !important;
    border-color: rgba(255,255,255,.07) !important;
}

/* تمام Surfaceهای اصلی صفحه‌ها */
html[data-theme="dark"] :is(
    .auto-carousel-shell,
    .trust-card,
    .director-inner,
    .director-photo,
    .director-content,
    .method-card,
    .treatment-feature__inner,
    .treatment-feature__chip,
    .dr-action__card,
    .staff-card,
    .service-card,
    .device-card,
    .result-card,
    .home-doctor-card,
    .doctor-video-card,
    .testimonial-card,
    .blog-card,
    .booking-form,
    .booking-form-page,
    .contact-item,
    .contact-card,
    .value-box,
    .faq-item,
    .content-card,
    .article-body,
    .post-content,
    .table-wrap,
    .doctor-directory-card,
    .doctor-content-card,
    .doctor-booking-card,
    .doctor-related-card,
    .gallery-context-banner,
    .gallery-archive-card
) {
    background-color: #101B19 !important;
    background-image: none !important;
    color: #EAF2F0 !important;
    border-color: rgba(255,255,255,.10) !important;
    box-shadow: 0 18px 50px rgba(0,0,0,.24) !important;
}
html[data-theme="dark"] .home-doctor-card {
    background:
        radial-gradient(circle at 50% 12%, rgba(14,137,126,.14), transparent 30%),
        linear-gradient(145deg,#111D1B,#0C1615) !important;
}
html[data-theme="dark"] :is(
    .section-title,.page-title,.hero-title,.director-lead,
    .trust-card__title,.method-card__title,.service-title,.device-card__name,
    .result-card__head h2,.doctor-name,.doctor-video-card__title,.blog-title,
    .booking-form h2,.footer-title
) { color:#F1F7F5 !important; }
html[data-theme="dark"] :is(
    .section-desc,.hero-desc,.director-text,.trust-card__text,.method-card__desc,
    .treatment-feature__desc,.staff-card__text,.service-desc,.device-card__desc,
    .result-card__details,.doctor-specialty,.doctor-video-card__desc,.blog-excerpt,
    .testimonial-consent-note,.form-note
) { color:#A8BAB6 !important; }
html[data-theme="dark"] .section-eyebrow,
html[data-theme="dark"] .page-eyebrow,
html[data-theme="dark"] .device-hero__eyebrow {
    color:#E4BC75 !important;
    background:linear-gradient(135deg,rgba(20,33,31,.98),rgba(40,31,19,.88)) !important;
    border-color:rgba(213,160,76,.30) !important;
    box-shadow:none !important;
}
html[data-theme="dark"] :is(input, textarea, select) {
    background:#0A1413 !important;
    color:#EAF2F0 !important;
    border-color:rgba(255,255,255,.12) !important;
}
html[data-theme="dark"] :is(input,textarea)::placeholder { color:#718783 !important; opacity:1; }
html[data-theme="dark"] .site-header {
    background:rgba(8,16,15,.92) !important;
    border-bottom-color:rgba(255,255,255,.08) !important;
}
html[data-theme="dark"] .site-header.is-scrolled { background:rgba(8,16,15,.98) !important; }
html[data-theme="dark"] .main-nav a { color:#C9D8D5 !important; }
html[data-theme="dark"] .main-nav a:hover,
html[data-theme="dark"] .main-nav a.active { color:#7DD1C7 !important; background:rgba(14,137,126,.13) !important; }
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .btn-account { background:#14211F !important; color:#EAF2F0 !important; border-color:rgba(255,255,255,.10) !important; }
html[data-theme="dark"] .clinic-signature-bar { background:rgba(10,20,19,.88) !important; border-color:rgba(255,255,255,.07) !important; }
html[data-theme="dark"] .clinic-signature-bar__inner b { color:#EAF2F0 !important; }
html[data-theme="dark"] .clinic-signature-bar__inner small { color:#9DB0AC !important; }
html[data-theme="dark"] .site-footer { background:#07100F !important; border-color:rgba(255,255,255,.08) !important; }
html[data-theme="dark"] .footer-bottom { border-color:rgba(255,255,255,.08) !important; }
html[data-theme="dark"] .carousel-control { background:#14211F !important; color:#EAF2F0 !important; border-color:rgba(255,255,255,.11) !important; }
html[data-theme="dark"] .carousel-control:hover { background:var(--v3-primary) !important; color:#fff !important; }
html[data-theme="dark"] .gallery-archive-card__image,
html[data-theme="dark"] .result-card__image,
html[data-theme="dark"] .device-card__media,
html[data-theme="dark"] .doctor-video-card__media { background:#0A1413 !important; }

@media (max-width: 760px) {
    .public-float-dock { display:none !important; }
    .c555-promo { left:10px !important; right:10px !important; bottom:82px !important; width:auto !important; }
    .chat-widget { left:12px !important; right:12px !important; bottom:82px !important; width:auto !important; }
}

@media (prefers-reduced-motion: reduce) {
    .auto-carousel-rail,
    .results-rail,
    .testimonials-rail,
    .methods-scroll { scroll-behavior:auto !important; }
}

/* v3.3.1 — ریل‌های خودکار پیوسته، بدون درگیری Scroll Snap */
.auto-carousel-shell[data-autoplay="true"] .auto-carousel-rail {
    scroll-snap-type: none !important;
    scroll-behavior: auto !important;
}
.auto-carousel-rail [data-carousel-clone="true"] {
    pointer-events: auto;
}

/* ============================================================
   v3.4 — Carousel حلقه‌ای بدون فضای خالی + نقشه تماس
   ============================================================ */
.auto-carousel-rail,
.results-rail,
.testimonials-rail,
.methods-scroll {
    position: relative !important;
    display: block !important;
    direction: ltr !important;
    overflow: hidden !important;
    scroll-snap-type: none !important;
    scroll-behavior: auto !important;
    overscroll-behavior: contain;
    touch-action: pan-y;
    cursor: grab;
    padding: 4px 4px 12px !important;
}
.auto-carousel-rail.is-dragging { cursor: grabbing; user-select: none; }
.auto-carousel-source { display: none !important; }
.auto-carousel-track {
    display: flex;
    align-items: stretch;
    width: max-content;
    min-width: 100%;
    will-change: transform;
    backface-visibility: hidden;
    transform: translate3d(0,0,0);
}
.auto-carousel-group {
    display: flex;
    flex: 0 0 auto;
    align-items: stretch;
    gap: 18px;
    padding-right: 18px;
}
.auto-carousel-group > * {
    direction: rtl;
    flex: 0 0 var(--carousel-card-width, clamp(300px, 30vw, 390px));
    width: var(--carousel-card-width, clamp(300px, 30vw, 390px));
    min-width: 0 !important;
    scroll-snap-align: none !important;
}
.methods-carousel { --carousel-card-width: clamp(300px, 30vw, 390px); }
.results-shell { --carousel-card-width: clamp(310px, 30.5vw, 405px); }
.testimonials-shell { --carousel-card-width: clamp(315px, 30.5vw, 410px); }
.auto-carousel-shell.is-empty-carousel { display:none !important; }
.auto-carousel-group--duplicate [data-carousel-copy="true"] { pointer-events:auto; }

@media (max-width: 980px) {
    .auto-carousel-group { gap: 14px; padding-right: 14px; }
    .methods-carousel,
    .results-shell,
    .testimonials-shell { --carousel-card-width: min(72vw, 360px); }
}
@media (max-width: 620px) {
    .auto-carousel-rail,
    .results-rail,
    .testimonials-rail,
    .methods-scroll { padding-inline: 0 !important; }
    .auto-carousel-group { gap: 12px; padding-right: 12px; }
    .methods-carousel,
    .results-shell,
    .testimonials-shell { --carousel-card-width: min(86vw, 340px); }
}
@media (prefers-reduced-motion: reduce) {
    .auto-carousel-track { will-change:auto; }
}

/* نقشه‌ی واقعی کلینیک در صفحه تماس */
.contact-map-card {
    margin-top: 48px;
    overflow: hidden;
    border: 1px solid rgba(14,137,126,.16);
    border-radius: 28px;
    background: rgba(255,255,255,.88);
    box-shadow: var(--v3-shadow-sm);
}
.contact-map-card__head {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    padding:24px 26px;
    border-bottom:1px solid rgba(14,137,126,.12);
}
.contact-map-card__title { margin:0 0 7px; font-size:1.25rem; color:var(--v3-ink); }
.contact-map-card__text { margin:0; color:var(--v3-muted); line-height:1.9; }
.contact-map-card__action { white-space:nowrap; }
.contact-map-card__frame {
    position:relative;
    min-height:420px;
    background:#E8F1EF;
}
.contact-map-card__frame iframe {
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    border:0;
    display:block;
}
html[data-theme="dark"] .contact-map-card {
    background:#101B19 !important;
    border-color:rgba(255,255,255,.10) !important;
}
html[data-theme="dark"] .contact-map-card__head { border-color:rgba(255,255,255,.08) !important; }
html[data-theme="dark"] .contact-map-card__title { color:#EAF2F0 !important; }
html[data-theme="dark"] .contact-map-card__text { color:#A8BAB6 !important; }
html[data-theme="dark"] .contact-map-card__frame iframe {
    filter: grayscale(.15) invert(.91) hue-rotate(168deg) saturate(.72) contrast(.92);
}
@media (max-width:760px) {
    .contact-map-card { margin-top:32px; border-radius:22px; }
    .contact-map-card__head { align-items:flex-start; flex-direction:column; padding:20px; }
    .contact-map-card__action { width:100%; }
    .contact-map-card__frame { min-height:340px; }
}

/* کارت اعتماد نویسنده برای موج انتشار مقالات */
.article-author-trust {
    display:grid;
    grid-template-columns:88px minmax(0,1fr) auto;
    align-items:center;
    gap:18px;
    margin:32px 0;
    padding:20px;
    border:1px solid rgba(14,137,126,.16);
    border-radius:20px;
    background:linear-gradient(135deg,rgba(14,137,126,.06),rgba(213,160,76,.06));
}
.article-author-trust__photo { width:88px;height:88px;object-fit:cover;border-radius:50%;border:3px solid #fff;box-shadow:0 10px 24px rgba(16,58,54,.14); }
.article-author-trust__eyebrow { display:block;margin-bottom:4px;color:var(--v3-primary);font-size:.78rem;font-weight:850; }
.article-author-trust h2 { margin:0 0 5px;font-size:1.12rem;color:var(--v3-ink); }
.article-author-trust p { margin:0;color:var(--v3-muted);font-size:.9rem;line-height:1.9; }
.article-author-trust__link { white-space:nowrap; }
html[data-theme="dark"] .article-author-trust { background:linear-gradient(135deg,#101B19,#14211F) !important;border-color:rgba(255,255,255,.10) !important; }
html[data-theme="dark"] .article-author-trust__photo { border-color:#22302D; }
html[data-theme="dark"] .article-author-trust h2 { color:#EAF2F0 !important; }
html[data-theme="dark"] .article-author-trust p { color:#A8BAB6 !important; }
@media(max-width:760px){.article-author-trust{grid-template-columns:70px minmax(0,1fr);padding:16px}.article-author-trust__photo{width:70px;height:70px}.article-author-trust__link{grid-column:1/-1;width:100%}}

/* منابع قابل‌مشاهده مقالات پویا؛ هماهنگ با citation در Schema */
.article-references {
    margin-top: 30px;
    padding: 22px 24px;
    border: 1px solid rgba(14,137,126,.15);
    border-radius: 18px;
    background: rgba(14,137,126,.035);
}
.article-references ol { margin: 14px 0 0; padding-right: 22px; }
.article-references li { margin: 9px 0; line-height: 1.9; overflow-wrap: anywhere; }
.article-references a { color: var(--v3-primary); text-decoration: underline; text-underline-offset: 4px; }
html[data-theme="dark"] .article-references {
    background: #101B19 !important;
    border-color: rgba(255,255,255,.10) !important;
    color: #DCE8E5 !important;
}
html[data-theme="dark"] .article-references a { color: #7DD1C7 !important; }

/* ==========================================================
   V3.4.1 — کتابخانه تصاویر واقعی دکتر مظلومی
   ========================================================== */
.device-hero__media--clinical {
    position: relative;
    min-height: clamp(360px, 48vw, 610px);
    overflow: hidden;
    border-radius: 30px;
    background: #dfeae8;
}
.device-hero__media--clinical > img {
    width: 100%;
    height: 100%;
    min-height: inherit;
    object-fit: cover;
    object-position: center 28%;
    display: block;
}
.clinical-photo-badge {
    position: absolute;
    inset-inline-start: 18px;
    bottom: 18px;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .58rem .82rem;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 999px;
    background: rgba(7,43,39,.78);
    backdrop-filter: blur(12px);
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
    box-shadow: 0 10px 28px rgba(0,0,0,.18);
    z-index: 2;
}
.clinical-photo-context {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    margin: 0 0 1.4rem;
    padding: .9rem 1rem;
    border: 1px solid rgba(14,137,126,.16);
    border-inline-start: 4px solid var(--color-primary, #0E897E);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(14,137,126,.07), rgba(213,160,76,.055));
    color: var(--color-text-muted, #5e6b69);
}
.clinical-photo-context i { color: var(--color-primary, #0E897E); font-size: 1.25rem; margin-top: .15rem; }
.clinical-photo-context p { margin: 0; line-height: 1.9; }

.doctor-context-figure {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(250px, .95fr);
    align-items: stretch;
    min-height: 430px;
    margin-block: 2rem;
    background:
        radial-gradient(circle at 100% 0, rgba(213,160,76,.13), transparent 42%),
        linear-gradient(145deg, #f7fbfa, #fff);
    box-shadow: 0 18px 45px rgba(16,54,48,.08);
}
.doctor-context-figure__media { position: relative; min-height: 430px; overflow: hidden; }
.doctor-context-figure__media img {
    width: 100%;
    height: 100%;
    min-height: 430px;
    object-fit: cover;
    object-position: center 30%;
}
.doctor-context-figure figcaption {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: .7rem;
    padding: clamp(1.4rem, 3vw, 2.35rem);
    text-align: right;
    border-top: 0;
    border-inline-start: 1px solid var(--color-border, #dce7e5);
}
.doctor-context-figure figcaption strong {
    color: var(--color-text, #172321);
    font-size: clamp(1.15rem, 2vw, 1.5rem);
}
.doctor-context-figure figcaption span { color: var(--color-text-muted, #5e6b69); line-height: 2; }
.doctor-context-figure figcaption small {
    display: block;
    padding-top: .75rem;
    border-top: 1px solid var(--color-border, #dce7e5);
    color: var(--color-text-soft, #73817e);
    line-height: 1.8;
}

.doctor-gallery-intro { margin-top: -.35rem; }
.doctor-media-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin: 1.2rem 0 1.35rem;
}
.doctor-media-filters button {
    min-height: 42px;
    padding: .58rem .86rem;
    border: 1px solid var(--ux-line, #dce7e5);
    border-radius: 999px;
    background: #fff;
    color: var(--ux-muted, #5e6b69);
    font: inherit;
    font-size: .82rem;
    font-weight: 800;
    cursor: pointer;
    transition: .2s ease;
}
.doctor-media-filters button:hover,
.doctor-media-filters button.is-active {
    border-color: var(--ux-teal, #0E897E);
    background: var(--ux-teal, #0E897E);
    color: #fff;
    box-shadow: 0 8px 20px rgba(14,137,126,.18);
}
.doctor-action-grid--rich { grid-template-columns: repeat(3, minmax(0,1fr)); gap: .85rem; }
.doctor-action-grid--rich figure {
    position: relative;
    border: 1px solid var(--ux-line, #dce7e5);
    background: #fff;
    transition: transform .22s ease, box-shadow .22s ease, opacity .18s ease;
}
.doctor-action-grid--rich figure[hidden] { display: none !important; }
.doctor-action-grid--rich figure:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(16,54,48,.10); }
.doctor-action-grid--rich img { aspect-ratio: 3 / 4; object-position: center 28%; }
.doctor-action-grid--rich figcaption { min-height: 68px; display: flex; align-items: center; line-height: 1.75; }
.doctor-gallery-note {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    margin: 1.2rem 0 0 !important;
    padding: .85rem 1rem;
    border-radius: 14px;
    background: var(--ux-soft, #f4f9f8);
    font-size: .85rem;
}
.doctor-gallery-note i { color: var(--ux-teal, #0E897E); font-size: 1.15rem; margin-top: .15rem; }

.doctor-story-section { overflow: hidden; }
.doctor-story-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    grid-auto-rows: 310px;
    gap: 1rem;
}
.doctor-story-card {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    color: #fff;
    background: #153c37;
    box-shadow: 0 14px 34px rgba(16,54,48,.12);
}
.doctor-story-card:first-child { grid-row: span 2; }
.doctor-story-card:nth-child(4) { grid-column: span 2; }
.doctor-story-card img { width: 100%; height: 100%; object-fit: cover; object-position: center 28%; transition: transform .5s ease; }
.doctor-story-card:after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(3,29,26,.88));
}
.doctor-story-card > div {
    position: absolute;
    z-index: 2;
    inset-inline: 1rem;
    bottom: 1rem;
    display: grid;
    gap: .25rem;
}
.doctor-story-card strong { font-size: 1.05rem; }
.doctor-story-card span { color: rgba(255,255,255,.82); font-size: .82rem; line-height: 1.65; }
.doctor-story-card:hover img { transform: scale(1.04); }

.detail-hero-image--clinical { max-height: 690px; overflow: hidden; }
.detail-hero-image--clinical img { width: 100%; height: min(68vw, 690px); object-fit: cover; object-position: center 28%; }
.blog-image.has-photo img { object-position: center 28%; }

html[data-theme="dark"] .clinical-photo-context,
html[data-theme="dark"] .doctor-context-figure,
html[data-theme="dark"] .doctor-action-grid--rich figure,
html[data-theme="dark"] .doctor-media-filters button {
    background: #10201e;
    border-color: rgba(143,190,183,.18);
}
html[data-theme="dark"] .clinical-photo-context,
html[data-theme="dark"] .doctor-context-figure figcaption span,
html[data-theme="dark"] .doctor-context-figure figcaption small,
html[data-theme="dark"] .doctor-media-filters button,
html[data-theme="dark"] .doctor-action-grid--rich figcaption { color: #aebdb9; }
html[data-theme="dark"] .doctor-context-figure figcaption strong { color: #f4f8f7; }
html[data-theme="dark"] .doctor-media-filters button.is-active,
html[data-theme="dark"] .doctor-media-filters button:hover { color: #fff; background: #0E897E; }
html[data-theme="dark"] .doctor-gallery-note { background: #0d1b19; color: #aebdb9; }

@media (max-width: 980px) {
    .doctor-action-grid--rich { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .doctor-story-grid { grid-template-columns: repeat(2,minmax(0,1fr)); grid-auto-rows: 290px; }
    .doctor-story-card:nth-child(4) { grid-column: auto; }
}
@media (max-width: 760px) {
    .device-hero__media--clinical { min-height: 400px; }
    .doctor-context-figure { grid-template-columns: 1fr; min-height: 0; }
    .doctor-context-figure__media,
    .doctor-context-figure__media img { min-height: 440px; }
    .doctor-context-figure figcaption { border-inline-start: 0; border-top: 1px solid var(--color-border, #dce7e5); }
    .doctor-action-grid--rich { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .doctor-story-grid { grid-template-columns: 1fr; grid-auto-rows: 380px; }
    .doctor-story-card:first-child { grid-row: auto; }
}
@media (max-width: 520px) {
    .doctor-action-grid--rich { grid-template-columns: 1fr; }
    .doctor-media-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; }
    .doctor-media-filters button { white-space: nowrap; }
    .doctor-context-figure__media,
    .doctor-context-figure__media img { min-height: 380px; }
    .doctor-story-grid { grid-auto-rows: 340px; }
}

/* ============================================================
   v3.4.2 — هدر ثابت کامل + Carousel حلقه‌ای پایدار
   ============================================================ */
.site-nav-stack {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    width: 100%;
    isolation: isolate;
}
.site-nav-stack .site-header {
    position: relative !important;
    top: auto !important;
    z-index: 2;
}
.site-nav-stack .clinic-signature-bar {
    position: relative;
    z-index: 1;
}

/* کارت‌های اصلی همیشه قابل مشاهده می‌مانند؛ JavaScript فقط نسخه‌های کمکی
   قبل و بعد را اضافه می‌کند. این ساختار Fail-safe است و کادر خالی نمی‌شود. */
.auto-carousel-rail,
.results-rail,
.testimonials-rail,
.methods-scroll {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 18px !important;
    direction: ltr !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: none !important;
    scroll-behavior: auto !important;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: none;
    touch-action: pan-y;
    scrollbar-width: none;
    cursor: grab;
    padding: 4px 4px 12px !important;
}
.auto-carousel-rail::-webkit-scrollbar,
.results-rail::-webkit-scrollbar,
.testimonials-rail::-webkit-scrollbar,
.methods-scroll::-webkit-scrollbar { display: none !important; }
.auto-carousel-rail.is-dragging,
.results-rail.is-dragging,
.testimonials-rail.is-dragging,
.methods-scroll.is-dragging {
    cursor: grabbing;
    user-select: none;
}
.auto-carousel-rail > *,
.results-rail > *,
.testimonials-rail > *,
.methods-scroll > * {
    direction: rtl;
    flex: 0 0 var(--carousel-card-width, clamp(300px, 30vw, 390px)) !important;
    width: var(--carousel-card-width, clamp(300px, 30vw, 390px)) !important;
    min-width: 0 !important;
    scroll-snap-align: none !important;
}
.methods-carousel { --carousel-card-width: clamp(300px, 30vw, 390px); }
.results-shell { --carousel-card-width: clamp(310px, 30.5vw, 405px); }
.testimonials-shell { --carousel-card-width: clamp(315px, 30.5vw, 410px); }
.auto-carousel-track,
.auto-carousel-source { display: none !important; }
.auto-carousel-shell.is-empty-carousel { display: none !important; }
.auto-carousel-rail [data-carousel-copy="true"] { pointer-events: auto; }

@media (max-width: 980px) {
    .auto-carousel-rail,
    .results-rail,
    .testimonials-rail,
    .methods-scroll { gap: 14px !important; }
    .methods-carousel,
    .results-shell,
    .testimonials-shell { --carousel-card-width: min(72vw, 360px); }
}
@media (max-width: 820px) {
    .site-nav-stack { top: 0; }
}
@media (max-width: 620px) {
    .auto-carousel-rail,
    .results-rail,
    .testimonials-rail,
    .methods-scroll {
        gap: 12px !important;
        padding-inline: 0 !important;
    }
    .methods-carousel,
    .results-shell,
    .testimonials-shell { --carousel-card-width: min(86vw, 340px); }
}
@media (prefers-reduced-motion: reduce) {
    .auto-carousel-rail,
    .results-rail,
    .testimonials-rail,
    .methods-scroll { scroll-behavior: auto !important; }
}


/* Hair-loss content pack v3.5.0 */
.content-draft-banner{position:relative;z-index:3;display:flex;align-items:center;justify-content:center;gap:.55rem;padding:.8rem 1rem;background:#fff3d7;color:#69480e;border-block:1px solid #e8c879;font-weight:800}
.page-header--medical-content{background:radial-gradient(circle at 85% 10%,rgba(14,137,126,.15),transparent 36%),linear-gradient(135deg,var(--color-bg,#fff),var(--color-bg-deep,#f4f8f7))}
.detail-hero-image--hairloss{aspect-ratio:16/9;max-height:680px;background:#e9f3f1}
.detail-hero-image--hairloss img{width:100%;height:100%;object-fit:cover}
.detail-hero-image--hairloss figcaption{padding:.8rem 1rem;background:var(--color-surface,#fff);color:var(--color-text-muted,#5f6f6c);font-size:.9rem;border-top:1px solid var(--color-border,#dce8e5)}
.hairloss-article{--hl-green:#0e897e;--hl-green-dark:#09665e;--hl-gold:#d5a04c;--hl-soft:#eef8f6;--hl-warn:#fff6df;line-height:2.15;font-size:clamp(1rem,.95rem + .18vw,1.12rem);overflow-wrap:anywhere}
.hairloss-article [id]{scroll-margin-top:190px}
.hairloss-article h2{margin:3.2rem 0 1.15rem;padding:.85rem 1rem;border-right:4px solid var(--hl-green);border-radius:12px;background:linear-gradient(90deg,transparent,var(--hl-soft));font-size:clamp(1.35rem,2.4vw,2rem);line-height:1.55;color:var(--color-text,#17312d)}
.hairloss-article h3{margin:2.1rem 0 .85rem;color:var(--hl-green-dark);font-size:clamp(1.12rem,1.8vw,1.4rem)}
.hairloss-article h4{margin:1.65rem 0 .65rem;color:var(--color-text,#17312d)}
.hairloss-article p{margin:0 0 1.15rem}
.hairloss-article ul,.hairloss-article ol{padding-right:1.4rem;margin:0 0 1.4rem}
.hairloss-article li{margin:.45rem 0}
.hairloss-article a{color:var(--hl-green-dark);text-decoration-thickness:1px;text-underline-offset:3px}
.hairloss-article blockquote,.hairloss-article .hairloss-alert{margin:1.6rem 0;padding:1rem 1.2rem;border-right:4px solid var(--hl-gold);border-radius:12px;background:var(--hl-warn);color:var(--color-text,#17312d)}
.hairloss-article hr{border:0;height:1px;background:var(--color-border,#dce8e5);margin:2.7rem 0}
.hairloss-clinical-figure{margin:2rem 0;border:1px solid var(--color-border,#dce8e5);border-radius:20px;overflow:hidden;background:var(--color-surface,#fff);box-shadow:0 16px 42px rgba(13,91,82,.09)}
.hairloss-clinical-figure img{display:block;width:100%;max-height:650px;object-fit:cover}
.hairloss-clinical-figure figcaption{padding:.8rem 1rem;color:var(--color-text-muted,#657572);font-size:.88rem}
.hairloss-table-wrap{overflow:auto;margin:1.4rem 0;border:1px solid var(--color-border,#dce8e5);border-radius:14px;background:var(--color-surface,#fff)}
.hairloss-table{width:100%;min-width:620px;border-collapse:collapse}
.hairloss-table th,.hairloss-table td{padding:.85rem 1rem;border-bottom:1px solid var(--color-border,#dce8e5);text-align:right;vertical-align:top}
.hairloss-table th{background:var(--hl-soft);color:var(--hl-green-dark);font-weight:900}
.hairloss-table tr:last-child td{border-bottom:0}
[data-theme="dark"] .content-draft-banner{background:#3a2c10;color:#ffe2a4;border-color:#745b25}
[data-theme="dark"] .hairloss-article{--hl-soft:#102a27;--hl-warn:#312711}
[data-theme="dark"] .hairloss-article h2,[data-theme="dark"] .hairloss-article h4,[data-theme="dark"] .hairloss-article blockquote,[data-theme="dark"] .hairloss-article .hairloss-alert{color:#ecf7f5}
[data-theme="dark"] .hairloss-article h3,[data-theme="dark"] .hairloss-article a{color:#69c9bf}
[data-theme="dark"] .hairloss-table th{background:#12302c;color:#91d9d1}
@media(max-width:720px){.hairloss-article{line-height:2;font-size:1rem}.hairloss-article h2{margin-top:2.3rem}.detail-hero-image--hairloss{aspect-ratio:4/3}.content-draft-banner{font-size:.86rem;text-align:center}}
.hairloss-cta-button{display:inline-flex;align-items:center;justify-content:center;margin:1rem 0;padding:.85rem 1.25rem;border-radius:12px;background:var(--hl-green);color:#fff!important;text-decoration:none!important;font-weight:900;box-shadow:0 12px 28px rgba(14,137,126,.18)}
.hairloss-cta-button:hover{background:var(--hl-green-dark);transform:translateY(-2px)}


/* ============================================================
   v3.5.1 — Carousel seamless track + Hair-loss discovery links
   ============================================================ */
.auto-carousel-rail,.results-rail,.testimonials-rail,.methods-scroll{
    display:block!important;overflow:hidden!important;padding:4px 4px 12px!important;direction:ltr!important;cursor:grab;touch-action:pan-y;position:relative
}
.auto-carousel-rail.is-dragging{cursor:grabbing;user-select:none}
.auto-carousel-track{display:flex!important;width:max-content!important;min-width:100%;align-items:stretch;transform:translate3d(0,0,0);will-change:transform}
.auto-carousel-group{display:flex!important;flex:none!important;align-items:stretch;gap:18px;padding-inline-end:18px;min-width:max-content}
.auto-carousel-group>*{direction:rtl;flex:0 0 var(--carousel-card-width,clamp(300px,30vw,390px))!important;width:var(--carousel-card-width,clamp(300px,30vw,390px))!important;min-width:0!important}
.auto-carousel-source{display:none!important}
.auto-carousel-shell.is-empty-carousel{display:none!important}
@media(max-width:980px){.auto-carousel-group{gap:14px;padding-inline-end:14px}}
@media(max-width:620px){.auto-carousel-group{gap:12px;padding-inline-end:12px}}

.hairloss-cluster-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:18px}
.hairloss-cluster-links a{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border:1px solid var(--color-border,#dce8e5);border-radius:14px;background:var(--color-surface,#fff);color:var(--color-text,#17312d);font-weight:800;text-decoration:none}
.hairloss-cluster-links a:hover{border-color:var(--v3-primary);transform:translateY(-2px)}
.article-references a{color:var(--v3-primary);text-underline-offset:4px;overflow-wrap:anywhere}
.hairloss-cluster-home__grid{display:grid;grid-template-columns:1.35fr repeat(3,1fr);gap:16px}
.hairloss-cluster-home__grid a{display:flex;flex-direction:column;gap:8px;padding:24px;border:1px solid var(--color-border,#dce8e5);border-radius:22px;background:var(--color-surface,#fff);text-decoration:none;color:var(--color-text,#17312d);box-shadow:var(--shadow-sm)}
.hairloss-cluster-home__grid a i{font-size:30px;color:var(--v3-primary)}
.hairloss-cluster-home__grid a strong{font-size:1.08rem}.hairloss-cluster-home__grid a span{color:var(--color-text-muted,#63716f)}
.hairloss-cluster-home__lead{background:linear-gradient(135deg,rgba(14,137,126,.12),rgba(213,160,76,.10))!important;border-color:rgba(14,137,126,.28)!important}
.blog-cluster-spotlight{padding:24px 0;background:linear-gradient(135deg,rgba(14,137,126,.09),rgba(213,160,76,.08));border-block:1px solid rgba(14,137,126,.16)}
.blog-cluster-spotlight__inner{display:flex;align-items:center;justify-content:space-between;gap:24px}.blog-cluster-spotlight h2{margin:.25rem 0}.blog-cluster-spotlight p{margin:0;color:var(--color-text-muted)}.blog-cluster-spotlight span{color:var(--v3-primary);font-weight:800}.blog-cluster-spotlight__links{display:flex;flex-wrap:wrap;gap:8px}.blog-cluster-spotlight__links a{padding:10px 14px;border-radius:999px;background:var(--color-surface,#fff);border:1px solid var(--color-border,#dce8e5);text-decoration:none;color:var(--color-text,#17312d);font-weight:800}
html[data-theme="dark"] .hairloss-cluster-links a,html[data-theme="dark"] .hairloss-cluster-home__grid a,html[data-theme="dark"] .blog-cluster-spotlight__links a{background:#12201e;color:#eef7f5;border-color:rgba(255,255,255,.12)}
@media(max-width:900px){.hairloss-cluster-home__grid{grid-template-columns:repeat(2,1fr)}.blog-cluster-spotlight__inner{align-items:flex-start;flex-direction:column}}
@media(max-width:620px){.hairloss-cluster-links,.hairloss-cluster-home__grid{grid-template-columns:1fr}}


/* ============================================================
   v3.5.2 — ناوبری فشرده و Carousel با fallback واقعی
   ============================================================ */
@media (min-width: 821px) {
    .header-inner {
        gap: clamp(10px, 1.2vw, 22px) !important;
        padding-inline: clamp(16px, 2.3vw, 32px) !important;
    }
    .logo { flex: 0 1 250px; min-width: 185px; gap: 8px; }
    .logo-img { width: clamp(62px, 5vw, 82px) !important; height: auto !important; flex: 0 0 auto; }
    .logo-text {
        max-width: 150px !important;
        font-size: clamp(.78rem, .82vw, .94rem) !important;
        line-height: 1.55 !important;
    }
    .main-nav { flex: 1 1 auto; min-width: 0; }
    .main-nav ul {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center;
        justify-content: center;
        gap: clamp(1px, .3vw, 5px) !important;
        margin: 0;
        padding: 0;
    }
    .main-nav li { flex: 0 0 auto; }
    .main-nav a {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        min-height: 42px;
        padding: 8px clamp(7px, .58vw, 11px) !important;
        font-size: clamp(.78rem, .72vw, .9rem) !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        word-break: keep-all !important;
    }
    .header-actions { flex: 0 0 auto; gap: 6px !important; }
    .header-actions .btn { white-space: nowrap; }
    .btn-account { padding-inline: 12px !important; }
    .btn-booking { padding-inline: 16px !important; }
}

@media (min-width: 821px) and (max-width: 1180px) {
    .logo-text { display: none !important; }
    .logo { min-width: auto; flex-basis: auto; }
    .btn-account__text { display: none !important; }
    .btn-account { width: 42px; padding: 0 !important; justify-content: center; }
    .main-nav a { font-size: .78rem !important; padding-inline: 7px !important; }
}

@media (max-width: 820px) {
    .site-nav-stack { position: sticky !important; top: 0 !important; z-index: 1300 !important; }
    .site-header { position: relative !important; }
    .main-nav ul { display: flex !important; flex-direction: column !important; align-items: stretch !important; }
    .main-nav a {
        width: 100%;
        min-height: 48px;
        font-size: .94rem !important;
        line-height: 1.5 !important;
        white-space: nowrap !important;
    }
}

/* کارت‌های اصلی قبل از اجرای JS هم دیده می‌شوند؛ JS فقط Cloneها را اضافه می‌کند. */
.auto-carousel-rail,
.results-rail,
.testimonials-rail,
.methods-scroll {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 18px !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    direction: ltr !important;
    padding: 4px 4px 12px !important;
    scroll-behavior: auto !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    touch-action: pan-y;
    position: relative;
}
.auto-carousel-rail::-webkit-scrollbar,
.results-rail::-webkit-scrollbar,
.testimonials-rail::-webkit-scrollbar,
.methods-scroll::-webkit-scrollbar { display: none !important; }
.auto-carousel-rail.is-dragging { cursor: grabbing; user-select: none; }
.auto-carousel-rail > *,
.results-rail > *,
.testimonials-rail > *,
.methods-scroll > * {
    display: flex;
    direction: rtl !important;
    flex: 0 0 var(--carousel-card-width, clamp(300px, 30vw, 390px)) !important;
    width: var(--carousel-card-width, clamp(300px, 30vw, 390px)) !important;
    min-width: 0 !important;
    scroll-snap-align: none !important;
}
.auto-carousel-track,
.auto-carousel-source { display: none !important; }
.auto-carousel-shell.is-empty-carousel { display: none !important; }
.auto-carousel-rail > [hidden] { display: none !important; }
.auto-carousel-rail > [data-carousel-copy] { pointer-events: auto; }

@media (max-width: 980px) {
    .auto-carousel-rail,.results-rail,.testimonials-rail,.methods-scroll { gap: 14px !important; }
}
@media (max-width: 620px) {
    .auto-carousel-rail,.results-rail,.testimonials-rail,.methods-scroll { gap: 12px !important; }
}
