/* ==========================================================================
   ESTILOS MAESTROS - DENTAL
   Archivo: /userfiles/public/css/estilos-dental.css
   ========================================================================== */

/* ==========================================================================
   0. COMPORTAMIENTO GLOBAL (Scroll Suave)
   ========================================================================== */

html {
    /* Esto activa el deslizamiento suave en toda la página */
    scroll-behavior: smooth;
}

/* Añade un "cojín" invisible de 120px (o lo que mida tu cabecera) */
:target {
    scroll-margin-top: 120px; 
}

/* 1. CONTENEDOR PRINCIPAL
   -------------------------------------------------------------------------- */
.dental-content {
    width: 100%;
    max-width: 1440px; 
    margin: 0 auto;    
    color: #333333;
    font-family: inherit; 
}

/* 2. TIPOGRAFÍA
   -------------------------------------------------------------------------- */

/* Títulos H1 */
.dental-content h1 {
    font-size: 2.5rem;    
    line-height: 1.2;
    font-weight: 800;     
    color: #6A1762;
    margin-top: 0;
    margin-bottom: 2rem;
}

/* Títulos H2 */
.dental-content h2 {
    font-size: 2rem;
    line-height: 1.2;
    font-weight: 700;
    color: #6A1762;
    margin-top: 3rem;     
    margin-bottom: 1.5rem;
}

/* Subtítulo dentro de un H2 */
.dental-content .h2-subtitle {
    display: block;         /* Fuerza salto de línea */
    font-size: 1.5rem;      /* ~24px */
    line-height: 1.3;
    margin-top: 0.5rem;
    font-weight: 400;       /* Un poco más fino que el título principal */
    /* Hereda el color morado del H2, o puedes forzar otro aquí */
}

/* Excepción H2 */
.dental-content h2:first-child {
    margin-top: 0;
}

/* Títulos H3 */
.dental-content h3 {
    font-size: 1.5rem;    
    line-height: 1.3;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #6A1762;
}

/* Párrafos */
.dental-content p {
    font-size: 18px;      
    line-height: 29px;    
    margin-bottom: 1rem;
}

/* Listas */
.dental-content ul, 
.dental-content ol {
    font-size: 18px;
    line-height: 29px;
    margin-bottom: 1rem;
    padding-left: 25px;
    padding-right: 25px;
}

.dental-content ul { list-style-type: disc; }
.dental-content ol { list-style-type: decimal; }

.dental-content li {
    margin-bottom: 15px;
}

.dental-content li:last-child {
    margin-bottom: 0;
}

/* Negritas */
.dental-content strong,
.dental-content b {
    font-weight: 700 !important;
    color: inherit; 
}

/* 3. UTILIDADES DE DISEÑO
   -------------------------------------------------------------------------- */
.bg-light { background-color: #F8F8F8; }
.spacer-top { margin-top: 5%; }
.bg-white { background-color: #ffffff !important; }

/* --- UTILIDAD: Marco gris para imágenes transparentes --- */
.dental-content .img-bg-gray {
    background-color: #F8F8F8 !important;
    border-radius: 25px !important;
    
    /* Para que la imagen no toque los bordes del gris, 
       descomentar la siguiente línea: */
    /* padding: 2rem !important; */
}

/* 4. LAYOUT FLEXBOX
   -------------------------------------------------------------------------- */
.fx-row {
    display: flex;
    flex-wrap: wrap;
}

.fx-middle {
    align-items: center;
}

.c-box_model__container {
    flex: 1;
    margin: auto;
    padding: 3rem; 
    box-sizing: border-box;
}

/* 5. IMÁGENES
   -------------------------------------------------------------------------- */
.dental-content .c-box_model__img {
    flex: 1;
    padding: 0 !important; 
    margin: 0 !important;
}

.dental-content .c-box_model__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 6. RESPONSIVE Y ADAPTACIÓN
   -------------------------------------------------------------------------- */

/* === BLOQUE 1: iPad Pro, Tablets y Móviles (Estructura Base) === */
/* Define el comportamiento de columna única y anchos máximos */
@media (max-width: 979px), 
       (max-width: 1400px) and (pointer: coarse) {

    /* --- LAYOUT GENERAL (Una sola columna) --- */
    .fx-row {
        flex-direction: column;
    }

    .reverse-mobile {
        flex-direction: column-reverse;
    }

    /* --- RESETEO DE BLOQUES ROUNDED-XL --- */
    .dental-content .rounded-xl {
        flex-direction: column !important;
        align-items: center !important;
        gap: 2rem !important;
        height: auto !important;
    }
    
    .dental-content .rounded-xl.reverse-mobile {
        flex-direction: column-reverse !important;
    }

    /* --- ANCHURA Y ESPACIADO (Lectura cómoda) --- */
    .c-box_model__container, 
    .dental-content .c-box_model__img,
    .dental-content .rounded-xl .c-box_model__container,
    .dental-content .rounded-xl .c-box_model__img {
        width: 100% !important;
        max-width: 750px !important;  
        margin: 0 auto !important;    
        flex: none !important;
        display: block !important;
        padding: 3rem 1.5rem !important; 
    }

    /* Imágenes */
    .dental-content .c-box_model__img > div,
    .dental-content .rounded-xl img {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        object-fit: contain !important; 
    }
    
    .spacer-top { margin-top: 2rem; }

    /* Excepciones específicas */
    .dental-content .c-box_model__img.img-lower img {
        width: auto !important;       
        max-width: 280px !important;  
        margin: 0 auto !important;    
    }
    
    .dental-content .rounded-xl.kexim-hero .c-box_model__img {
        display: none !important;
    }
    
    .dental-content .rounded-xl.kexim-hero .c-box_model__container {
        max-width: 100% !important; 
        padding: 3rem 2rem !important;
    }
    
    /* --- TIPOGRAFÍA BASE (Para iPad Pro y Tablets) --- */
    /* Aquí mantenemos tamaños GRANDES para que se vean bien en 1366px */
    .section-header-blue h2 {
        font-size: 2.2rem !important; 
    }
    
    .dental-content .h3-featured {
        font-size: 2rem !important; 
    }

    .mobile-none {
        display: none !important;
    }
}

/* === BLOQUE 2: SOLO MÓVILES (< 768px) === */
/* Estos estilos SOBRESCRIBEN a los de arriba solo en teléfonos */
@media (max-width: 767px) {
    
    /* 1. Título Azul (El Padre) -> 1.8rem */
    .section-header-blue h2 {
        font-size: 1.8rem !important; /* ~29px */
        line-height: 1.2;
    }

    /* 2. H3 Featured (El Hijo) -> 1.5rem */
    /* Usamos .dental-content para ganar especificidad y asegurar que se reduce */
    .dental-content .h3-featured {
        font-size: 1.5rem !important; /* ~24px */
        line-height: 1.3;
    }
    
    /* Títulos normales */
    .dental-content h1 { font-size: 1.8rem; }
    .dental-content h2 { font-size: 1.6rem; }

    /* --- UTILIDAD PARA REDUCIR HUECOS EN MÓVIL (Versión Ajustada) --- */
    
    /* 1. Al contenedor padre le quitamos el gap de 2rem */
    .dental-content .rounded-xl.mobile-gap-fix {
        gap: 0 !important; /* Adiós al hueco entre bloques flex */
    }

    /* 2. Ajuste fino del TEXTO */
    .dental-content .rounded-xl.mobile-gap-fix .c-box_model__container {
        padding-bottom: 0.5rem !important; /* Dejamos un mínimo aire abajo */
    }

    /* 3. Ajuste fino de la IMAGEN */
    .dental-content .rounded-xl.mobile-gap-fix .c-box_model__img {
        padding-top: 0 !important;       /* Pegado al texto de arriba */
        padding-bottom: 1rem !important; /* Un poco de aire antes del botón */
        margin-top: 0 !important;
    }

    /* 4. Ajuste del BOTÓN */
    .dental-content .rounded-xl.mobile-gap-fix .show-mobile-btn {
        margin-top: 0 !important;
        padding-bottom: 2rem !important; /* Aire final del bloque */
    }

} /* Fin del media query */


/* ==========================================================================
   7. BANNERS Y LLAMADAS A LA ACCIÓN (Corregido Mobile)
   ========================================================================== */
.c-banner {
    position: relative;
    width: 100%;
    min-height: 600px; 
    display: flex;
    align-items: center; 
    padding: 2rem 4rem;  
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 4px;
    margin-top: 3rem;
    color: #333;
    box-sizing: border-box;
}

.c-banner__content {
    width: 100%;        
    max-width: 600px;   
    background-color: rgba(255, 255, 255, 0.9);
    padding: 3rem;      
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
    
    /* En escritorio alineado a la izquierda por defecto */
    display: flex;
    flex-direction: column;
    align-items: flex-start; 
    text-align: left;
}

.c-banner__label {
    font-size: 14px;
    font-weight: 700;
    color: #ed70ab;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: block;
}

/* --- BOTÓN MEJORADO (Evita desbordes) --- */
.btn-primary {
    display: inline-flex;       
    align-items: center;        
    justify-content: center;    
    background-color: #009fe3; 
    color: #fff !important;
    padding: 12px 25px;         
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    margin-top: 1rem;
    line-height: 1.2;             
    transition: background 0.3s;
    
    /* SEGURIDAD RESPONSIVE: */
    max-width: 100%;       /* Nunca más ancho que la pantalla */
    white-space: normal;   /* Permite saltos de línea si el texto es largo */
    text-align: center;    /* Centra el texto si hay dos líneas */
    height: auto;          /* Permite crecer en altura */
    box-sizing: border-box;
}

.btn-primary:hover {
    background-color: #007bb0;
}

/* --- AJUSTES MÓVIL (Centrado) --- */
@media (max-width: 768px) {
    .c-banner {
        padding: 2rem 1rem;
        background-position: 60% center; 
        min-height: 400px; /* Permitimos banners más cortos en móvil */
    }
    
    .c-banner__content {
        max-width: 100%;
        background-color: rgba(255, 255, 255, 0.95);
        
        /* FORZAMOS CENTRADO EN MÓVIL */
        text-align: center !important;
        align-items: center !important; 
    }
    
    /* Centramos también la etiqueta EBOOK */
    .c-banner__label {
        width: 100%;
        text-align: center;
    }
}

/* --- ESTILOS DECORATIVOS --- */

.page-title {
    text-align: center;
    margin-bottom: 3rem; 
}

.page-title::after {
    content: '';
    display: block;
    width: 60px;         
    height: 4px;         
    background-color: #ED70AB; 
    margin: 1rem auto 0; 
    border-radius: 2px;
}

.rounded-img img, 
.rounded-img iframe {
    border-radius: 8px;  
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); 
}

.c-box_model.bg-light {
    border-radius: 8px; 
}

/* --- ESTILOS ESPECÍFICOS: PÁGINA CORE --- */

.section-header-blue {
    background-color: #37465A; 
    color: #FFFFFF;
    text-align: center;
    padding: 1.5rem 1rem;
    margin: 2rem 0; 
    border-radius: 4px;
}

.section-header-blue h2 {
    color: #FFFFFF !important; 
    margin: 0 !important;      
    font-size: 2.4rem;         
}

.separator-arrow {
    text-align: center;
    margin: 2.5rem 0;          
    width: 100%;
}

.separator-arrow img {
    max-width: 35px;           
    margin: 0 auto;
    display: inline-block;
}

/* Imágenes Y VÍDEOS muy redondeados */
.rounded-xl img,
.rounded-xl iframe {  /* <-- HE AÑADIDO IFRAME AQUÍ */
    border-radius: 25px;       
}

.dental-content .h3-featured {
    font-size: 2.1rem !important;  
    font-weight: 700 !important;
    margin-bottom: 1rem;
    color: #6A1762;
    line-height: 1.4;
}

/* Estilos para Referencias Bibliográficas (Citas) */
.dental-content .citation {
    font-size: 15px;
    font-style: italic;
    color: #666;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

/* Estilo para superíndices (® ™) */
.dental-content .sup-tm {
    font-size: 0.6em;       
    vertical-align: top;    
    color: #4A4A4A;         
    font-weight: 400;       
    position: relative;
    top: -0.2em;            
}

/* ==========================================================================
   8. COMPONENTE ACORDEÓN (Versión Final: Icono siempre Rosa)
   ========================================================================== */

.dental-content .c-accordion__items {
    list-style: none !important;
    padding: 0 !important;
    margin: 2rem 0 0 0 !important;
    border-top: 1px solid #ddd;
}

/* TÍTULO */
.dental-content .c-accordion__title {
    cursor: pointer;
    display: flex;
    align-items: center; 
    justify-content: space-between;
    padding: 18px 0; 
    border-bottom: 1px solid #ddd;
    font-weight: 700;
    font-size: 18px;
    color: #37465A; /* Texto Gris Oscuro por defecto */
    transition: color 0.3s ease;
    margin: 0 !important;
    position: relative;
}

/* El TEXTO cambia a rosa al interactuar */
.dental-content .c-accordion__title:hover,
.dental-content .c-accordion__title.open {
    color: #ed70ab; 
}

/* CONTENIDO */
.dental-content .c-accordion__content {
    padding: 20px 0;
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    border-bottom: 1px solid #ddd;
}

/* --- EL ICONO (Siempre Rosa) --- */
.dental-content .expand-bar {
    position: relative;
    width: 32px; 
    height: 32px;
    
    box-sizing: border-box; 
    
    /* CAMBIO: Color base ROSA (#ed70ab) desde el principio */
    border: 2px solid #ed70ab; 
    border-radius: 50%;
    
    background: transparent;
    box-shadow: none; 
    outline: none;
    
    flex-shrink: 0; 
    margin-left: 15px;
    transition: transform 0.4s ease;
}

/* --- LAS LÍNEAS INTERIORES --- */
.dental-content .expand-bar::before,
.dental-content .expand-bar::after {
    content: '';
    position: absolute;
    
    /* CAMBIO: Color base ROSA (#ed70ab) */
    background-color: #ed70ab; 
    
    width: 14px; 
    height: 2px;
    
    top: 50%;
    left: 50%;
    margin-left: -7px; 
    margin-top: -1px;
    
    transition: transform 0.3s ease;
}

/* LÍNEA 1 */
.dental-content .expand-bar::before {
    transform: rotate(0deg);
}

/* LÍNEA 2 */
.dental-content .expand-bar::after {
    transform: rotate(90deg);
}

/* --- ESTADO ABIERTO (Solo animación, el color ya es rosa) --- */

/* 1. Rotamos el círculo */
.dental-content .c-accordion__title.open .expand-bar {
    transform: rotate(180deg);
}

/* 2. Tumbamos la línea vertical para hacer el MENOS */
.dental-content .c-accordion__title.open .expand-bar::after {
    transform: rotate(0deg); 
}

/* ==========================================================================
   9. BOTONES DE ÁREAS (Nuevo)
   ========================================================================== */

.area-buttons-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px; /* Espacio entre botones */
    
    /* LIMITAR ANCHO Y CENTRAR (Tu petición) */
    max-width: 800px;    /* Fuerza a que caigan de 3 en 3 */
    margin: 2rem auto;   /* 2rem arriba/abajo, AUTO a los lados para centrar el bloque */
    width: 100%;         /* Para que ocupe lo que pueda en móviles */
}

.area-buttons-grid a {
    display: inline-block;
    padding: 12px 25px;
    background-color: #fff;
    color: #6a1762; 
    border: 2px solid #6a1762;
    border-radius: 30px; 
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    
    /* Ajuste de ancho de botón */
    min-width: 180px; 
    flex: 1 1 30%; /* Intenta ocupar un tercio del espacio disponible */
    max-width: 250px; /* Evita que se estiren demasiado si hay pocos */
    
    text-align: center;
}

.area-buttons-grid a:hover {
    background-color: #6a1762;
    color: #fff;
    transform: translateY(-2px); 
}

/* ==========================================================================
   10. LISTA NUMERADA GRÁFICA (Para sustituir imágenes de números)
   ========================================================================== */

.dental-content .numbered-list {
    max-width: 900px;   /* Ancho de lectura cómodo */
    margin: 3rem auto;  /* Centrado en la página */
    display: flex;
    flex-direction: column;
    gap: 2.5rem;        /* Separación entre puntos */
}

.dental-content .numbered-item {
    display: flex;
    align-items: flex-start; /* Alineado arriba */
    gap: 1.5rem;             /* Espacio entre bola y texto */
}

/* LA BOLA DEL NÚMERO */
.dental-content .num-icon {
    flex-shrink: 0;          /* Evita que se aplaste */
    width: 60px;
    height: 60px;
    background-color: #ed70ab; /* Rosa Corporativo */
    color: #fff;
    border-radius: 50%;      /* Círculo perfecto */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(237, 112, 171, 0.4); /* Sombra rosa para dar "fuerza" */
}

/* EL TEXTO AL LADO */
.dental-content .num-text {
    padding-top: 0.5rem; /* Ajuste fino para alinear con el número visualmente */
    font-size: 18px;
    line-height: 1.6;
}

.dental-content .num-text p {
    margin-bottom: 0.5rem;
}

/* En móvil, reducimos un poco la bola */
@media (max-width: 767px) {
    .dental-content .num-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}

/* ==========================================================================
   11. UTILIDADES DE VISIBILIDAD (Para cambios de orden en móvil)
   ========================================================================== */

/* Por defecto (Escritorio): El botón móvil está oculto */
.show-mobile-btn {
    display: none !important;
}

/* En Móvil / iPad Pro */
@media (max-width: 979px), 
       (max-width: 1400px) and (pointer: coarse) {
           
    /* Ocultamos el botón de escritorio */
    .show-desktop-btn {
        display: none !important;
    }

    /* Mostramos el botón móvil */
    .show-mobile-btn {
        display: block !important;
        width: 100%;
        text-align: center; 
        margin-top: 1.5rem; 
    }
}

/* ==========================================================================
   AJUSTE DE TAMAÑO DE IMÁGENES (Página CORE, ATROFIAS, REGENERACIÓN)
   ========================================================================== */

/* Solo aplicamos esto en pantallas grandes (Escritorio/Tablet horizontal) */
@media (min-width: 980px) {

    /* --- 1. CONFIGURACIÓN ESTÁNDAR (Para todos los bloques) --- */
    .dental-content .rounded-xl {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        gap: 40px; 
        /* Eliminamos align-items forzoso. Dejamos que 'fx-middle' del HTML centre verticalmente */
    }

    /* Texto */
    .dental-content .rounded-xl .c-box_model__container {
        flex: 0 1 50%;   
        max-width: 50%;  
        margin: 0 !important; 
        padding: 0 !important; 
        padding-right: 1rem !important;
    }

    /* Imagen */
    .dental-content .rounded-xl .c-box_model__img {
        flex: 0 1 42%;   
        max-width: 42%;  
        margin: 0 !important; /* Margen 0 por defecto */
    }

    /* Imagen Real */
    .dental-content .rounded-xl img {
        width: 100% !important;
        height: auto !important;
        max-width: 500px;
        margin: 0 auto;
        display: block;
    }
    
    /* Ajuste para reverse-mobile */
    .dental-content .rounded-xl.reverse-mobile .c-box_model__container {
        padding-right: 0 !important;
        padding-left: 1rem !important;
    }

    /* --- 2. CLASE ESPECIAL: BLOQUES CON ACORDEÓN --- */
    /* Estas reglas SOLO se aplican si añades la clase 'accordion-layout' al HTML */
    
    .dental-content .rounded-xl.accordion-layout {
        align-items: flex-start !important; /* Alineación arriba */
    }

    .dental-content .rounded-xl.accordion-layout .c-box_model__img {
        margin-top: 8% !important; /* Margen para centrar visualmente */
    }

    .dental-content .rounded-xl.accordion-layout .c-box_model__img.img-lower {
        margin-top: 18% !important; /* Bajamos más (ajusta este % a tu gusto) */
    }
}

/* ==========================================================================
   CORRECCIÓN FINAL: Márgenes laterales para caja gris en móvil
   ========================================================================== */

@media (max-width: 979px), 
       (max-width: 1400px) and (pointer: coarse) {
           
    /* Usamos este selector largo para ganar a la regla global */
    .dental-content .rounded-xl .c-box_model__img.img-bg-gray {
        
        /* 1. Anulamos el width: 100% global */
        width: auto !important; 
        
        /* 2. Forzamos márgenes laterales blancos (fuera de la caja gris) */
        margin-left: 1.5rem !important;
        margin-right: 1.5rem !important;
        margin-bottom: 2rem !important; 
        
        /* 3. PADDING INTERNO AJUSTADO */
        /* 0 arriba/abajo (para que toque bordes) | 2rem lados */
        padding: 0 2rem !important; 
        
        border-radius: 25px !important;
        background-color: #F8F8F8 !important;
        
        display: block !important;
        flex: none !important;
    }
    
    /* Ajuste adicional para asegurar que la imagen se centre verticalmente si sobra sitio */
    .dental-content .rounded-xl .c-box_model__img.img-bg-gray img {
        display: block;
        margin: 0 auto;
    }
}