/* ==================================================
   Visor PDF modal compartido
   --------------------------------------------------
   Este archivo acompaña a assets/js/fp-site.js y se carga junto
   con las secciones públicas para que el visor PDF no dependa
   del CSS global fp-site.css.
================================================== */

.fp-pdf-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: "Montserrat", sans-serif;
}

.fp-pdf-modal.is-open {
    display: flex;
}

.fp-pdf-modal-open {
    overflow: hidden;
}

.fp-pdf-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 18, 24, 0.68);
    backdrop-filter: blur(8px);
}

.fp-pdf-modal__dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(1180px, calc(100vw - 36px));
    height: min(86vh, 900px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 28px;
    background: #ffffff;
    box-shadow: 0 34px 90px rgba(30, 12, 26, 0.34);
}

.fp-pdf-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(111, 0, 46, 0.12);
    background: linear-gradient(135deg, #ffffff 0%, #fff7fa 100%);
}

.fp-pdf-modal__header span {
    display: block;
    margin-bottom: 5px;
    color: #0b1f3a;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.fp-pdf-modal__header h2 {
    margin: 0;
    color: #2a1420;
    font-size: clamp(1.15rem, 2vw, 1.85rem);
    line-height: 1.1;
}

.fp-pdf-modal__close {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: #6f002e;
    color: #ffffff;
    cursor: pointer;
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fp-pdf-modal__close:hover,
.fp-pdf-modal__close:focus {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(111, 0, 46, 0.22);
}

.fp-pdf-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    background: #f5f0f3;
}

.fp-pdf-modal__frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
}

.fp-pdf-modal__viewer {
    display: none;
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 14px 10px 22px;
    background: #f5f0f3;
    -webkit-overflow-scrolling: touch;
}

.fp-pdf-modal__body.is-pdfjs .fp-pdf-modal__frame {
    display: none;
}

.fp-pdf-modal__body.is-pdfjs .fp-pdf-modal__viewer {
    display: block;
}

.fp-pdf-modal__page {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 14px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(30, 12, 26, 0.16);
    overflow: hidden;
}

.fp-pdf-modal__page canvas {
    display: block;
    max-width: 100%;
    height: auto !important;
}

.fp-pdf-modal__message {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 28px;
    color: #5f4c57;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
    text-align: center;
}

.fp-pdf-modal__message.is-error {
    color: #6f002e;
}

.fp-pdf-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-top: 1px solid rgba(111, 0, 46, 0.12);
    background: #ffffff;
}

.fp-pdf-modal__footer p {
    margin: 0;
    color: #5f4c57;
    font-size: 0.92rem;
    line-height: 1.4;
}

.fp-pdf-modal__open,
.fp-pdf-modal__footer .fp-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px 22px;
    border: 0;
    border-radius: 999px;
    background: #6f002e;
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 14px 30px rgba(111, 0, 46, 0.18);
}

.fp-pdf-modal__open:hover,
.fp-pdf-modal__open:focus,
.fp-pdf-modal__footer .fp-btn:hover,
.fp-pdf-modal__footer .fp-btn:focus {
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(111, 0, 46, 0.24);
}

@media (max-width: 767px) {
    .fp-pdf-modal {
        padding: 10px;
    }

    .fp-pdf-modal__dialog {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
        border-radius: 20px;
    }

    .fp-pdf-modal__header {
        padding: 16px;
    }

    .fp-pdf-modal__close {
        width: 40px;
        height: 40px;
        font-size: 1.8rem;
    }

    .fp-pdf-modal__footer {
        align-items: stretch;
        flex-direction: column;
        padding: 14px;
    }

    .fp-pdf-modal__footer .fp-btn {
        width: 100%;
    }
}
