/* =========================================
   VARIABLES Y CONFIGURACIÓN BASE
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Manrope:wght@300;400;500;600;700&display=swap');

:root {
    /* Nueva paleta Premium */
    --blanco-calido: #FAF8F4;
    --beige-claro: #F2ECE3;
    --verde-lima: #B8D400;
    --verde-oliva: #556B2F;
    
    /* Textos neutros para elegancia y legibilidad */
    --texto-oscuro: #333333;
    --texto-gris: #5A5A5A;
    --blanco: #FFFFFF;

    /* --- COMPATIBILIDAD CON HTML (Estilos en línea) --- */
    /* Asignamos las variables antiguas a los nuevos colores premium */
    --verde-oscuro: var(--verde-oliva);
    --verde-corporativo: var(--verde-oliva); /* Oliva para máxima legibilidad en textos y etiquetas */
    --gris-fondo: var(--beige-claro);
    --texto-principal: var(--texto-oscuro);
    --texto-secundario: var(--texto-gris);
    --verde-claro: #EBEFCD; /* Tono cálido muy suave para iconos y números */
    
    /* Sombras premium: muy suaves y difuminadas */
    --sombra-suave: 0 12px 35px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    background-color: var(--blanco-calido); /* Fondo principal cálido y minimalista */
    color: var(--texto-oscuro);
    font-family: 'Manrope', sans-serif; /* Tipografía para textos */
    font-weight: 400;
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =========================================
   TIPOGRAFÍA DE TÍTULOS
   ========================================= */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Cormorant Garamond', serif;
    color: var(--verde-oliva);
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

/* =========================================
   NAVEGACIÓN Y CABECERA
   ========================================= */
.top-bar {
    background-color: var(--verde-oliva);
    color: var(--blanco-calido);
    padding: 0.5rem 5%;
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    align-items: center;
    flex-wrap: nowrap; /* Evita que salte de línea en la medida de lo posible */
    gap: 15px;
    font-weight: 500;
}

.top-bar div {
    display: flex;
    align-items: center;
    white-space: nowrap; /* Mantiene los datos de contacto juntos */
}

.top-bar a {
    color: var(--blanco-calido);
    text-decoration: none;
    transition: color 0.3s ease;
}

.top-bar a:hover {
    color: var(--verde-lima);
}

header {
    background-color: rgba(250, 248, 244, 0.95); /* Blanco cálido con transparencia */
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-container img {
    height: 85px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo-container img:hover {
    transform: scale(1.02);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
}

nav a {
    text-decoration: none;
    color: var(--texto-gris);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    transition: color 0.3s ease;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--verde-lima); /* Detalle en lima */
    transition: width 0.3s ease;
}

nav a:hover, nav a.activo {
    color: var(--verde-oliva);
}

nav a:hover::after, nav a.activo::after {
    width: 100%;
}

/* =========================================
   BOTONES
   ========================================= */
.btn-verde {
    font-family: 'Manrope', sans-serif;
    font-weight: 600; /* SemiBold como pidieron */
    background-color: var(--verde-lima);
    color: var(--verde-oliva); /* Oliva oscuro para que contraste bien con el verde lima claro */
    padding: 12px 28px;
    border: none;
    border-radius: 30px;
    text-decoration: none;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(184, 212, 0, 0.2);
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-verde:hover {
    background-color: var(--verde-oliva);
    color: var(--blanco-calido);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(85, 107, 47, 0.2);
}

/* =========================================
   ESTRUCTURA PRINCIPAL Y ELEMENTOS
   ========================================= */
main {
    flex: 1 0 auto;
    width: 100%;
}

.contenedor {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 20px;
}

.linea-separadora {
    height: 3px;
    width: 60px;
    background-color: var(--verde-lima);
    margin-bottom: 2.5rem;
    border-radius: 2px;
}

/* Asegurar que los párrafos usen el gris oscuro para mejor lectura */
p, li {
    color: var(--texto-gris);
}

/* =========================================
   IMÁGENES (PORTADA Y SERVICIOS)
   ========================================= */
.img-portada { 
    width: 100%;
    height: auto; 
    max-height: none; 
    object-fit: contain; 
    border-radius: 20px; /* Bordes un poco más redondeados para suavidad */
    margin-bottom: 3rem;
    box-shadow: var(--sombra-suave);
    transition: transform 0.4s ease;
}

.img-servicio { 
    width: 100%;
    height: 350px; 
    object-fit: cover;
    border-radius: 20px; 
    box-shadow: var(--sombra-suave);
    transition: transform 0.4s ease;
}

.img-servicio:hover {
    transform: translateY(-5px);
}

.img-perfil-grid {
    width: 220px; 
    height: 220px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: block;
    border: 5px solid var(--beige-claro);
    box-shadow: var(--sombra-suave);
}

.img-perfil-individual {
    height: auto !important;
    object-fit: contain !important;
    border-color: var(--beige-claro) !important;
}

/* =========================================
   TARJETAS Y SECCIONES
   ========================================= */
.perfil-individual {
    background: var(--blanco) !important;
    border: 1px solid var(--beige-claro);
}

.grid-precios {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    max-width: 1050px;
    margin: 0 auto;
}

.tarjeta-precio {
    background-color: var(--blanco);
    border-radius: 20px;
    padding: 3.5rem 2rem 2.5rem;
    text-align: center;
    box-shadow: var(--sombra-suave);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    border: 1px solid var(--beige-claro);
}

.tarjeta-precio:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

.tarjeta-precio h3 {
    font-size: 1.6rem;
    color: var(--verde-oliva);
    margin-bottom: 0.5rem;
}

.tarjeta-precio .precio {
    font-size: 3.5rem;
    font-weight: 600;
    color: var(--verde-oliva);
    margin-bottom: 1rem;
    line-height: 1;
}

.tarjeta-precio p {
    color: var(--texto-gris);
    font-size: 1rem;
    min-height: 60px;
}

/* Tarjeta destacada con estilo Premium */
.tarjeta-precio.destacada {
    background-color: var(--beige-claro);
    border: 2px solid var(--verde-oliva);
    transform: scale(1.03);
}

.tarjeta-precio.destacada:hover {
    transform: scale(1.03) translateY(-8px);
}

/* Forzamos los colores de la etiqueta por si el HTML los reescribe */
.etiqueta {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--verde-oliva) !important;
    color: var(--blanco-calido) !important;
    padding: 8px 22px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Manrope', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(85, 107, 47, 0.2);
}

/* =========================================
   FOOTER Y FIRMA
   ========================================= */
footer {
    flex-shrink: 0; 
    background-color: var(--verde-oliva);
    padding: 3.5rem 5% 2rem; 
    text-align: center;
    color: var(--blanco-calido);
    width: 100%;
}

.footer-info p {
    color: rgba(250, 248, 244, 0.85);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.footer-info a {
    color: var(--verde-lima);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-info a:hover {
    color: var(--blanco-calido);
}

.contenedor-firma {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.firma-jinjo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--verde-lima);
    font-weight: 600;
    transition: color 0.3s ease;
}

.firma-jinjo:hover {
    color: var(--blanco-calido);
}

/* Ocultar elementos de plantillas genéricas */
.site-header, .page-header, .entry-title {
    display: none !important;
}

/* =========================================
   DISEÑO RESPONSIVE GENERAL (MÓVILES Y TABLETS)
   ========================================= */
@media (max-width: 768px) {
    /* CORRECCIÓN CABECERA Y REDES (Evita salto de línea en Instagram) */
    .top-bar {
        flex-wrap: nowrap !important; 
        justify-content: space-between !important;
        padding: 0.6rem 15px !important;
        gap: 10px !important;
    }

    .top-bar > div:first-child {
        gap: 10px !important;
    }
    
    .top-bar a {
        font-size: 0.75rem !important; 
    }

    header {
        flex-direction: column;
        padding: 1.5rem 5%;
        gap: 1.5rem;
    }

    .logo-container img {
        height: 65px;
    }

    nav ul {
        justify-content: center;
        gap: 1.2rem;
    }

    nav a {
        font-size: 0.95rem;
    }

    .contenedor {
        padding: 3rem 20px;
    }

    /* CORRECCIÓN TEXTOS PEGADOS A LA DERECHA (Tratamientos) */
    .contenedor > div[style*="padding: 3rem"] {
        padding: 1.5rem !important;
        gap: 2rem !important;
    }
    
    .contenedor > div > div[style*="min-width: 300px"] {
        min-width: 100% !important;
    }

    .tarjeta-precio.destacada {
        transform: scale(1); 
    }
    
    .tarjeta-precio.destacada:hover {
        transform: translateY(-5px);
    }
    
    .perfil-individual {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .perfil-sidebar {
        margin-bottom: 2rem;
        max-width: 100% !important; 
    }
}

/* =========================================
   BOTÓN FLOTANTE "VOLVER ARRIBA" (SOLO MÓVILES)
   ========================================= */
.btn-volver-arriba {
    display: none; /* Oculto por defecto en ordenadores */
}

@media (max-width: 768px) {
    .btn-volver-arriba {
        position: fixed;
        bottom: 100px; /* Separado del botón de IA para que no se pisen */
        right: 25px;
        background-color: var(--verde-oliva);
        color: var(--blanco-calido);
        width: 45px;
        height: 45px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        font-size: 1.2rem;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
        z-index: 999;
    }
}

/* =========================================
   ESTILOS DEL CHAT IA
   ========================================= */

#chat-widget-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
    font-family: inherit;
}

/* Botón flotante IA */
#chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--verde-oscuro);
    color: var(--blanco);
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease, background-color 0.3s;
}

#chat-toggle-btn:hover {
    transform: scale(1.05);
    background-color: var(--verde-corporativo);
}

/* Ventana del chat IA (Ordenador) */
#chat-window {
    display: none; /* Oculto por defecto */
    width: 350px;
    height: 500px;
    max-height: 80vh;
    background-color: var(--blanco);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    overflow: hidden;
    flex-direction: column;
    position: absolute;
    bottom: 80px;
    right: 0;
    border: 1px solid var(--beige-claro);
}

/* Cabecera del chat IA */
#chat-header {
    background-color: var(--verde-oscuro);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chat-close-btn {
    background: none;
    border: none;
    color: var(--blanco);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.8;
}

#chat-close-btn:hover {
    opacity: 1;
}

/* Área de mensajes IA */
#chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: var(--gris-fondo);
}

.mensaje {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
}

.mensaje.bot {
    background-color: var(--blanco);
    color: var(--texto-oscuro);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.mensaje.usuario {
    background-color: var(--verde-claro);
    color: var(--verde-oscuro);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Área de input IA */
#chat-input-area {
    padding: 15px;
    background-color: var(--blanco);
    border-top: 1px solid var(--beige-claro);
    display: flex;
    gap: 10px;
}

#chat-input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid var(--beige-claro);
    border-radius: 20px;
    outline: none;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

#chat-input:focus {
    border-color: var(--verde-corporativo);
}

#chat-send-btn {
    background-color: var(--verde-oscuro);
    color: var(--blanco);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

#chat-send-btn:hover {
    background-color: var(--verde-corporativo);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   CORRECCIÓN DEL CHAT IA EN MÓVILES
   ========================================= */
@media (max-width: 480px) {
    #chat-window {
        position: fixed; /* Desvincula la ventana del botón para ajustarse a la pantalla */
        width: calc(100vw - 30px);
        right: 15px;
        bottom: 95px; /* Sube la ventana para que se vea perfecta encima del botón */
        height: 450px;
        max-height: calc(100vh - 120px); /* Fallback para móviles antiguos */
        max-height: calc(100dvh - 120px); /* Adaptación dinámica a pantallas modernas sin cortarse */
    }
}