/* ============================================================
   components/legal-modal.css
   Modal flutuante para documentos legais
   cafedireto.com.br
   Direto do produtor pra sua mesa
   ============================================================ */

.legal-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9990;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(12, 18, 14, 0.68);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.legal-modal-overlay.is-open {
    display: flex;
}

.legal-modal-box {
    position: relative;
    width: 70vw;
    height: 70vh;
    max-width: 1180px;
    min-width: 720px;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    border: 1px solid rgba(218, 184, 121, 0.35);
}

.legal-modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 58px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #10341f, #1f4d34);
    color: #ffffff;
}

.legal-modal-title {
    display: grid;
    gap: 2px;
}

.legal-modal-title strong {
    font-size: 0.98rem;
    letter-spacing: 0.02em;
}

.legal-modal-title span {
    font-size: 0.78rem;
    opacity: 0.82;
}

.legal-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 5;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: 0.18s ease;
}

.legal-modal-close:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.04);
}

.legal-modal-frame-wrap {
    width: 100%;
    height: calc(100% - 58px);
    background: #fbf7ef;
}

.legal-modal-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
}

.legal-modal-loading {
    position: absolute;
    inset: 58px 0 0;
    z-index: 1;
    display: grid;
    place-items: center;
    background: #fbf7ef;
    color: #1f4d34;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.legal-modal-overlay.is-loaded .legal-modal-loading {
    display: none;
}

body.legal-modal-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .legal-modal-overlay {
        padding: 14px;
    }

    .legal-modal-box {
        width: 92vw;
        height: 82vh;
        min-width: 0;
        border-radius: 18px;
    }

    .legal-modal-header {
        min-height: 56px;
        padding: 11px 58px 11px 14px;
    }

    .legal-modal-title strong {
        font-size: 0.9rem;
    }

    .legal-modal-title span {
        font-size: 0.72rem;
    }

    .legal-modal-close {
        top: 9px;
        right: 10px;
        width: 38px;
        height: 38px;
    }

    .legal-modal-frame-wrap {
        height: calc(100% - 56px);
    }

    .legal-modal-loading {
        inset: 56px 0 0;
    }
}

@media (max-width: 480px) {
    .legal-modal-overlay {
        padding: 8px;
    }

    .legal-modal-box {
        width: 96vw;
        height: 86vh;
        border-radius: 16px;
    }
}