/*
 Theme Name:   Grafcan Child Theme v03
 Theme URI:    https://grafcan.es
 Description:  Child theme de Twenty Twenty-Five para Grafcan - Versión optimizada y completa
 Author:       Grafcan
 Author URI:   https://grafcan.es
 Template:     twentytwentyfive
 Version:      2.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Tags:         grafcan, government, custom-post-types
 Text Domain:  grafcan-child-theme-v03
*/


/* ========================================
   BASE STYLES
   ======================================== */

body {
    margin: 0;
    padding: 0;
}

html,
body {
    overflow-x: hidden;
    width: 100%;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   HEADER (CORREGIDO PARA TEMAS DE BLOQUE)
   ======================================== */

/* INICIO DEL BLOQUE ORIGINAL Y SU CORRECCIÓN */
/* **IMPORTANTE: Las siguientes líneas originales han sido eliminadas por conflicto (width: 100% !important;) **
header,
.site-header,
.main-header {
    width: 100% !important; 
    max-width: 100% !important;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
*/

/* Esta regla CSS original (con selectores incorrectos) ha sido reemplazada por la siguiente: */
/* .header-content,
.header-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
} */

/* REGLA CORREGIDA: Aplica centrado y ancho máximo al contenedor de contenido real del header */
.site-header-main-container {
    max-width: 1400px;
    margin-left: auto; /* Centrado Horizontal */
    margin-right: auto; /* Centrado Horizontal */
    padding: 0 20px;
    /* Las propiedades de flexbox se controlan ahora en header.html */
}

.site-branding {
    margin-left: 0;
}

/* ========================================
   MENÚ PRINCIPAL
   ======================================== */

.main-navigation,
.primary-menu {
    width: 100% !important;
    max-width: 100% !important;
    background-color: #2c3e6f;
    margin: 0 !important;
    padding: 0 !important;
}

.main-navigation ul,
.primary-menu ul {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    list-style: none;
}

.main-navigation a,
.sub-menu a {
    color: #ffffff;
    text-decoration: none;
    padding: 10px 15px;
    display: block;
    transition: background-color 0.3s ease;
}

.main-navigation a:hover,
.sub-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ========================================
   SUBMENÚ
   ======================================== */

.sub-menu,
.secondary-navigation,
.submenu-bar {
    width: 100% !important;
    max-width: 100% !important;
    background-color: #7fc5d4 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.sub-menu ul,
.secondary-navigation ul {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    list-style: none;
}

.main-navigation ul,
.sub-menu ul,
.secondary-navigation ul {
    padding-left: 20px;
    align-items: center;
}

/* ========================================
   CONTENEDOR PRINCIPAL
   ======================================== */

.container,
.site-content,
.main-content {
    /* Las siguientes 3 líneas originales DEBEN eliminarse o deshabilitarse para permitir que theme.json controle el ancho */
    /* width: 100% !important; */
    /* max-width: 100% !important; */
    /* padding: 0 !important; */
    padding: 0 !important; /* Mantenemos el padding si está a 0 */
}

.content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* CRÍTICO: Eliminar márgenes del entry-content para el slider */
.entry-content {
    margin: 0 !important;
    padding: 0 !important;
}

main,
.wp-site-blocks {
    margin: 0 !important;
    padding: 0 !important;
}

/* ========================================
   HERO SLIDER
   ======================================== */

/* Eliminar márgenes de bloques HTML */
.wp-block-html {
    margin: 0 !important;
    padding: 0 !important;
}

/* Contenedor del slider - Ancho completo */
.hero-slider-section {
    width: 100vw !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
    overflow: hidden !important;
    height: 600px !important;
}

/* Slides individuales */
.hero-slide {
    width: 100vw !important;
    height: 600px !important;
    background-size: cover !important;
    background-position: center !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    opacity: 0 !important;
    transition: opacity 1s ease-in-out !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

.hero-slide.active {
    opacity: 1 !important;
    z-index: 1 !important;
}

/* Contenido dentro del slide */
.hero-slide-content {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
    z-index: 2;
}

.hero-slide-text {
    max-width: 600px;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-slide-text h2 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 20px;
    color: #ffffff;
}

.hero-slide-text p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.6;
}

/* Indicadores del slider (dots) */
.hero-slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

.hero-slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-slider-dot.active {
    background-color: #ffffff;
    width: 40px;
    border-radius: 6px;
}

.hero-slider-dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

/* ========================================
   BÚSQUEDA
   ======================================== */

.wp-block-search__inside-wrapper {
    margin-top: 20px;
}

.search-form,
.search-box,
input[type="search"],
.search-field {
    height: 35px !important;
    max-height: 35px !important;
    padding: 5px 15px !important;
    font-size: 14px !important;
    line-height: normal !important;
    margin-top: 10px;
}

.search-submit,
.search-button {
    height: 35px !important;
    padding: 5px 15px !important;
}

.wp-block-search .wp-block-search__input {
    border-radius: 0.65rem !important;
}

/* ========================================
   FOOTER
   ======================================== */

footer,
.site-footer,
.main-footer {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 10px 0 !important;
    background-color: #1f3864;
}

.footer-content,
.footer-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-certifications,
.footer-logos,
.aenor-logos {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.footer-certifications img,
.footer-logos img {
    margin: 0 5px;
}

#footer-web-grafcan a {
    color: #8dc8e0 !important;
}

#footer-web-grafcan a,
#footer-web-grafcan a:hover {
    text-decoration: none;
}

/* ========================================
   ELEMENTOS ESPECÍFICOS
   ======================================== */

/* Sellos de calidad */
.wp-container-core-group-is-layout-c7f2ec44 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.wp-container-core-group-is-layout-c7f2ec44 .wp-block-image img {
    box-sizing: border-box;
    width: auto;
    vertical-align: bottom;
    height: 100px !important;
}

/* ========================================
   HEADER MOBILE
   ======================================== */

@media screen and (max-width: 768px) {
    /* Ocultar menú principal de navegación en header */
    .site-header .main-navigation,
    .site-header .wp-block-navigation {
        display: none !important;
    }
    
    /* Ocultar todos los submenús en móvil */
    .secondary-navigation-container {
        display: none !important;
    }
    
    /* Mostrar solo botón hamburguesa */
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    .site-header.header-with-watermark {
        padding: 15px 0;
    }
    
    .header-content {
        flex-direction: column;
        align-items: stretch;
        padding: 0 15px;
    }
    
    .grafcan-logo {
        width: 100%;
        text-align: center;
        margin-bottom: 15px;
    }
    
    .grafcan-logo .wp-block-site-logo {
        display: inline-block;
    }
    
    .grafcan-logo img {
        max-width: 200px;
        height: auto;
    }
    
    .header-search-compact {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .header-search-compact .wp-block-search__input {
        width: 100%;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
        background: #2c3e6f;
        border: none;
        cursor: pointer;
        padding: 15px;
        color: white;
        width: 100%;
        text-align: center;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        margin-top: 10px;
    }
    
    .hamburger-line {
        display: block;
        width: 30px;
        height: 3px;
        background-color: #ffffff;
        transition: all 0.3s ease;
    }
    
    .menu-text {
        font-size: 14px;
        font-weight: 500;
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }
    
    .main-navigation {
        display: none;
        width: 100%;
    }
    
    .main-navigation.mobile-menu-open {
        display: block;
    }
    
    .main-navigation ul {
        flex-direction: column;
        padding: 0;
        background: #2c3e6f;
    }
    
    .main-navigation li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .main-navigation a {
        padding: 15px 20px;
        display: block;
        color: white;
        text-decoration: none;
    }
}

/* ========================================
   SUBMENÚ MOBILE
   ======================================== */

@media screen and (max-width: 768px) {
    .secondary-navigation-container {
        padding: 15px !important;
    }
    
    .secondary-navigation ul {
        flex-direction: column;
        gap: 10px;
    }
    
    .secondary-navigation li {
        width: 100%;
    }
    
    .secondary-navigation a {
        display: block;
        padding: 12px 15px;
        background: rgba(255,255,255,0.1);
        border-radius: 4px;
    }
}

/* ========================================
   FOOTER MOBILE
   ======================================== */

@media screen and (max-width: 768px) {
    #footer-web-grafcan {
        padding: 30px 20px !important;
    }
    
    .wp-block-columns.alignwide {
        flex-direction: column;
        gap: 30px !important;
    }
    
    .wp-block-column {
        flex-basis: 100% !important;
    }
    
    .certificados-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
    }
    
    .certificados-grid img {
        width: 100%;
        max-width: 120px;
        height: auto;
    }
    
    .footer-social-links {
        justify-content: center;
        margin-top: 20px;
    }
    
    .wp-block-group.alignwide {
        flex-direction: column;
        text-align: center;
        gap: 20px !important;
    }
}

/* ========================================
   CONTENIDO GENERAL MOBILE
   ======================================== */

@media screen and (max-width: 768px) {
    .wp-block-group.alignfull,
    .wp-block-group.alignwide {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .content-wrapper {
        padding: 0 15px;
    }
    
    /* Hero Slider Mobile */
    .hero-slider-section,
    .hero-slide {
        height: 300px !important;
    }
    
    .hero-slide-content {
        padding: 0 20px;
    }
    
    .hero-slide-text h2 {
        font-size: 1.8rem;
    }
    
    .hero-slide-text p {
        font-size: 1rem;
    }
    
    .hero-slider-dots {
        bottom: 15px;
    }
    
    .hero-slider-dot {
        width: 8px;
        height: 8px;
    }
    
    .hero-slider-dot.active {
        width: 25px;
    }
}

/* ========================================
   TABLETS (769px - 1024px)
   ======================================== */

@media screen and (min-width: 769px) and (max-width: 1024px) {
    .header-content,
    .footer-content,
    .content-wrapper {
        padding: 0 20px;
    }
    
    .certificados-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .hero-slider-section,
    .hero-slide {
        height: 450px !important;
    }
}

/* ========================================
   RESPONSIVE DESIGN GENERAL
   ======================================== */

/* Tablets (1024px y menos) */
@media screen and (max-width: 1024px) {
    .header-content,
    .footer-content,
    .content-wrapper,
    .main-navigation ul,
    .sub-menu ul {
        max-width: 100%;
        padding: 0 15px;
    }

    .main-navigation ul,
    .sub-menu ul {
        flex-wrap: wrap;
    }
}

/* Móviles grandes (768px y menos) */
@media screen and (max-width: 768px) {
    /* Menú */
    .main-navigation ul,
    .sub-menu ul {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-navigation li,
    .sub-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
    }

    .footer-certifications {
        justify-content: center;
        margin-top: 20px;
    }

    /* Búsqueda */
    .search-form,
    .search-box {
        width: 100%;
        max-width: 100%;
    }

    /* Hero Slider */
    .hero-slider-section,
    .hero-slide {
        height: 400px !important;
    }

    .hero-slide-content {
        padding: 0 20px;
    }

    .hero-slide-text {
        max-width: 100%;
    }

    .hero-slider-dots {
        bottom: 20px;
    }
}

/* Móviles pequeños (480px y menos) */
@media screen and (max-width: 480px) {
    .header-content,
    .footer-content,
    .content-wrapper {
        padding: 0 10px;
    }

    .site-branding img {
        max-width: 150px;
        height: auto;
    }

    .footer-certifications {
        flex-direction: column;
        gap: 15px;
    }

    .footer-certifications img {
        max-width: 120px;
    }

    /* Hero Slider */
    .hero-slider-section,
    .hero-slide {
        height: 300px !important;
    }

    .hero-slider-dot {
        width: 8px;
        height: 8px;
    }

    .hero-slider-dot.active {
        width: 24px;
    }
    
    /* Certificados en móviles muy pequeños */
    .certificados-grid {
        grid-template-columns: 1fr !important;
    }
    
    .certificados-grid img {
        max-width: 140px;
        margin: 0 auto;
    }
}

/* ========================================
   PREVENIR SCROLL HORIZONTAL
   ======================================== */

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

* {
    max-width: 100%;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
}

.wp-block-group,
.wp-block-columns,
.wp-block-column {
    max-width: 100%;
}

/* ========================================
   UTILIDADES RESPONSIVE
   ======================================== */

/* Ocultar elementos en móvil */
.mobile-hidden {
    display: block;
}

.mobile-only {
    display: none;
}

@media screen and (max-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
}

/* Ajustes de espaciado para móviles */
@media screen and (max-width: 768px) {
    .wp-block-group {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .has-background {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* ========================================
   MEJORAS DE ACCESIBILIDAD MOBILE
   ======================================== */

@media screen and (max-width: 768px) {
    /* Tamaños de fuente mínimos */
    body {
        font-size: 16px; /* Previene zoom en iOS */
    }
    
    /* Botones y enlaces touch-friendly */
    .main-navigation a,
    .secondary-navigation a,
    .mobile-menu-toggle {
        min-height: 44px;
        line-height: 44px;
    }
    
    /* Espaciado suficiente entre elementos táctiles */
    .main-navigation li {
        margin-bottom: 2px;
    }
}

/* ========================================
   OPTIMIZACIONES DE RENDIMIENTO MOBILE
   ======================================== */

@media screen and (max-width: 768px) {
    /* Suavizar transiciones */
    .hero-slide {
        transition: opacity 0.5s ease-in-out !important;
    }
    
    /* Optimizar imágenes para móvil */
    .hero-slide {
        background-size: cover;
        background-position: center;
    }
}

/* ========================================
   CORRECCIONES ESPECÍFICAS PARA TWENTY TWENTY-FIVE
   ======================================== */

/* Asegurar que el header ocupe todo el ancho */
.wp-block-template-part {
    max-width: none !important;
}

/* Corregir márgenes en bloques de contenido */
main .wp-block-group:first-child {
    margin-top: 0 !important;
}

/* Ajustar el contenedor principal */
.wp-site-blocks > * {
    max-width: none !important;
}

.wp-site-blocks > .alignfull {
    max-width: none !important;
}

/* ========================================
   ESTILOS PARA COMPONENTES PERSONALIZADOS
   ======================================== */

/* Botón menú móvil personalizado */
.mobile-menu-toggle {
    border: none;
    background: #2c3e6f;
    color: white;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: #1f2d4d;
}

.mobile-menu-toggle:focus {
    outline: 2px solid #8dc8e0;
    outline-offset: 2px;
}

/* Estados del menú móvil */
.main-navigation.mobile-menu-open {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mejoras visuales para el submenú en móvil */
@media screen and (max-width: 768px) {
    .secondary-navigation a {
        transition: background-color 0.2s ease;
    }
    
    .secondary-navigation a:hover {
        background: rgba(255,255,255,0.2);
    }
}

/* ========================================
   COMPATIBILIDAD CON NAVEGADORES MÓVILES
   ======================================== */

/* Safari iOS específico */
@supports (-webkit-touch-callout: none) {
    .hero-slider-section {
        height: 600px;
    }
    
    @media screen and (max-width: 768px) {
        .hero-slider-section {
            height: 300px;
        }
    }
}

/* Firefox Mobile */
@-moz-document url-prefix() {
    .mobile-menu-toggle {
        padding: 14px 15px;
    }
}

/* ========================================
   ELIMINAR MENÚ DE ESCRITORIO - SOLO MOSTRAR MENÚ MÓVIL
   ======================================== */

/* Ocultar completamente el menú principal de escritorio */
.main-navigation,
.primary-menu {
    display: none !important;
}

/* Ocultar el submenú cian */
.secondary-navigation-container {
    display: none !important;
}

/* Mostrar y hacer funcional el menú móvil */
.mobile-menu-toggle {
    display: block !important;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    background-color: #1f3864 !important;
    border: 2px solid #ffffff !important;
    border-radius: 50% !important;
    width: 60px !important;
    height: 60px !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 3px;
    background-color: #ffffff;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Menú móvil desplegable */
.mobile-menu-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(31, 56, 100, 0.95);
    z-index: 9999;
    padding: 80px 20px 20px;
    overflow-y: auto;
}

.mobile-menu-container.active {
    display: block;
}

.mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    z-index: 10001;
}

.mobile-menu-content {
    max-width: 400px;
    margin: 0 auto;
}

.mobile-menu-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-content li {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-menu-content a {
    display: block;
    padding: 15px 20px;
    color: #ffffff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.mobile-menu-content a:hover {
    background-color: rgba(255,255,255,0.1);
}

/* Para tablets y móviles */
@media screen and (max-width: 1024px) {
    .mobile-menu-toggle {
        display: flex !important;
    }
}

/* Solo mostrar el menú móvil en todos los dispositivos */
@media screen and (min-width: 1025px) {
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    .main-navigation,
    .primary-menu,
    .secondary-navigation-container {
        display: none !important;
    }
}

/* ========================================
   REAJUSTES RESPONSIVE MÓVIL
   ======================================== */

/* Evitar scroll horizontal */
html, body {
    overflow-x: hidden;
}

/* Breakpoint para tablets (basado en Divi) */
@media screen and (max-width: 980px) {

    /* --- HEADER --- */
    
    /* Contenedor principal del header: apilamos los elementos */
    .site-header-main-container {
        flex-direction: column !important;
        align-items: center !important;
        padding-bottom: var(--wp--preset--spacing--30) !important;
    }
    
    /* 1. Logo: Ancho completo y centrado */
    .site-header-main-container .wp-block-site-logo {
        width: 100%;
        max-width: 320px; /* Ajusta si es necesario */
        margin-left: auto !important;
        margin-right: auto !important;
        margin-bottom: var(--wp--preset--spacing--40) !important;
        text-align: center;
    }
    
    /* 2. Búsqueda: Debajo del logo */
    .site-header-main-container .wp-block-search {
        order: 2; /* Asegura que vaya después del logo */
        width: 90%;
        max-width: 400px;
        margin: 0 auto !important;
    }
    
    /* Ocultamos la barra de búsqueda compacta del header de Divi si existe */
    .header-search-compact {
        margin-top: 1rem;
    }

    /* 3. Menú: Ocultamos la navegación de escritorio */
    .site-header-main-container .main-navigation {
        display: none !important;
    }
    
    /* --- Botón Hamburguesa (Creado por grafcan-mobile-menu.js) --- */
    
    /* Posicionamos el botón hamburguesa */
    .mobile-menu-toggle {
        display: block;
        order: 3; /* Asegura que vaya después de la búsqueda */
        margin-top: var(--wp--preset--spacing--40);
    }
    
    /* Cambiamos el color de las líneas (el fondo del header es oscuro) */
    .mobile-menu-toggle .hamburger-line {
        background-color: #ffffff;
    }
    
    /* Estilos del menú móvil desplegado */
    .main-navigation ul.mobile-menu-open {
        display: flex !important;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%; /* Se despliega desde la parte inferior del header */
        left: 0;
        background-color: #1f3864; /* Azul Grafcan Oscuro */
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        z-index: 999;
    }
    
    .main-navigation ul.mobile-menu-open li {
        width: 100%;
    }
    
    .main-navigation ul.mobile-menu-open a {
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        color: #ffffff !important;
    }
    
    /* Ajustar el submenú (cian) */
    .secondary-navigation-container .wp-block-navigation__container {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    /* --- FOOTER (Sellos de Calidad) --- */
    
    /* Apilamos los sellos en 2 columnas */
    .certificados-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px;
        justify-items: center;
    }
    
    .certificados-grid .wp-block-image {
        margin: 0;
    }
    
    /* Apilamos las columnas principales del footer */
    #footer-web-grafcan .wp-block-columns {
        flex-direction: column;
    }
}

/* Breakpoint para móviles (basado en Divi) */
@media screen and (max-width: 768px) {
    
    /* Hacemos el slider hero más pequeño en móviles */
    .hero-slider-section,
    .hero-slide {
        height: 400px !important;
    }
    
    .hero-slide-text h2 {
        font-size: clamp(1.8rem, 5vw, 2.5rem) !important;
    }
    
    .hero-slide-text p {
        font-size: clamp(1rem, 2vw, 1.1rem) !important;
    }

    /* Ajustar padding general del header */
    .site-header-main-container {
        padding-left: var(--wp--preset--spacing--30) !important;
        padding-right: var(--wp--preset--spacing--30) !important;
    }
    
    /* --- FOOTER (Sellos de Calidad) --- */
    
    /* Mantenemos 2 columnas, pero centramos */
    .certificados-grid {
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
    
    /* Centrar redes sociales */
    .footer-social-links {
        justify-content: center;
    }
    
    /* Apilar el copyright y los enlaces legales */
    #footer-web-grafcan .wp-block-group.alignwide {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: var(--wp--preset--spacing--30);
    }
}

/* Breakpoint para móviles pequeños */
@media screen and (max-width: 480px) {
    .hero-slider-section,
    .hero-slide {
        height: 350px !important;
    }
}

/* ========================================
   CORRECCIONES DEFINITIVAS MENÚ MÓVIL
   ======================================== */

/* 1. Ocultar el botón hamburguesa nativo del bloque de navegación (el de arriba) */
.wp-block-navigation__responsive-container-open {
    display: none !important;
}

/* 2. Ocultar el botón "Volver Arriba" (el flotante del footer que confunde) */
.boton-volver-arriba,
#botonVolverArriba {
    display: none !important;
}

/* 3. Estilos para el botón hamburguesa CORRECTO (el de grafcan-mobile-menu.js) */
@media screen and (max-width: 980px) {

    /* Posicionamos el botón hamburguesa CORRECTO (el de tu script) */
    .mobile-menu-toggle {
        display: block !important; /* Hacemos que sea visible */
        order: 3; /* 1. Logo, 2. Search, 3. Este botón */
        margin: var(--wp--preset--spacing--40) auto 0 auto; /* Centrado y con margen superior */
        background: transparent;
        border: 2px solid #ffffff; /* Borde blanco para que se vea */
        padding: 8px 10px;
        border-radius: 8px;
        cursor: pointer;
    }
    
    /* Estilos de las líneas (las 3 rayas) */
    .mobile-menu-toggle .hamburger-line {
        background-color: #ffffff;
        width: 30px;
        height: 3px;
        margin: 5px 0;
        display: block;
        transition: all 0.3s ease;
    }

    /* Ocultamos la navegación de escritorio (el ul) */
    .site-header-main-container .main-navigation > ul {
        display: none !important;
    }

    /* Estilos del menú móvil desplegado (el que controla el JS) */
    .main-navigation ul.mobile-menu-open {
        display: flex !important;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%; /* Se despliega desde la parte inferior del header */
        left: 0;
        background-color: #1f3864; /* Azul Grafcan Oscuro */
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        z-index: 999;
        padding: 0;
        margin: 0;
    }
    
    .main-navigation ul.mobile-menu-open li {
        width: 100%;
        list-style: none;
        margin: 0;
    }
    
    .main-navigation ul.mobile-menu-open a {
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        color: #ffffff !important;
        text-decoration: none;
        display: block;
    }
    
    /* Animación del botón al hacer clic */
    .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }
}

/* ========================================
   REAJUSTES RESPONSIVE MÓVIL
   ======================================== */

/* Evitar scroll horizontal */
html, body {
    overflow-x: hidden;
}

/* 1. Ocultar el botón hamburguesa nativo del bloque de navegación (el de arriba) */
.wp-block-navigation__responsive-container-open {
    display: none !important;
}

/* 2. Ocultar el botón "Volver Arriba" si se quiere (opcional si ya es flecha) */
/* .boton-volver-arriba,
#botonVolverArriba {
    display: none !important;
}
*/

/* Breakpoint para tablets (basado en Divi) */
@media screen and (max-width: 980px) {

    /* --- HEADER --- */
    
    /* Contenedor principal del header: apilamos los elementos */
    .site-header-main-container {
        flex-direction: column !important;
        align-items: center !important;
        padding-bottom: var(--wp--preset--spacing--30) !important;
    }
    
    /* 1. Logo: Ancho completo y centrado */
    .site-header-main-container .wp-block-site-logo {
        width: 100%;
        max-width: 320px;
        margin-left: auto !important;
        margin-right: auto !important;
        margin-bottom: var(--wp--preset--spacing--40) !important;
        text-align: center;
    }
    
    /* 2. Búsqueda: Debajo del logo */
    .site-header-main-container .wp-block-search {
        order: 2; /* Asegura que vaya después del logo */
        width: 90%;
        max-width: 400px;
        margin: 0 auto !important;
    }
    
    .header-search-compact {
        margin-top: 1rem;
    }

    /* 3. Ocultamos la navegación de escritorio (el ul) */
    .site-header-main-container .main-navigation > ul {
        display: none !important;
    }
    
    /* --- Botón Hamburguesa (Creado por grafcan-mobile-menu.js) --- */
    
    /* ESTE ES EL BOTÓN QUE TÚ QUIERES:
       Fijo en el header, centrado, debajo de la búsqueda */
    .mobile-menu-toggle {
        display: block !important; /* Hacemos que sea visible */
        order: 3; /* 1. Logo, 2. Search, 3. Este botón */
        margin: var(--wp--preset--spacing--40) auto 0 auto; /* Centrado y con margen superior */
        background: transparent;
        border: 2px solid #ffffff; /* Borde blanco para que se vea */
        padding: 8px 10px;
        border-radius: 8px;
        cursor: pointer;
    }
    
    /* Estilos de las líneas (las 3 rayas) */
    .mobile-menu-toggle .hamburger-line {
        background-color: #ffffff;
        width: 30px;
        height: 3px;
        margin: 5px 0;
        display: block;
        transition: all 0.3s ease;
    }

    /* ESTE ES EL MENÚ DESPLEGABLE: Fondo azul, letras blancas */
    .main-navigation ul.mobile-menu-open {
        display: flex !important;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%; /* Se despliega desde la parte inferior del header */
        left: 0;
        background-color: #1f3864; /* FONDO AZUL */
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        z-index: 999;
        padding: 0;
        margin: 0;
    }
    
    .main-navigation ul.mobile-menu-open li {
        width: 100%;
        list-style: none;
        margin: 0;
    }
    
    /* LETRAS BLANCAS */
    .main-navigation ul.mobile-menu-open a {
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        color: #ffffff !important; 
        text-decoration: none;
        display: block;
    }
    
    /* Animación del botón al hacer clic */
    .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }
    
    /* Ajustar el submenú (cian) */
    .secondary-navigation-container .wp-block-navigation__container {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    /* --- FOOTER (Sellos de Calidad) --- */
    
    /* Apilamos los sellos en 2 columnas */
    .certificados-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px;
        justify-items: center;
    }
    
    .certificados-grid .wp-block-image {
        margin: 0;
    }
    
    /* Apilamos las columnas principales del footer */
    #footer-web-grafcan .wp-block-columns {
        flex-direction: column;
    }
}

/* Breakpoint para móviles (basado en Divi) */
@media screen and (max-width: 768px) {
    
    /* Hacemos el slider hero más pequeño en móviles */
    .hero-slider-section,
    .hero-slide {
        height: 400px !important;
    }
    
    .hero-slide-text h2 {
        font-size: clamp(1.8rem, 5vw, 2.5rem) !important;
    }
    
    .hero-slide-text p {
        font-size: clamp(1rem, 2vw, 1.1rem) !important;
    }

    /* Ajustar padding general del header */
    .site-header-main-container {
        padding-left: var(--wp--preset--spacing--30) !important;
        padding-right: var(--wp--preset--spacing--30) !important;
    }
    
    /* --- FOOTER (Sellos de Calidad) --- */
    
    /* Mantenemos 2 columnas, pero centramos */
    .certificados-grid {
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
    
    /* Centrar redes sociales */
    .footer-social-links {
        justify-content: center;
    }
    
    /* Apilar el copyright y los enlaces legales */
    #footer-web-grafcan .wp-block-group.alignwide {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: var(--wp--preset--spacing--30);
    }
}

/* Breakpoint para móviles pequeños */
@media screen and (max-width: 480px) {
    .hero-slider-section,
    .hero-slide {
        height: 350px !important;
    }
}