﻿/* =========================
   Modal de planes
   ========================= */

.custom-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
}

    .custom-modal.is-open {
        display: block;
    }

.custom-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 20, 38, 0.72);
    backdrop-filter: blur(4px);
}

.custom-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 32px));
    max-height: calc(100vh - 48px);
    overflow: auto;
    margin: 24px auto;
    background: #fff;
    color: var(--text);
    border-radius: 20px;
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.25);
    padding: 28px;
}

.custom-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: rgba(7, 20, 38, 0.06);
    color: var(--text);
    font-size: 1.6rem;
    cursor: pointer;
}

.custom-modal__header {
    max-width: 760px;
    margin-bottom: 24px;
}

.custom-modal__title {
    margin: 0 0 10px;
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    line-height: 1.1;
}

.custom-modal__text {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.7;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.plan-card {
    background: #fff;
    border: 1px solid rgba(7, 20, 38, 0.08);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.plan-card--featured {
    border-color: rgba(228, 60, 19, 0.22);
    box-shadow: 0 18px 34px rgba(228, 60, 19, 0.10);
}

.plan-card__top {
    margin-bottom: 16px;
}

.plan-card__badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(7, 20, 38, 0.08);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.plan-card__badge--accent {
    background: rgba(228, 60, 19, 0.12);
    color: var(--accent);
}

.plan-card__title {
    margin: 0 0 6px;
    font-size: 1.6rem;
    line-height: 1.15;
}

.plan-card__subtitle {
    margin: 0;
    color: var(--text-soft);
}

.plan-card__price {
    background: rgba(7, 20, 38, 0.04);
    border: 1px solid rgba(7, 20, 38, 0.08);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .plan-card__price strong {
        font-size: 1.35rem;
    }

    .plan-card__price span {
        color: var(--text-soft);
    }

.plan-card__list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    display: grid;
    gap: 10px;
}

    .plan-card__list li {
        position: relative;
        padding-left: 18px;
        line-height: 1.6;
    }

        .plan-card__list li::before {
            content: "";
            width: 7px;
            height: 7px;
            border-radius: 999px;
            background: var(--accent);
            position: absolute;
            left: 0;
            top: 10px;
        }

.plan-card__note {
    margin: auto 0 0;
    color: var(--text-soft);
    font-size: 0.95rem;
}

.custom-modal__footer {
    margin-top: 24px;
    display: grid;
    gap: 16px;
}

.custom-modal__legal {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.7;
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 991px) {
    .plans-grid {
        grid-template-columns: 1fr;
    }

    .custom-modal__dialog {
        padding: 22px;
    }
}

.custom-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

    .custom-modal.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

.custom-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.custom-modal.is-open .custom-modal__backdrop {
    opacity: 1;
}

.custom-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 1100px);
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22), 0 8px 24px rgba(15, 23, 42, 0.10);
    opacity: 0;
    transform: translateY(-24px);
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.custom-modal.is-open .custom-modal__dialog {
    opacity: 1;
    transform: translateY(0);
}

.custom-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

    .custom-modal__close:hover {
        background: rgba(15, 23, 42, 0.14);
        transform: scale(1.04);
    }

body.modal-open {
    overflow: hidden;
}

/* HEADER / FOOTER opcional, por si quieres más aire */
.custom-modal__header,
.custom-modal__footer {
    padding-left: 2rem;
    padding-right: 2rem;
}

.custom-modal__header {
    padding-top: 2rem;
}

.custom-modal__footer {
    padding-bottom: 2rem;
}

/* MOBILE */
@media (max-width: 768px) {
    .custom-modal {
        padding: 0.75rem;
        align-items: end;
    }

    .custom-modal__dialog {
        width: 100%;
        max-height: 92vh;
        border-radius: 22px 22px 0 0;
        transform: translateY(28px);
    }

    .custom-modal.is-open .custom-modal__dialog {
        transform: translateY(0);
    }

    .custom-modal__header,
    .custom-modal__footer {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .custom-modal__header {
        padding-top: 1.5rem;
    }

    .custom-modal__footer {
        padding-bottom: 1.5rem;
    }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .custom-modal,
    .custom-modal__backdrop,
    .custom-modal__dialog,
    .custom-modal__close {
        transition: none !important;
    }
}