/* =========================================================
   SERVICE HERO v2 — پوستر صفحات خدمات
   RoadsideAssistance · TechnicalUnit · TrainingCenter
   VehicleRecall · Warranty

   دسکتاپ : تصویر افقی تمام‌عرض + پنل Liquid Glass
   موبایل : پوستر دقیقاً ۹:۱۶ (عمودی)
   انیمیشن‌ها با GSAP ScrollTrigger (fk-scroll.js) کنترل می‌شوند.
   ========================================================= */

.svc-hero {
    --svc-hero-h: clamp(440px, 74vh, 760px);
    position: relative;
    width: 100%;
    height: var(--svc-hero-h);
    overflow: hidden;
    isolation: isolate;
    background: transparent;
    direction: rtl;
}

/* لبه‌ی پایین پوستر با ماسک در پس‌زمینه‌ی گرادیانی سایت حل می‌شود (بدون درز رنگی) */
.svc-hero-media,
.svc-hero-shade {
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 58%, rgba(0, 0, 0, 0.55) 80%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 58%, rgba(0, 0, 0, 0.55) 80%, transparent 100%);
}

/* ---------- تصویر ---------- */
.svc-hero-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

/* خودِ تصویر سرریز دارد و پارالاکس روی آن اعمال می‌شود (نه روی ماسک) */
.svc-hero-media picture {
    position: absolute;
    inset: -8% 0;
    display: block;
    will-change: transform;
}

.svc-hero-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 38%;
}

/* ---------- سایه‌ها ---------- */
.svc-hero-shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(var(--fk-bg-rgb, 15, 10, 6), 0.72) 0%, rgba(var(--fk-bg-rgb, 15, 10, 6), 0.18) 22%, transparent 44%),
        linear-gradient(270deg, rgba(var(--fk-bg-rgb, 15, 10, 6), 0.62) 0%, rgba(var(--fk-bg-rgb, 15, 10, 6), 0.18) 46%, transparent 72%);
}

.svc-hero-fade { display: none; }

/* ---------- محتوا ---------- */
.svc-hero-content {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 3;
    padding-bottom: clamp(30px, 5.5vw, 64px);
    direction: rtl;
}

.svc-hero-panel {
    position: relative;
    box-sizing: border-box;
    width: min(100%, 470px);
    margin-inline-start: 0;        /* RTL: سمت راست */
    padding: clamp(16px, 1.8vw, 22px) clamp(18px, 2vw, 26px);
    border-radius: 22px;
    transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1), padding 0.6s cubic-bezier(0.22, 1, 0.36, 1), border-radius 0.6s ease;
    text-align: right;
    background: var(--fk-glass-card-bg);
    -webkit-backdrop-filter: var(--fk-glass-card-filter);
    backdrop-filter: var(--fk-glass-card-filter);
    border: 1px solid var(--fk-glass-border);
    box-shadow: var(--fk-glass-card-shadow);
}

.svc-hero-eyebrow {
    display: flex;
    width: fit-content;
    max-height: 44px;
    overflow: hidden;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 5px 14px 5px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--fk-gold, #c9a84c);
    background: rgba(var(--fk-gold-rgb, 201, 168, 76), 0.12);
    border: 1px solid rgba(var(--fk-gold-rgb, 201, 168, 76), 0.28);
}

.svc-hero-eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fk-gold, #c9a84c);
    box-shadow: 0 0 10px var(--fk-gold, #c9a84c);
}

.svc-hero-title {
    font-weight: 800 !important;
    font-size: clamp(1.45rem, 2.5vw, 2rem) !important;
    line-height: 1.4 !important;
    color: var(--fk-text-main, #fff) !important;
    margin: 0 0 12px !important;
    letter-spacing: -0.01em;
    transition: margin 0.5s ease, font-size 0.5s ease;
}

.svc-hero-line {
    display: flex;
    align-items: center;
    gap: 0;
    max-height: 20px;
    margin-bottom: 12px;
    transform-origin: right center;
}

.svc-hero-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--fk-gold, #c9a84c);
    box-shadow: 0 0 0 6px rgba(var(--fk-gold-rgb, 201, 168, 76), 0.16);
}

.svc-hero-bar {
    height: 2px;
    width: min(360px, 60%);
    background: linear-gradient(to left, var(--fk-gold, #c9a84c), transparent);
    opacity: 0.8;
    transform-origin: right center;
}

.svc-hero-sub {
    margin: 0 !important;
    max-width: 520px;
    max-height: 240px;
    font-size: clamp(0.88rem, 1.15vw, 0.98rem) !important;
    line-height: 1.9 !important;
    color: rgba(var(--fk-white-rgb, 255, 255, 255), 0.84) !important;
}

/* ---------- حالت جمع‌شده: فقط عنوان؛ پوستر کامل دیده می‌شود ---------- */
.svc-hero-eyebrow,
.svc-hero-line,
.svc-hero-sub {
    transition: max-height 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease, margin 0.5s ease, padding 0.5s ease, border-width 0.5s ease;
}

.svc-hero-panel.is-compact {
    width: min(100%, 330px);
    padding-top: 12px;
    padding-bottom: 12px;
    border-radius: 999px;
}

.svc-hero-panel.is-compact .svc-hero-eyebrow,
.svc-hero-panel.is-compact .svc-hero-line,
.svc-hero-panel.is-compact .svc-hero-sub {
    max-height: 0 !important;
    opacity: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    pointer-events: none;
}

.svc-hero-panel.is-compact .svc-hero-title {
    margin: 0 !important;
    font-size: clamp(1.05rem, 1.7vw, 1.3rem) !important;
}

.svc-hero-panel.is-compact.svc-hero-panel { padding-inline-start: 50px; }

/* دکمه‌ی جمع/باز‌کردن پنل (توسط fk-scroll.js ساخته می‌شود) */
.svc-hero-toggle {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    background: var(--fk-glass-ctrl-bg);
    -webkit-backdrop-filter: var(--fk-glass-ctrl-filter);
    backdrop-filter: var(--fk-glass-ctrl-filter);
    border: 1px solid var(--fk-glass-border);
    box-shadow: var(--fk-glass-ctrl-shadow);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.svc-hero-toggle:hover { transform: scale(1.08); }
.svc-hero-toggle:focus-visible { outline: 2px solid var(--fk-gold, #c9a84c); outline-offset: 2px; }

.svc-hero-toggle svg { width: 16px; height: 16px; transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.svc-hero-panel.is-compact .svc-hero-toggle { top: 50%; margin-top: -16px; }
.svc-hero-panel.is-compact .svc-hero-toggle svg { transform: rotate(180deg); }

/* نشانگر اسکرول */
.svc-hero-scroll {
    position: absolute;
    left: clamp(20px, 4vw, 56px);
    bottom: clamp(30px, 5.5vw, 64px);
    z-index: 3;
    width: 26px;
    height: 44px;
    border-radius: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
    pointer-events: none;
}

.svc-hero-scroll::after {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    width: 3px;
    height: 8px;
    margin-left: -1.5px;
    border-radius: 3px;
    background: #fff;
    animation: svc-scroll-cue 1.8s cubic-bezier(.6, 0, .2, 1) infinite;
}

@keyframes svc-scroll-cue {
    0%   { transform: translateY(0);    opacity: 1; }
    70%  { transform: translateY(14px); opacity: 0; }
    100% { transform: translateY(0);    opacity: 0; }
}

/* بدنه‌ی صفحه بلافاصله زیر هیرو */
.warranty-page.svc-page-with-hero,
.vr-page.svc-page-with-hero,
.ra-page.svc-page-with-hero,
.svc-page-with-hero {
    padding-top: 0 !important;
}

.svc-page-with-hero > .svc-hero { margin-top: 0; }

.svc-page-with-hero .warranty-content,
.svc-page-with-hero .vr-body,
.svc-page-with-hero .ra-section:first-of-type {
    margin-top: -8px;
}

/* =========================================================
   RESPONSIVE (پوستر خدمات)
   ========================================================= */

/* لپ‌تاپ‌های بزرگ / مانیتور */
@media (min-width: 1600px) {
    .svc-hero { --svc-hero-h: clamp(560px, 70vh, 820px); }
    .svc-hero-panel { width: min(100%, 520px); }
}

@media (min-width: 2200px) {
    .svc-hero { --svc-hero-h: clamp(700px, 68vh, 1000px); }
    .svc-hero-panel { width: min(100%, 600px); }
}

/* تبلت و پنجره‌های متوسط (۷۶۹ تا ۱۱۰۰) */
@media (min-width: 769px) and (max-width: 1100px) {
    .svc-hero { --svc-hero-h: clamp(400px, 56vh, 620px); }
    .svc-hero-panel { width: min(100%, 460px); }
    .svc-hero-scroll { display: none; }
}

/* تبلت ۱۰ اینچ — عمودی (مثلاً 800×1280 ، 810×1080 ، 820×1180) */
@media (min-width: 601px) and (max-width: 1100px) and (orientation: portrait) {
    .svc-hero { --svc-hero-h: clamp(460px, 46vh, 640px); }
    .svc-hero-panel { width: min(100%, 440px); padding: 16px 22px; }
    .svc-hero-title { font-size: 1.6rem !important; }
    .svc-hero-img { object-position: center 30%; }
}

/* تبلت ۱۰ اینچ — افقی (مثلاً 1280×800 ، 1080×810 ، 1180×820) */
@media (min-width: 901px) and (max-width: 1400px) and (orientation: landscape) and (max-height: 900px) {
    .svc-hero { --svc-hero-h: clamp(380px, 64vh, 560px); }
    .svc-hero-panel { width: min(100%, 420px); padding: 14px 20px; }
    .svc-hero-title { font-size: 1.5rem !important; }
    .svc-hero-sub { font-size: 0.86rem !important; line-height: 1.8 !important; }
    .svc-hero-content { padding-bottom: 28px; }
}

/* =========================================================
   موبایل (عمودی): پوستر دقیقاً ۹:۱۶
   ========================================================= */
@media (max-width: 768px) and (orientation: portrait) {
    .svc-hero {
        --svc-hero-h: auto;
        height: auto;
        aspect-ratio: 9 / 16;
        min-height: 0;
        max-height: none;
    }

    .svc-hero-media picture { inset: -4% 0; }

    .svc-hero-img { object-position: center center; }

    .svc-hero-shade {
        background:
            linear-gradient(180deg, rgba(var(--fk-bg-rgb, 15, 10, 6), 0.7) 0%, transparent 26%),
            linear-gradient(0deg, rgba(var(--fk-bg-rgb, 15, 10, 6), 0.4) 0%, transparent 45%);
    }

    .svc-hero-content { padding-bottom: 20px; }

    .svc-hero-panel {
        width: 100%;
        padding: 16px 16px 14px;
        border-radius: 20px;
    }

    .svc-hero-panel.is-compact { width: min(100%, 290px); }

    .svc-hero-eyebrow { margin-bottom: 10px; font-size: 0.72rem; }
    .svc-hero-title { font-size: 1.35rem !important; margin-bottom: 10px !important; }
    .svc-hero-line { margin-bottom: 10px; }
    .svc-hero-sub { font-size: 0.86rem !important; line-height: 1.85 !important; }
}

@media (max-width: 768px) {
    .svc-hero-scroll { display: none; }
}

/* گوشی‌های کوچک */
@media (max-width: 360px) and (orientation: portrait) {
    .svc-hero-title { font-size: 1.2rem !important; }
    .svc-hero-sub { font-size: 0.8rem !important; }
    .svc-hero-panel { padding: 14px 13px 12px; }
}

/* گوشی افقی */
@media (max-width: 960px) and (orientation: landscape) and (max-height: 520px) {
    .svc-hero { --svc-hero-h: 100vh; --svc-hero-h: 100svh; min-height: 0; max-height: none; }
    .svc-hero-panel { width: min(100%, 400px); padding: 12px 16px; }
    .svc-hero-title { font-size: 1.15rem !important; margin-bottom: 6px !important; }
    .svc-hero-eyebrow, .svc-hero-sub { display: none; }
    .svc-hero-content { padding-bottom: 16px; }
    .svc-hero-scroll { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .svc-hero-scroll::after { animation: none; }
    .svc-hero-panel, .svc-hero-eyebrow, .svc-hero-line, .svc-hero-sub, .svc-hero-title, .svc-hero-toggle svg { transition: none; }
}


/* =========================================================
   انیمیشن ورود با CSS (مستقل از JS؛ fill = backwards تا با scrub روی opacity تداخل نکند)
   ========================================================= */
@keyframes svc-rise {
    from { opacity: 0; transform: translateY(34px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

@keyframes svc-part {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}

@keyframes svc-bar {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

.svc-hero-panel { animation: svc-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.1s backwards; }
.svc-hero-eyebrow { animation: svc-part 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.30s backwards; }
.svc-hero-title   { animation: svc-part 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.42s backwards; }
.svc-hero-line    { animation: svc-part 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.54s backwards; }
.svc-hero-sub     { animation: svc-part 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.66s backwards; }
.svc-hero-bar     { animation: svc-bar 1s cubic-bezier(0.22, 1, 0.36, 1) 0.7s backwards; }

@media (prefers-reduced-motion: reduce) {
    .svc-hero-panel, .svc-hero-eyebrow, .svc-hero-title, .svc-hero-line, .svc-hero-sub, .svc-hero-bar { animation: none; }
}
