/* WhatsApp Contact - Public Styles */

/* Botón flotante */
.wa-contact-button {
    position: fixed;
    bottom: 20px;
    z-index: 9999;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #25D366;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: wa-contact-pulse 2s infinite;
}

.wa-contact-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
}

.wa-contact-button.wa-contact-position-right {
    right: 20px;
}

.wa-contact-button.wa-contact-position-left {
    left: 20px;
}

.wa-contact-button.wa-contact-size-small {
    width: 50px;
    height: 50px;
}

.wa-contact-button.wa-contact-size-medium {
    width: 55px;
    height: 55px;
}

.wa-contact-button.wa-contact-size-large {
    width: 60px;
    height: 60px;
}

/* Animación de pulso */
@keyframes wa-contact-pulse {
    0% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.6), 0 0 0 10px rgba(37, 211, 102, 0.1);
    }
    100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
}

/* Modal */
.wa-contact-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: wa-contact-fadeIn 0.3s ease;
}

.wa-contact-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.wa-contact-modal-content {
    background-color: #fff;
    border-radius: 12px;
    max-width: 450px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: wa-contact-slideUp 0.3s ease;
}

.wa-contact-modal-header {
    padding: 15px 15px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.wa-contact-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.wa-contact-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
    line-height: 1;
    padding: 0;
}

.wa-contact-close:hover {
    color: #333;
}

.wa-contact-modal-body {
    padding: 15px;
}

/* Información del agente */
.wa-contact-agent-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
}

.wa-contact-agent-photo {
    flex: 0 0 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wa-contact-agent-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none; /* Se mostrará vía JavaScript cuando haya foto */
}

.wa-contact-agent-photo::before {
    content: '';
    display: block;
    width: 30px;
    height: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23adb5bd'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.wa-contact-agent-photo.has-photo::before {
    display: none;
}

.wa-contact-agent-details {
    flex: 1;
}

.wa-contact-agent-details h4 {
    margin: 0 0 2px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.wa-contact-agent-details p {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.3;
}

/* Mensaje motivador del agente */
.wa-contact-agent-motivation {
    margin-top: 8px;
    padding: 10px 12px;
    background: #fff;
    border-left: 4px solid #25D366;
    border-radius: 8px;
    color: #2b2b2b;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.wa-contact-subtitle:empty {
    display: none;
    margin: 0;
}

.wa-contact-subtitle {
    color: #666;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.4;
}

/* Formulario */
.wa-contact-field-group {
    margin-bottom: 12px;
}

.wa-contact-field-group label {
    display: block;
    margin-bottom: 4px;
    color: #333;
    font-weight: 500;
    font-size: 13px;
}

.wa-contact-field-group input,
.wa-contact-field-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    height: 36px;
}

.wa-contact-field-group input:focus,
.wa-contact-field-group select:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.1);
}

/* Grupo de teléfono */
.wa-contact-phone-group {
    display: flex;
    gap: 8px;
}

.wa-contact-phone-group select {
    flex: 0 0 90px;
}

.wa-contact-phone-group input {
    flex: 1;
}

/* Contenedor de teléfono con prefijo */
.wa-phone-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.wa-phone-prefix {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 14px;
    font-weight: 600;
    pointer-events: none;
    z-index: 1;
    user-select: none;
    background: #fff;
    padding-right: 4px;
}

.wa-phone-input-wrapper input[type="tel"] {
    padding-left: 50px !important;
}

/* Botón de envío */
.wa-contact-submit-group {
    margin-top: 20px;
}

.wa-contact-submit-btn {
    width: 100%;
    padding: 10px;
    background-color: #25D366;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 40px;
}

.wa-contact-submit-btn:hover {
    background-color: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.4);
}

.wa-contact-submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Estados de carga y éxito */
.wa-contact-loading,
.wa-contact-success {
    text-align: center;
    padding: 30px;
}

.wa-contact-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #25D366;
    border-radius: 50%;
    animation: wa-contact-spin 1s linear infinite;
    margin: 0 auto 20px;
}

.wa-contact-success-icon {
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin: 0 auto 20px;
    animation: wa-contact-bounce 0.6s ease;
}

/* Animaciones */
@keyframes wa-contact-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes wa-contact-slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes wa-contact-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes wa-contact-bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0, -10px, 0);
    }
    70% {
        transform: translate3d(0, -5px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .wa-contact-button {
        bottom: 15px;
        width: 55px;
        height: 55px;
    }
    
    .wa-contact-button.wa-contact-position-right {
        right: 15px;
    }
    
    .wa-contact-button.wa-contact-position-left {
        left: 15px;
    }
    
    .wa-contact-modal-content {
        width: 95%;
        margin: 15px;
    }
    
    .wa-contact-modal-header,
    .wa-contact-modal-body {
        padding: 15px;
    }
    
    .wa-contact-modal-header h3 {
        font-size: 18px;
    }
    
    .wa-contact-phone-group {
        display: grid;
        grid-template-columns: 90px 1fr;
        gap: 8px;
    }
    
    .wa-contact-phone-group select {
        width: 100%;
    }
    
    .wa-contact-agent-info {
        padding: 10px;
    }
    
    .wa-contact-agent-photo {
        flex: 0 0 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .wa-contact-modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: none;
        margin: 0;
    }
    
    .wa-contact-modal-header,
    .wa-contact-modal-body {
        padding: 12px;
    }
    
    .wa-contact-field-group {
        margin-bottom: 10px;
    }
    
    .wa-contact-submit-group {
        margin-top: 15px;
    }
}

/* reCAPTCHA Badge Control */
.grecaptcha-badge {
    z-index: 9998 !important;
} 