/* ============================================
   Popup de Contacto WhatsApp
   ============================================ */

/* Overlay - fondo oscuro */
.wa-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
    overflow-y: auto;
}

.wa-modal-overlay.wa-active {
    display: flex;
    opacity: 1;
}

/* Contenedor del modal */
.wa-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 95vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.25s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.wa-modal-overlay.wa-active .wa-modal {
    transform: scale(1);
}

/* Header con degradé verde WhatsApp */
.wa-modal-header {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: #fff;
    padding: 24px 28px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
}

.wa-modal-header-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wa-modal-header-icon svg {
    width: 26px;
    height: 26px;
    fill: #fff;
}

.wa-modal-header-text h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.wa-modal-header-text p {
    margin: 4px 0 0;
    font-size: 15px;
    opacity: 0.95;
    color: #fff;
}

/* Botón cerrar */
.wa-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    padding: 0;
}

.wa-modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Body - formulario */
.wa-modal-body {
    padding: 24px 28px 28px;
}

.wa-form-group {
    margin-bottom: 16px;
}

.wa-form-group label {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #222;
    margin-bottom: 6px;
}

.wa-form-group label .wa-required {
    color: #E83A15;
    margin-left: 2px;
}

.wa-form-group input,
.wa-form-group select,
.wa-form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    font-size: 19px; /* 16px mínimo para evitar zoom automático en iOS */
    font-family: inherit;
    color: #222;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.wa-form-group input:focus,
.wa-form-group select:focus,
.wa-form-group textarea:focus {
    outline: none;
    border-color: #25d366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}

.wa-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.wa-form-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23555' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

/* Error state */
.wa-form-group.wa-error input,
.wa-form-group.wa-error select,
.wa-form-group.wa-error textarea {
    border-color: #E83A15;
}

.wa-form-group.wa-error input:focus,
.wa-form-group.wa-error select:focus,
.wa-form-group.wa-error textarea:focus {
    box-shadow: 0 0 0 3px rgba(232, 58, 21, 0.15);
}

.wa-error-msg {
    display: none;
    color: #E83A15;
    font-size: 12px;
    margin-top: 4px;
}

.wa-form-group.wa-error .wa-error-msg {
    display: block;
}

/* Botón enviar */
.wa-submit-btn {
    width: 100%;
    padding: 13px 20px;
    background: #25d366;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s ease, transform 0.1s ease;
    margin-top: 6px;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.wa-submit-btn:hover {
    background: #1faa54;
}

.wa-submit-btn:active {
    transform: scale(0.98);
}

.wa-submit-btn svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

/* Responsive - Tablet y Mobile */
@media (max-width: 576px) {
    .wa-modal-overlay {
        padding: 20px 14px;
        align-items: center;
    }

    .wa-modal {
        max-width: 100%;
        max-height: calc(100vh - 40px);
        border-radius: 14px;
    }

    .wa-modal-header {
        padding: 18px 20px;
        gap: 12px;
        border-radius: 14px 14px 0 0;
    }

    .wa-modal-header-icon {
        width: 42px;
        height: 42px;
    }

    .wa-modal-header-icon svg {
        width: 24px;
        height: 24px;
    }

    .wa-modal-header-text {
        padding-right: 36px;
    }

    .wa-modal-header-text h3 {
        font-size: 17px;
    }

    .wa-modal-header-text p {
        font-size: 12px;
        line-height: 1.35;
    }

    .wa-modal-body {
        padding: 20px 20px 22px;
    }

    .wa-form-group {
        margin-bottom: 14px;
    }

    .wa-form-group label {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 5px;
    }

    .wa-form-group input,
    .wa-form-group select,
    .wa-form-group textarea {
        font-size: 16px; /* 16px para evitar zoom de iOS */
        padding: 10px 12px;
    }

    .wa-form-group textarea {
        min-height: 70px;
    }

    .wa-submit-btn {
        padding: 12px 18px;
        font-size: 14px;
    }
}

/* Pantallas muy chicas (iPhone SE y similares) */
@media (max-width: 360px) {
    .wa-modal-overlay {
        padding: 16px 10px;
    }

    .wa-modal-header {
        padding: 16px 18px;
    }

    .wa-modal-header-text h3 {
        font-size: 15px;
    }

    .wa-modal-body {
        padding: 18px 18px 20px;
    }

    .wa-form-group {
        margin-bottom: 12px;
    }
}

/* Bloqueo de scroll del body cuando el modal está abierto */
body.wa-modal-open {
    overflow: hidden;
}
