/* ============================================================
 *  Janiyar Segal — Process Section v5.0
 *  سبک، شیک، استاندارد | با Badge های کیفیت
 * ============================================================ */

/* ═══════════════════════════════════════════════════════════
 *  Section Base
 *  ═══════════════════════════════════════════════════════════ */
.js-process {
    position: relative;
    padding-block: clamp(70px, 8vw, 110px);
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 50%, #f1f5f9 100%);
    direction: rtl;
    font-family: 'Vazirmatn', 'IRANSansX', system-ui, sans-serif;
}

.js-process::before {
    content: '';
    position: absolute;
    top: -20%;
    inset-inline-start: -10%;
    width: 50%;
    height: 140%;
    background: radial-gradient(
        ellipse at center,
        rgba(255, 140, 66, 0.05) 0%,
        transparent 60%
    );
    pointer-events: none;
    z-index: 0;
}

/* ═══════════════════════════════════════════════════════════
 *  پس‌زمینه تصویری
 *  ═══════════════════════════════════════════════════════════ */
.js-process__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.js-process__bg img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    filter: brightness(1.15) contrast(1) saturate(1.05);
}

.js-process__overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg,
            rgba(255, 255, 255, 0.92) 0%,
            rgba(255, 255, 255, 0.82) 40%,
            rgba(248, 250, 252, 0.88) 70%,
            rgba(255, 255, 255, 0.95) 100%
        ),
        radial-gradient(
            ellipse at 25% 50%,
            rgba(255, 140, 66, 0.04) 0%,
            transparent 60%
        );
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
 *  Container
 *  ═══════════════════════════════════════════════════════════ */
.js-process__container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1320px;
    margin-inline: auto;
    padding-inline: clamp(16px, 3vw, 32px);
}

/* ═══════════════════════════════════════════════════════════
 *  Intro
 *  ═══════════════════════════════════════════════════════════ */
.js-process__intro {
    text-align: center;
    max-width: 720px;
    margin-inline: auto;
    margin-bottom: clamp(40px, 5vw, 60px);
}

.js-process__title {
    font-size: clamp(22px, 2.4vw, 30px);
    font-weight: 800;
    line-height: 1.4;
    color: #0f172a;
    margin: 0 0 16px;
    letter-spacing: -0.3px;
}

.js-process__title-accent {
    display: block;
    background: linear-gradient(135deg, #E6A83A 0%, #FF8C42 50%, #FF5500 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    position: relative;
    margin-top: 2px;
}

.js-process__title-accent::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #ff8c42 0%, #ff5500 100%);
    border-radius: 2px;
    margin: 16px auto 0;
    box-shadow: 0 0 12px rgba(255, 140, 66, 0.5);
}

.js-process__desc {
    font-size: 14.5px;
    line-height: 1.9;
    color: #475569;
    margin: 0 0 28px;
}

/* ═══════════════════════════════════════════════════════════
 *  ★ Badge های کیفیت (جایگزین آمار)
 *  ═══════════════════════════════════════════════════════════ */
.js-process__badges {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.js-process__badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    background: rgba(255, 255, 255, 0.85);
    border: 1.5px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    color: #475569;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    transition: all 280ms cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    font-family: inherit;
    white-space: nowrap;
}

.js-process__badge:hover {
    background: #ffffff;
    border-color: rgba(255, 140, 66, 0.4);
    color: #ea580c;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 140, 66, 0.18);
}

.js-process__badge svg {
    color: #ff8c42;
    flex-shrink: 0;
    transition: color 240ms;
}

.js-process__badge:hover svg {
    color: #ea580c;
}

/* ═══════════════════════════════════════════════════════════
 *  Steps — ۵ کارت به‌هم چسبیده
 *  ═══════════════════════════════════════════════════════════ */
.js-process__steps-wrap {
    position: relative;
}

.js-process__steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 20px 60px rgba(15, 23, 42, 0.12),
        0 0 0 1px rgba(15, 23, 42, 0.06);
    background: #0a0f1a;
    min-height: 460px;
}

.js-process__step {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 500ms cubic-bezier(0.25, 1, 0.5, 1);
    isolation: isolate;
}

/* ─── عکس ─── */
.js-process__step-media {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.js-process__step-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    filter: brightness(0.8) contrast(1.05) saturate(1.1);
    transition:
        transform 700ms cubic-bezier(0.25, 1, 0.5, 1),
        filter 500ms cubic-bezier(0.25, 1, 0.5, 1);
}

.js-process__step:hover .js-process__step-media img {
    transform: scale(1.08);
    filter: brightness(1) contrast(1.1) saturate(1.15);
}

/* Overlay */
.js-process__step-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(10, 15, 26, 0) 0%,
        rgba(10, 15, 26, 0.15) 45%,
        rgba(10, 15, 26, 0.8) 100%
    );
    pointer-events: none;
    z-index: 2;
    transition: background 500ms;
}

.js-process__step:hover .js-process__step-overlay {
    background: linear-gradient(
        180deg,
        rgba(10, 15, 26, 0) 0%,
        rgba(10, 15, 26, 0.1) 45%,
        rgba(10, 15, 26, 0.75) 100%
    );
}

/* خط نارنجی بالای کارت */
.js-process__step::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #ff8c42 0%, #ff5500 100%);
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 500ms cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 10;
    box-shadow: 0 0 16px rgba(255, 140, 66, 0.8);
}

.js-process__step:hover::before,
.js-process__step.is-active::before {
    transform: scaleX(1);
}

/* خط جداکننده عمودی */
.js-process__step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-end: 0;
    width: 1px;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(255, 140, 66, 0.25) 30%,
        rgba(255, 140, 66, 0.4) 50%,
        rgba(255, 140, 66, 0.25) 70%,
        transparent 100%
    );
    z-index: 5;
    pointer-events: none;
}

/* ─── محتوا ─── */
.js-process__step-content {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px 20px;
    color: #ffffff;
    text-align: right;
}

.js-process__step-num {
    position: absolute;
    top: 20px;
    inset-inline-start: 20px;
    font-size: 32px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.1);
    line-height: 1;
    letter-spacing: -2px;
    font-family: 'Inter', system-ui, sans-serif;
    transition: all 500ms cubic-bezier(0.25, 1, 0.5, 1);
    pointer-events: none;
}

.js-process__step:hover .js-process__step-num {
    color: rgba(255, 140, 66, 0.3);
}

.js-process__step-label {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #ff8c42;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 6px;
    padding: 3px 9px;
    background: rgba(255, 140, 66, 0.15);
    border: 1px solid rgba(255, 140, 66, 0.35);
    border-radius: 5px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    width: fit-content;
    transition: all 400ms;
}

.js-process__step:hover .js-process__step-label {
    background: rgba(255, 140, 66, 0.3);
    border-color: rgba(255, 140, 66, 0.6);
}

.js-process__step-title {
    font-size: 14.5px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 6px;
    line-height: 1.4;
    letter-spacing: -0.2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
    transition: color 400ms;
}

.js-process__step:hover .js-process__step-title {
    color: #ff8c42;
}

.js-process__step-desc {
    font-size: 11.5px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition:
        max-height 500ms cubic-bezier(0.25, 1, 0.5, 1),
        opacity 400ms,
        margin-top 400ms;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.js-process__step:hover .js-process__step-desc {
    max-height: 100px;
    opacity: 1;
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
 *  ★ نوار پیشرفت — سبک و شیک
 *  ═══════════════════════════════════════════════════════════ */
.js-process__progress {
    position: relative;
    margin-top: 36px;
    padding: 0 50px;
    max-width: 1100px;
    margin-inline: auto;
}

/* خط پایه */
.js-process__progress-track {
    position: relative;
    height: 2px;
    background: rgba(15, 23, 42, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.js-process__progress-fill {
    position: absolute;
    inset: 0;
    background: linear-gradient(270deg, #ff5500 0%, #ff8c42 50%, #E6A83A 100%);
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 2.2s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 0 12px rgba(255, 140, 66, 0.6);
}

.js-process.is-visible .js-process__progress-fill {
    transform: scaleX(1);
}

/* نقطه‌ها */
.js-process__progress-dots {
    position: absolute;
    top: 50%;
    left: 50px;
    right: 50px;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.js-process__progress-dot {
    position: relative;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid rgba(15, 23, 42, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 500ms cubic-bezier(0.25, 1, 0.5, 1);
    pointer-events: auto;
    cursor: pointer;
}

/* پالس ظریف دور نقطه فعال */
.js-process__progress-dot::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(255, 140, 66, 0.5);
    opacity: 0;
    transition: all 400ms;
}

/* نقطه فعال */
.js-process.is-visible .js-process__progress-dot {
    border-color: #ff8c42;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.15);
}

.js-process.is-visible .js-process__progress-dot::before {
    opacity: 1;
    animation: jsDotPulse 2.5s ease-in-out infinite;
}

/* تاخیر ترتیبی */
.js-process.is-visible .js-process__progress-dot[data-dot="1"] { transition-delay: 0.3s; }
.js-process.is-visible .js-process__progress-dot[data-dot="2"] { transition-delay: 0.7s; }
.js-process.is-visible .js-process__progress-dot[data-dot="3"] { transition-delay: 1.1s; }
.js-process.is-visible .js-process__progress-dot[data-dot="4"] { transition-delay: 1.5s; }
.js-process.is-visible .js-process__progress-dot[data-dot="5"] { transition-delay: 1.9s; }

.js-process.is-visible .js-process__progress-dot[data-dot="1"]::before { animation-delay: 0.3s; }
.js-process.is-visible .js-process__progress-dot[data-dot="2"]::before { animation-delay: 0.7s; }
.js-process.is-visible .js-process__progress-dot[data-dot="3"]::before { animation-delay: 1.1s; }
.js-process.is-visible .js-process__progress-dot[data-dot="4"]::before { animation-delay: 1.5s; }
.js-process.is-visible .js-process__progress-dot[data-dot="5"]::before { animation-delay: 1.9s; }

@keyframes jsDotPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.js-process__progress-dot-inner {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.15);
    transition: all 400ms;
}

.js-process.is-visible .js-process__progress-dot-inner {
    background: #ff8c42;
}

/* Hover */
.js-process__progress-dot:hover {
    transform: scale(1.4);
    border-color: #ff5500;
    box-shadow: 0 0 0 4px rgba(255, 140, 66, 0.25);
}

.js-process__progress-dot:hover .js-process__progress-dot-inner {
    background: #ff5500;
}

/* ═══════════════════════════════════════════════════════════
 *  انیمیشن ورود کارت‌ها
 *  ═══════════════════════════════════════════════════════════ */
.js-process__step {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 700ms cubic-bezier(0.25, 1, 0.5, 1),
        transform 700ms cubic-bezier(0.25, 1, 0.5, 1);
}

.js-process.is-visible .js-process__step {
    opacity: 1;
    transform: translateY(0);
}

.js-process.is-visible .js-process__step[data-step="1"] { transition-delay: 0.1s; }
.js-process.is-visible .js-process__step[data-step="2"] { transition-delay: 0.22s; }
.js-process.is-visible .js-process__step[data-step="3"] { transition-delay: 0.34s; }
.js-process.is-visible .js-process__step[data-step="4"] { transition-delay: 0.46s; }
.js-process.is-visible .js-process__step[data-step="5"] { transition-delay: 0.58s; }

/* ═══════════════════════════════════════════════════════════
 *  Responsive — تبلت (1024px)
 *  ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .js-process__steps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        min-height: 420px;
    }

    .js-process__progress {
        display: none;
    }

    .js-process__badges {
        gap: 8px;
    }

    .js-process__badge {
        font-size: 12px;
        padding: 8px 16px;
    }
}

/* ═══════════════════════════════════════════════════════════
 *  Responsive — موبایل (720px)
 *  ═══════════════════════════════════════════════════════════ */
@media (max-width: 720px) {
    .js-process {
        padding-block: 55px;
    }

    .js-process__title {
        font-size: 22px;
    }

    .js-process__desc {
        font-size: 13.5px;
        margin-bottom: 22px;
    }

    /* Badge ها */
    .js-process__badges {
        gap: 6px;
        margin-top: 4px;
    }

    .js-process__badge {
        font-size: 11.5px;
        padding: 7px 14px;
        gap: 5px;
    }

    .js-process__badge svg {
        width: 12px;
        height: 12px;
    }

    /* کارت‌ها */
    .js-process__steps {
        grid-template-columns: 1fr;
        min-height: auto;
        border-radius: 16px;
    }

    .js-process__step {
        min-height: 220px;
    }

    .js-process__step:not(:last-child)::after {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 1px;
        background: linear-gradient(
            90deg,
            transparent 0%,
            rgba(255, 140, 66, 0.35) 50%,
            transparent 100%
        );
    }

    .js-process__step-content {
        padding: 20px 18px;
    }

    .js-process__step-num {
        font-size: 26px;
        top: 16px;
        inset-inline-start: 16px;
    }

    .js-process__step-title {
        font-size: 14px;
    }

    .js-process__step-desc {
        font-size: 12px;
        max-height: none;
        opacity: 1;
        margin-top: 4px;
    }
}

/* ═══════════════════════════════════════════════════════════
 *  Responsive — موبایل کوچک (480px)
 *  ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .js-process__badges {
        gap: 5px;
    }

    .js-process__badge {
        font-size: 11px;
        padding: 6px 12px;
        gap: 4px;
    }

    .js-process__badge svg {
        width: 11px;
        height: 11px;
    }
}

/* ═══════════════════════════════════════════════════════════
 *  Reduced motion
 *  ═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .js-process__step {
        opacity: 1 !important;
        transform: none !important;
    }
    .js-process__progress-fill {
        transform: scaleX(1) !important;
    }
    .js-process__progress-dot::before {
        animation: none !important;
    }
}