/* ============================================
   TREATMENT DETAILS MODALS (shared)
   ============================================ */

:root {
    --treat-primary: #1a5e8f;
    --treat-secondary: #2c78b0;
}

/* ============================================
   MODAL SYSTEM
   ============================================ */
/* Hide progress line when modal is active */
.treatment-modal.active ~ * .progress-line,
.treatment-modal.active ~ * .progress-bar,
.treatment-modal.active ~ * [class*="progress"],
body:has(.treatment-modal.active) .progress-line,
body:has(.treatment-modal.active) .progress-bar,
body:has(.treatment-modal.active) [class*="progress"] {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Treatment modal — matches About page team modal pattern */
.treatment-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
}

.treatment-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.treatment-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.treatment-modal__content {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    max-width: 540px;
    width: min(540px, calc(100% - 32px));
    box-shadow: 0 24px 48px rgba(13, 43, 69, 0.22);
    transform: translateY(16px) scale(0.98);
    transition: transform 0.25s ease, opacity 0.25s ease;
    z-index: 1;
}

.treatment-modal__content:has(.treatment-modal__figure) {
    max-width: 820px;
    width: min(820px, calc(100% - 32px));
}

.treatment-modal.active .treatment-modal__content {
    transform: translateY(0) scale(1);
}

.treatment-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid #D5E0E8;
    border-radius: 50%;
    background: #ffffff;
    color: #0D2B45;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 1.05rem;
    box-shadow: 0 1px 4px rgba(13, 43, 69, 0.08);
}

.treatment-modal__close:hover {
    background: #F3F8F7;
    color: #1A6F5C;
    border-color: #1A6F5C;
}

.treatment-modal__close:focus {
    outline: 3px solid #5ba3d0;
    outline-offset: 2px;
}

.treatment-modal__body {
    padding: 28px 24px 28px;
    line-height: 1.65;
    font-size: 0.95rem;
    color: #334155;
}

.treatment-modal__title {
    margin: 0 40px 16px 0;
    padding: 0 0 14px;
    border-bottom: 1px solid #E6EEF2;
    color: #0D2B45;
    font-size: 1.28rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: left;
    letter-spacing: -0.02em;
}

.treatment-modal__figure {
    margin: 0 0 18px;
}

.treatment-modal__figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    background: #f4f8fb;
}

/* Opening summary under the title */
.treatment-modal__title + p {
    margin: 0 0 8px;
    font-size: 1rem;
    line-height: 1.7;
    color: #475569;
}

.treatment-modal__body h4 {
    margin: 1.5rem 0 0.65rem;
    padding: 0 0 0.4rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    color: var(--treat-primary);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.treatment-modal__body h4:first-of-type {
    margin-top: 0;
}

.treatment-modal__body p {
    margin: 0 0 0.85rem;
}

.treatment-modal__body ul,
.treatment-modal__body ol {
    margin: 0 0 1.1rem;
    padding: 0;
    list-style: none;
}

.treatment-modal__body ul > li,
.treatment-modal__body ol > li {
    position: relative;
    margin-bottom: 0.55rem;
    padding-left: 1.25rem;
    line-height: 1.6;
    color: #334155;
}

.treatment-modal__body ul > li:last-child,
.treatment-modal__body ol > li:last-child {
    margin-bottom: 0;
}

.treatment-modal__body ul > li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.58em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #5ba3d0;
    box-shadow: 0 0 0 3px rgba(91, 163, 208, 0.15);
}

.treatment-modal__body ol {
    counter-reset: treatment-modal-step;
}

.treatment-modal__body ol > li {
    padding-left: 2.1rem;
    margin-bottom: 0.75rem;
}

.treatment-modal__body ol > li::before {
    content: counter(treatment-modal-step);
    counter-increment: treatment-modal-step;
    position: absolute;
    left: 0;
    top: 0.05em;
    width: 1.4rem;
    height: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: linear-gradient(135deg, var(--treat-primary), var(--treat-secondary));
    border-radius: 50%;
}

.treatment-modal__body li strong {
    color: #1e293b;
    font-weight: 600;
}

@media (max-width: 768px) {
    .treatment-modal.bpc-modal-safe {
        align-items: flex-end;
        padding-left: 0;
        padding-right: 0;
        padding-bottom: 0;
    }

    .treatment-modal__content {
        width: 100%;
        max-width: none;
        border-radius: 20px 20px 0 0;
        transform: translateY(24px);
    }

    .treatment-modal.active .treatment-modal__content {
        transform: translateY(0);
    }

    .treatment-modal__close {
        top: 8px;
        right: 8px;
    }

    .treatment-modal__body {
        padding: 24px 18px calc(20px + env(safe-area-inset-bottom, 0px));
    }

    .treatment-modal__title {
        font-size: 1.15rem;
        margin-right: 44px;
        padding-bottom: 12px;
        margin-bottom: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .treatment-modal,
    .treatment-modal__content {
        transition: none !important;
    }

    .treatment-modal.active .treatment-modal__content {
        transform: none !important;
    }
}
