/*
 Theme Name:   Divi Child
 Theme URI:    https://www.elegantthemes.com/gallery/divi/
 Description:  Tema hijo para tener el control total del código.
 Author:       Tu Nombre
 Template:     Divi
 Version:      1.0.0
*/

/* --- MENÚ PERSONALIZADO (WHITE GLASS) --- */

/* 1. El Botón Hamburguesa (Trigger) */
.custom-trigger {
    position: fixed; /* O absolute si prefieres que se mueva */
    top: 25px;
    right: 25px;
    width: 40px;
    height: 30px;
    cursor: pointer;
    z-index: 99998; /* Muy alto, pero debajo del overlay abierto */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Las 3 rayitas negras */
.custom-trigger .linea {
    width: 100%;
    height: 4px;
    background-color: #000000;
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* 2. El Overlay (Fondo Blanco Vidrio) */
.custom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    
    /* TU EFECTO DESEADO: Blanco Vidrio */
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    z-index: 99999; /* Encima de todo */
    
    /* Estado inicial: Oculto */
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease-in-out;
    
    /* Centrado Flexbox Puro */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Estado Activo (Cuando se abre) */
.custom-overlay.activo {
    opacity: 1;
    visibility: visible;
}

/* 3. Botón Cerrar (La X) */
.custom-close {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    cursor: pointer;
}

/* Dibujamos la X con CSS puro */
.custom-close:before, .custom-close:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 4px;
    background-color: #000000; /* X Negra */
    top: 50%;
    left: 0;
    border-radius: 4px;
}
.custom-close:before { transform: rotate(45deg); }
.custom-close:after { transform: rotate(-45deg); }

/* 4. Los Enlaces (Tipografía) */
.custom-nav-container {
    display: flex;
    flex-direction: column;
    gap: 40px; /* Separación entre links */
    text-align: center;
}

.custom-link {
    font-family: 'IBM Plex Serif', sans-serif; /* Tu fuente */
    font-size: clamp(2.5rem, 5vw, 4rem); /* Texto Grande */
    font-weight: 800; /* Extra Bold */
    color: #1a1a1a !important;
    text-decoration: none;
    transition: transform 0.3s ease, color 0.3s ease;
}

.custom-link:hover {
    color: #555;
    transform: scale(1.1);
}

/* Reduce el tamaño del sufijo (M) y prefijo (+) */
.text-small {
    font-size: 0.7em; /* Esto es el 60% del tamaño del número */
    vertical-align: baseline; /* Alineación */
    font-weight: 700; /* Opcional: Hacerla más delgada que el número */
    opacity: 0.3; /* Opcional: Un poco más suave */
    margin-left: 0.15em;    /* Un pequeño respiro a la izquierda */
}

/* =========================================================
   Divi 5 Contact Form (scope por Attributes)
   Requiere: data-scope="legal-form" (Target: Module)
   Compatible si el atributo cae en wrapper o en .et_pb_contact
   ========================================================= */

/* --- ESTILO FORMULARIO "REACT" PARA DIVI --- */

/* 1. Contenedor del Formulario */
.et_pb_contact_form_container {
    background: #ffffff;
    padding: clamp(1.25rem, 2vw + 1rem, 2.5rem) !important;
}

/* 2. Las Etiquetas (Títulos de los campos) */
.et_pb_contact_field_label {
    display: block !important; /* Forzar que se vean */
    color: #1a1a1a;
    font-weight: 700 !important;
    font-size: 14px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: none !important; /* Quitar mayúsculas forzadas */
}

/* 3. Los Campos (Inputs) */
.et_pb_contact_field input, 
.et_pb_contact_field textarea {
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    border-radius: 6px !important;
    padding: 12px 15px !important;
    font-size: 15px !important;
    color: #333 !important;
    transition: all 0.3s ease;
    width: 100%;
}

/* 4. Efecto al hacer clic (Focus) */
.et_pb_contact_field input:focus, 
.et_pb_contact_field textarea:focus {
    background-color: #ffffff !important;
    border-color: #0d1b2a !important; /* Tu Azul Oscuro */
    box-shadow: 0 0 0 3px rgba(13, 27, 42, 0.1) !important; /* Resplandor azul suave */
    outline: none;
}

/* 5. El Botón de Enviar (Full Width) */
.et_contact_bottom_container {
    width: 100%;
    margin-top: 20px;
}

.et_pb_contact_submit {
    width: 100% !important; /* Botón ancho completo */
    background-color: #0d1b2a !important; /* Tu Azul Oscuro */
    color: #ffffff !important;
    font-weight: 700 !important;
    margin-left: 0px;
    border: none !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.3s ease !important;
}

.et_pb_contact_submit:hover {
    background-color: #c9a063 !important; /* Tu Dorado al pasar el mouse */
    transform: translateY(-2px); /* Pequeño salto hacia arriba */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.et_pb_button_wrapper {
    width: 100%;
}

/* 7. Sombra Info de Contacto */
.et_pb_group_9 {
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); /* Sombra suave elegante */
}

/* CONTENEDOR PRINCIPAL Widget Whatsapp */
#cima-whatsapp-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: 'Montserrat', sans-serif;
}

/* --- 1. BOTÓN REDONDO --- */
.wa-float-btn {
    /* Posición obligatoria */
    position: fixed !important; 
    bottom: 25px !important;   /* Lo subimos para que no toque la barra negra */
    right: 25px !important;    /* Lo separamos del borde derecho */
    
    /* Capa superior (Encima de todo) */
    z-index: 99999 !important; 
    
    /* Tamaño y forma (Mantenemos lo que tenías) */
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px #999;
    
    /* Aseguramos que sea clicable */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.4s ease-in-out, transform 0.3s ease;
}

/* --- ANIMACIÓN DE ONDAS CON PAUSA (NATURAL) --- */

/* 1. Definimos el movimiento: Rápido al inicio, quieto al final */
@keyframes wa-ripple-pause {
    0% {
        transform: scale(1);
        opacity: 0.75;
    }
    60% {
        /* La onda termina de crecer aquí (aprox a los 1.6 seg) */
        transform: scale(2.5);
        opacity: 0;
    }
    100% {
        /* Se queda invisible y quieto el resto del tiempo (Pausa) */
        transform: scale(2.5);
        opacity: 0;
    }
}

/* 2. Configuración de las capas */
.wa-float-btn::before,
.wa-float-btn::after {
    content: '';
    position: absolute;
    width: 100%; 
    height: 100%;
    border-radius: 50%;
    background: #25d366;
    z-index: -1;
    opacity: 0;
    
    /* Duración total de 4 segundos (2s acción + 2s pausa) */
    animation: wa-ripple-pause 4s infinite cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 3. El retraso de la segunda onda */
/* Sale un poquito después para que no se vean idénticas */
.wa-float-btn::after {
    animation-delay: 1s; 
}

/* 4. Apagar si se abre el chat */
#cima-whatsapp-widget.active .wa-float-btn::before,
#cima-whatsapp-widget.active .wa-float-btn::after {
    animation: none;
}

/* 4. Apagar si se abre el chat */
#cima-whatsapp-widget.active .wa-float-btn::before,
#cima-whatsapp-widget.active .wa-float-btn::after {
    animation: none;
}

/* Iconos (Switch) */
.wa-float-btn svg { width: 32px; height: 32px; transition: all 0.3s; position: absolute;}
.icon-close { opacity: 0; transform: rotate(-90deg); width: 24px !important; }
.icon-wa { opacity: 1; transform: rotate(0deg); }

/* ESTADO ACTIVO (Cuando se abre) */
#cima-whatsapp-widget.active .wa-float-btn { background-color: #128c7e; transform: rotate(0deg); }
#cima-whatsapp-widget.active .wa-float-btn::before { animation: none; } /* Parar pulso */
#cima-whatsapp-widget.active .icon-wa { opacity: 0; transform: rotate(90deg); }
#cima-whatsapp-widget.active .icon-close { opacity: 1; transform: rotate(0deg); }

/* FIX: Detener el temblor al interactuar para que no se quede chueco */
    .wa-float-btn:hover .icon-wa,
    .wa-float-btn:active .icon-wa,
    .wa-float-btn:focus .icon-wa {
    animation-play-state: paused; /* Pausa la animación */
    animation: none !important;   /* O mejor, la quita del todo */
    transform: rotate(0deg) !important; /* Fuerza la posición recta */
}

/* --- 2. CAJA DE CHAT (Tooltip) --- */
.wa-chat-box {
    position: absolute;
    bottom: 80px; /* Encima del botón */
    right: 0;
    width: 300px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28); /* Efecto rebote suave */
    transform-origin: bottom right;
}

#cima-whatsapp-widget.active .wa-chat-box {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Cabecera del chat */
.wa-header {
    background: #095e54; /* Verde oscuro oficial */
    padding: 20px;
    display: flex;
    align-items: center;
    color: white;
}
.wa-avatar svg { width: 40px; height: 40px; background: #fff; border-radius: 50%; padding: 5px; color: #ddd; margin-right: 15px;}
.wa-name { display: block; font-weight: 700; font-size: 16px; }
.wa-status { display: block; font-size: 12px; opacity: 0.8; }

/* Cuerpo del chat */
.wa-body { padding: 20px; background: #e5ddd5; /* Color fondo chat whatsapp */ }
.wa-message {
    background: #fff;
    padding: 10px 15px;
    border-radius: 0 10px 10px 10px;
    font-size: 14px;
    color: #333;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    position: relative;
}
.wa-message::before { /* Triangulito del mensaje */
    content: ''; position: absolute; left: -8px; top: 0;
    border-width: 0 10px 10px 0; border-style: solid; border-color: transparent #fff transparent transparent;
}

/* Botón Iniciar */
.wa-start-btn {
    display: flex; justify-content: center; align-items: center;
    background: #25d366;
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 12px;
    border-radius: 25px;
    text-align: center;
    transition: background 0.3s;
    margin: 0 20px 20px 20px; /* Margen externo */
}
.wa-start-btn:hover { background: #128c7e; }

/* Móvil */
@media (max-width: 480px) {
    .wa-chat-box { width: 280px; bottom: 70px; right: -10px; }
}

/* --- ANIMACIÓN DE "TEMBLOR" DEL ICONO --- */
@keyframes wa-shake {
    0% { transform: rotate(0deg); }
    5% { transform: rotate(-25deg); }
    10% { transform: rotate(15deg); }
    15% { transform: rotate(-20deg); }
    20% { transform: rotate(15deg); }
    25% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); } /* Pausa larga hasta que reinicie */
}

/* Aplicamos la animación SOLO al icono de WhatsApp */
.wa-float-btn .icon-wa {
    animation: wa-shake 3s infinite ease-in-out; /* Tiembla cada 4 segundos */
    transform-origin: center; /* Que gire sobre su propio eje */
}

/* IMPORTANTE: Que NO tiemble cuando ya abriste el chat (y se ve la X) */
#cima-whatsapp-widget.active .icon-wa {
    animation: none;
}

/* Ocultar badge de reCAPTCHA */
.grecaptcha-badge { 
    opacity: 0;
    left: 20px;
    right: auto;
    bottom: 20px !important; 
    width: 70px !important;
}

/* Que se expanda al pasar el mouse (para leer el texto legal) */
.grecaptcha-badge:hover { 
    width: 256px !important;
}
/* Disable Divi Animations on Mobile */
@media (max-width: 980px) {
  .et_animated {
    animation: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }
}

/* Ocultar Header por defecto de Divi (Escritorio y Móvil) */
#main-header, 
#top-header, 
.mobile_menu_bar {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Color SVG */
.et_pb_main_blurb_image img[src*=".svg"] {
    filter: brightness(0) invert(1);
}

/* Alineacion Info Contacto */
.et_pb_blurb_content {
    margin-left: 0;
}

/* Brake correo info */
.et_pb_blurb_1 .et_pb_blurb_description {
  overflow-wrap: anywhere;
}

/* Forzar renderizado inmediato del Hero (Eliminar LCP Render Delay) */
.et_pb_section_0 {
    opacity: 1 !important;
    animation: none !important;
    transition: none !important;
    visibility: visible !important;
    will-change: transform;
}

/* 1. Crear el espacio para el menú (Elimina CLS) */
body {
    padding-top: 5.4rem !important;
}

@media (max-width: 980px) {
    body {
        padding-top: 85px !important; /* Ajuste para movil */
    }
}

/* 2. Forzar pintado inmediato de la imagen Hero (Elimina Render Delay) */
.et_pb_section_0 {
    opacity: 1 !important;
    visibility: visible !important;
    animation: none !important;
    transition: none !important;
}