/* ════════════════════════════════════════════════════
   HPB Timeline — zigzag + خط پیشرفت (101physio-style)
   RTL / فارسی
   ════════════════════════════════════════════════════ */

:root {
    --hpb-tl-accent:  #123f7d;
    --hpb-tl-line:    #e2e8f0;
    --hpb-tl-step-bg: #ffffff;
    --hpb-tl-radius:  16px;
    --hpb-tl-node:    44px;
}

.hpb-timeline {
    direction: rtl;
    padding: 8px 0 48px;
}

.hpb-timeline__title-wrap {
    margin-bottom: 40px;
    text-align: center;
}

.crafto-timeline__head {
    text-align: center;
    margin-bottom: 36px;
}

.crafto-timeline__lead {
    margin: 10px auto 0;
    max-width: 720px;
    color: #64748b;
    font-size: 1rem;
    line-height: 1.8;
}

.hpb-timeline__wrap {
    position: relative;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 12px;
}

.hpb-timeline__line {
    position: absolute;
    top: calc(var(--hpb-tl-node) / 2);
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background: var(--hpb-tl-line);
    border-radius: 999px;
    z-index: 0;
}

.hpb-timeline__progress {
    width: 100%;
    height: 0%;
    background: var(--hpb-tl-accent);
    border-radius: 999px;
    transition: height 0.35s ease;
    will-change: height;
}

.hpb-timeline__steps {
    position: relative;
    z-index: 1;
}

.hpb-tl-step {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--hpb-tl-node) minmax(0, 1fr);
    gap: 0 32px;
    align-items: center;
    margin-bottom: 52px;
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.hpb-tl-step.is-visible {
    opacity: 1;
    transform: none;
}

.hpb-tl-step:nth-child(2) { transition-delay: 0.06s; }
.hpb-tl-step:nth-child(3) { transition-delay: 0.12s; }
.hpb-tl-step:nth-child(4) { transition-delay: 0.18s; }
.hpb-tl-step:nth-child(5) { transition-delay: 0.24s; }

.hpb-tl-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.hpb-tl-node__circle {
    width: var(--hpb-tl-node);
    height: var(--hpb-tl-node);
    border-radius: 50%;
    background: var(--hpb-tl-line);
    border: 2px solid var(--hpb-tl-line);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
    transition: background 0.35s ease, border-color 0.35s ease, color 0.35s ease,
        transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
}

.hpb-tl-step.is-active .hpb-tl-node__circle {
    background: var(--hpb-tl-accent);
    border-color: var(--hpb-tl-accent);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--hpb-tl-accent) 18%, transparent);
}

.hpb-tl-step-label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--hpb-tl-node);
    text-align: center;
}

.hpb-tl-step-label span {
    font-size: clamp(1.35rem, 2.4vw, 1.85rem);
    font-weight: 700;
    color: color-mix(in srgb, var(--hpb-tl-accent) 72%, #cbd5e1);
    line-height: 1.2;
    transition: color 0.35s ease, transform 0.35s ease;
}

.hpb-tl-step.is-active .hpb-tl-step-label span {
    color: var(--hpb-tl-accent);
    transform: scale(1.03);
}

.hpb-tl-card {
    position: relative;
    background: var(--hpb-tl-step-bg);
    border-radius: var(--hpb-tl-radius);
    padding: 22px 26px;
    box-shadow: 0 2px 14px rgba(15, 23, 42, 0.06);
    border: 1px solid #eef2f7;
    transition: box-shadow 0.35s ease, transform 0.35s ease, border-color 0.35s ease;
}

.hpb-tl-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid var(--hpb-tl-accent);
    clip-path: inset(0 100% 100% 0);
    transition: clip-path 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.hpb-tl-step.is-visible .hpb-tl-card::before {
    clip-path: inset(0 0 0 0);
}

.hpb-tl-step.is-active .hpb-tl-card {
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--hpb-tl-accent) 22%, #eef2f7);
}

.hpb-tl-card__arrow {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    background: var(--hpb-tl-step-bg);
    border: 1px solid #eef2f7;
    transform: translateY(-50%) rotate(45deg);
    z-index: 1;
}

.hpb-tl-step--odd .hpb-tl-card__arrow {
    left: -8px;
    border-top: none;
    border-right: none;
}

.hpb-tl-step--even .hpb-tl-card__arrow {
    right: -8px;
    border-bottom: none;
    border-left: none;
}

.hpb-tl-card__title {
    font-size: 1.08rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 10px;
    line-height: 1.45;
}

.hpb-tl-card__body {
    font-size: 0.92rem;
    color: #64748b;
    line-height: 1.8;
}

.hpb-tl-card__body > * {
    margin-bottom: 0.5em;
}

.hpb-tl-card__body > *:last-child {
    margin-bottom: 0;
}

.hpb-tl-card__image {
    margin-bottom: 14px;
    border-radius: calc(var(--hpb-tl-radius) - 4px);
    overflow: hidden;
}

.hpb-tl-card__image img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.hpb-tl-step--odd .hpb-tl-card {
    text-align: right;
}

.hpb-tl-step--even .hpb-tl-card {
    text-align: right;
}

@media (max-width: 767px) {
    .hpb-timeline__line {
        left: calc(var(--hpb-tl-node) / 2);
        transform: none;
    }

    .hpb-tl-step,
    .hpb-tl-step--odd,
    .hpb-tl-step--even {
        grid-template-columns: var(--hpb-tl-node) minmax(0, 1fr);
        gap: 0 14px;
        align-items: start;
        margin-bottom: 36px;
    }

    .hpb-tl-step-label {
        display: none;
    }

    .hpb-tl-node {
        grid-column: 1;
        grid-row: 1;
    }

    .hpb-tl-card {
        grid-column: 2;
        grid-row: 1;
        padding: 16px 18px;
    }

    .hpb-tl-step--odd .hpb-tl-card__arrow,
    .hpb-tl-step--even .hpb-tl-card__arrow {
        right: auto;
        left: -8px;
        border-top: none;
        border-right: none;
        border-bottom: 1px solid #eef2f7;
        border-left: 1px solid #eef2f7;
    }
}

@media (max-width: 480px) {
    .hpb-tl-card__title {
        font-size: 1rem;
    }

    .hpb-tl-card__body {
        font-size: 0.88rem;
    }
}

/* ════════════════════════════════════════════════════
   Bajet / BNPL zigzag — پنل تصویری گرد + متن کنار
   ════════════════════════════════════════════════════ */

.hpb-timeline--bajet {
    padding: 16px 0 56px;
}

.hpb-tl-bajet__steps {
    display: flex;
    flex-direction: column;
    gap: clamp(40px, 6vw, 72px);
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 12px;
}

.hpb-tl-bajet-step {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: clamp(24px, 4vw, 56px);
    align-items: center;
    margin: 0;
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.hpb-tl-bajet-step.is-visible {
    opacity: 1;
    transform: none;
}

.hpb-tl-bajet-step:nth-child(2) { transition-delay: 0.05s; }
.hpb-tl-bajet-step:nth-child(3) { transition-delay: 0.1s; }
.hpb-tl-bajet-step:nth-child(4) { transition-delay: 0.15s; }

.hpb-tl-bajet-step__content {
    min-width: 0;
    text-align: right;
}

.hpb-tl-bajet-step__label {
    margin: 0 0 10px;
    color: var(--hpb-tl-accent, #3b82f6);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.hpb-tl-bajet-step__title {
    margin: 0 0 14px;
    color: #0f172a;
    font-size: clamp(1.35rem, 2.2vw, 1.85rem);
    font-weight: 800;
    line-height: 1.35;
}

.hpb-tl-bajet-step__body {
    color: #64748b;
    font-size: 1rem;
    line-height: 1.9;
}

.hpb-tl-bajet-step__body p {
    margin: 0 0 0.6em;
}

.hpb-tl-bajet-step__body p:last-child {
    margin-bottom: 0;
}

.hpb-tl-bajet-step__media {
    min-width: 0;
    background: var(--hpb-tl-media-bg, #f3f4f6);
    border-radius: var(--hpb-tl-radius, 40px);
    padding: clamp(20px, 3vw, 36px);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: clamp(220px, 32vw, 360px);
    overflow: hidden;
}

.hpb-tl-bajet-step__img {
    display: block;
    max-width: 100%;
    max-height: min(420px, 58vw);
    width: auto;
    height: auto;
    object-fit: contain;
}

.hpb-tl-bajet-step__placeholder {
    width: min(220px, 55%);
    aspect-ratio: 9 / 19;
    border-radius: 28px;
    background: linear-gradient(160deg, #e5e7eb 0%, #f9fafb 45%, #d1d5db 100%);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

@media (max-width: 860px) {
    .hpb-tl-bajet-step,
    .hpb-tl-bajet-step.hpb-tl-bajet-step--flip {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .hpb-tl-bajet-step__media {
        order: -1;
        min-height: 200px;
        border-radius: 28px;
    }

    .hpb-tl-bajet-step__title {
        font-size: 1.3rem;
    }

    .hpb-tl-bajet-step__body {
        font-size: 0.95rem;
    }
}

