/**
 * style-popup.css — Popup Widget
 * Eternity Residence Alphaville
 * 3 tipos: Modal (exit), Barra (scroll), Toast (timed)
 */

/* ================================================================
   ANIMAÇÕES GLOBAIS
   ================================================================ */
@keyframes popup-fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes popup-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popup-slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes popup-slideInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes popup-slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}


/* ================================================================
   1. POPUP MODAL (Exit Intent)
   ================================================================ */
.popup-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.popup-modal[hidden] {
    display: none;
}

.popup-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.65);
    animation: popup-fadeIn 0.3s ease;
}

.popup-modal__box {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 16px;
    max-width: 520px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.popup-anim-fadeInUp {
    animation: popup-fadeInUp 0.4s ease;
}

.popup-anim-fadeIn {
    animation: popup-fadeIn 0.4s ease;
}

.popup-anim-slideInRight {
    animation: popup-slideInRight 0.4s ease;
}

.popup-anim-slideInLeft {
    animation: popup-slideInLeft 0.4s ease;
}

.popup-modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: rgba(0,0,0,0.4);
    border: none;
    color: #fff;
    font-size: 1.6rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.3s ease;
    line-height: 1;
}

.popup-modal__close:hover {
    background: rgba(0,0,0,0.7);
}

/* Imagem */
.popup-modal__img-box {
    width: 100%;
    overflow: hidden;
}

.popup-modal__img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* Body */
.popup-modal__body {
    padding: 28px 28px 32px;
    text-align: center;
}

.popup-modal__titulo {
    font-family: 'Playfair Display', 'Montserrat', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1E2A1E;
    margin-bottom: 12px;
    line-height: 1.3;
}

.popup-modal__subtitulo {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 12px;
    line-height: 1.6;
}

.popup-modal__texto {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.88rem;
    color: #777;
    margin-bottom: 24px;
    line-height: 1.6;
}

/* Botões */
.popup-modal__botoes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.popup-modal__btn {
    display: block;
    padding: 14px 24px;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.popup-modal__btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}


/* ================================================================
   2. POPUP BARRA (Scroll trigger)
   ================================================================ */
.popup-barra {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999990;
    animation: popup-slideUp 0.4s ease;
}

.popup-barra[hidden] {
    display: none;
}

.popup-barra__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 14px 24px;
    flex-wrap: wrap;
}

.popup-barra__conteudo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.popup-barra__titulo {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
}

.popup-barra__texto {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    opacity: 0.9;
}

.popup-barra__btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

.popup-barra__btn:hover {
    opacity: 0.9;
}

.popup-barra__close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    line-height: 1;
    padding: 4px;
}

.popup-barra__close:hover {
    opacity: 1;
}


/* ================================================================
   3. POPUP TOAST (Timed notification)
   ================================================================ */
.popup-toast {
    position: fixed;
    z-index: 999980;
    max-width: 340px;
    width: calc(100% - 32px);
}

.popup-toast[hidden] {
    display: none;
}

/* Posições */
.popup-toast--bottom-left {
    bottom: 96px;
    left: 16px;
    animation: popup-slideInLeft 0.4s ease;
}

.popup-toast--bottom-right {
    bottom: 96px;
    right: 16px;
    animation: popup-slideInRight 0.4s ease;
}

.popup-toast--top-left {
    top: 96px;
    left: 16px;
    animation: popup-slideInLeft 0.4s ease;
}

.popup-toast--top-right {
    top: 96px;
    right: 16px;
    animation: popup-slideInRight 0.4s ease;
}

.popup-toast__inner {
    background: #fff;
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border-left: 4px solid #b15d38;
    position: relative;
}

.popup-toast__close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 2px;
}

.popup-toast__close:hover {
    color: #333;
}

.popup-toast__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.popup-toast__icone {
    font-size: 1.2rem;
}

.popup-toast__titulo {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1E2A1E;
}

.popup-toast__texto {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.82rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 14px;
}

.popup-toast__btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.popup-toast__btn:hover {
    opacity: 0.9;
}


/* ================================================================
   RESPONSIVO
   ================================================================ */
@media (max-width: 768px) {
    .popup-modal__box {
        max-width: 95vw;
    }

    .popup-modal__img {
        height: 150px;
    }

    .popup-modal__body {
        padding: 20px 20px 24px;
    }

    .popup-modal__titulo {
        font-size: 1.2rem;
    }

    .popup-barra__inner {
        flex-direction: column;
        text-align: center;
        padding: 12px 16px;
        gap: 10px;
    }

    .popup-barra__conteudo {
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .popup-toast {
        left: 8px;
        right: 8px;
        max-width: none;
        width: auto;
    }

    .popup-toast--bottom-left,
    .popup-toast--bottom-right {
        bottom: 80px;
    }
}
