/* =========================================
   1. CONFIGURACIÓN GLOBAL (ROBOTO FLEX)
   ========================================= */
html, body, div, header, nav, main, article, aside, footer, h1, h2, h3, p, ul, li, a, img {
    box-sizing: border-box;
}
body {
    font-family: "Roboto Flex", Arial, sans-serif;
    font-weight: 400;
    margin: 0;
    padding: 0;
    background-color: #00334d;
    color: #000;
}
p {
    margin-top: 0;
    margin-bottom: 12px;
    line-height: 1.4;
}
li {
    margin-bottom: 4px;
    line-height: 1.3;
}
.container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: #ffffff;
    min-height: 100vh;
}
/* =========================================
   2. EXCEPCIONES: ENLACES SIN RECUADRO
   ========================================= */
/* Direcciones, menú, pie de página, pies de foto y BANDERAS */
.contact-info a,
.main-nav a,
.footer-links a,
.copyright-link,
figcaption a,
.lang-selector a {
    border: none !important;
    padding: 2px 4px !important;
    display: inline-block;
    text-decoration: none !important;
    background-color: transparent !important;
    font-weight: inherit;
}
/* Efecto hover para excepciones (las banderas no cambian de color de fondo) */
.contact-info a:hover,
.main-nav a:hover,
.footer-links a:hover,
.copyright-link:hover,
figcaption a:hover {
    background-color: #ff9933 !important;
    color: #000 !important;
    border-radius: 4px;
}
.lang-selector a:hover {
    background-color: transparent !important; /* Mantenemos limpio el selector de idiomas */
}
/* =========================================
   3. ENLACES GENERALES CON RECUADRO (CTA)
   ========================================= */
.main-content a, .sidebar a {
    color: #A80000;
    text-decoration: none !important;
    font-weight: 600;
    border: 1px solid #A80000;
    border-radius: 8px;
    padding: 4px 10px;
    display: inline-block;
    margin: 2px 0;
    transition: all 0.2s ease;
}
.main-content a:hover, .sidebar a:hover {
    background-color: #ff9933;
    border-color: #ff9933;
    color: #000000 !important;
}
/* =========================================
   2. CABECERA (HEADER)
   ========================================= */
.main-header {
    text-align: center;
    background-color: #ffffff;
}
.vectorizacion-text {
    font-size: 20px;
    font-weight: 790;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #333333;
    text-align: center;
    margin-bottom: 3px;
}
.contact-info {
    font-size: 0.9em;
    color: #000000;
    margin-bottom: 7px;
    /* Ajustes de compresión elástica */
    font-stretch: 90%;
    font-variation-settings: "wdth" 90;
    letter-spacing: -0.01em;
    font-weight: 500;
}
.contact-info a {
    color: #000000 !important;
    text-decoration: none !important;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
    display: inline-block;
}
.contact-info a:hover {
    background-color: #ff9933;
    color: #000000 !important;
}

/* =========================================
   CABECERA (HEADER) - ALTURA FIJA 202px
   ========================================= */

.hero-banner {
    background-color: #ff9933; 
    display: flex;
    justify-content: center;   /* Centra la imagen horizontalmente */
    align-items: center;       /* Centra la imagen verticalmente */
    width: 100%;               /* Se estira a lo ancho del container */
    max-width: 1000px;         /* No sobrepasa el container blanco */
    height: 202px;             /* ALTURA FIJA: El naranja nunca medirá más que esto */
    overflow: hidden;
    margin: 0 auto;
}

.hero-banner img {
    width: 554px;              /* Su ancho real */
    height: 202px;             /* Su alto real */
    max-width: 100%;           /* En móviles permite que se encoja */
    object-fit: contain;       /* Asegura que no se deforme al encogerse */
    display: block;
}

/* Ajuste para móviles: cuando la pantalla es más estrecha que la imagen */
@media (max-width: 554px) {
    .hero-banner {
        /* En móviles pequeños, la altura debe ser automática 
           para que el naranja no sobre el alto de la imagen encogida */
        height: auto; 
        aspect-ratio: 554 / 202; 
    }
}
/* =========================================
   3. NAVEGACIÓN Y ENLACES
   ========================================= */

/* Contenedor principal de la navegación */
.main-nav {
    background-color: #660001;
    position: relative;
    padding: 0;
}

/* Botón del menú hamburguesa (oculto en escritorio) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    padding: 10px 16px;
    width: 100%;
    text-align: left;
}

/* Lista principal del menú */
.nav-menu {
    list-style: none;
    margin: 0;
    padding: 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    background-color: #660001;
}

.nav-item {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Enlaces del menú principal */
.nav-item > a {
    color: #ffffff;
    text-decoration: none !important;
    font-weight: 500;
    font-size: 0.96em;
    padding: 6px 12px;
    transition: all 0.2s ease;
    display: inline-block;
    border-radius: 4px;
    white-space: nowrap;
}

.nav-item > a:hover {
    background-color: #ff9933;
    color: #000000;
}

/* Submenú desplegable */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #660001;
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: 250px;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    border-radius: 0 0 6px 6px;
}

.dropdown-menu li {
    margin: 0;
    padding: 0;
    list-style: none;
    width: 100%;
}

.dropdown-menu li a {
    display: block;
    padding: 10px 16px;
    color: #ffffff;
    text-decoration: none !important;
    font-size: 0.9em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    transition: all 0.2s ease;
}

.dropdown-menu li a:hover {
    background-color: #ff9933;
    color: #000000 !important;
}

/* Estado abierto del submenú */
.dropdown-menu.show {
    display: block;
}

/* Enlaces del contenido principal y barra lateral */
.main-content a, .sidebar a {
    color: #A80000;
    text-decoration: none !important;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.main-content a:hover, .sidebar a:hover {
    background-color: #ff9933;
    color: #000000 !important;
}
/* =========================================
   4. ESTRUCTURA Y CONTENIDO
   ========================================= */
.content-wrapper {
    display: flex;
    padding: 0;
    gap: 0;    
}
.main-content {
    flex: 3;
    text-align: center;
    background-color: #ffffff;
    padding: 20px 40px;        
}
.sidebar {
    flex: 1;
    padding: 20px 25px;
    text-align: left;
    background-color: #f3f3f3;
}
.cookie-list {
    list-style-type: disc;
    padding-left: 30px;
    margin: 15px 0;
    text-align: left;
}
.cookie-list li {
    margin-bottom: 6px;
    line-height: 1.5;
    color: #333;
    font-size: 0.95em;
}
.main-illustration, .illustration-center {
    margin: 20px 0 10px 0;
    width: 100%;
    text-align: center;
}
.main-illustration img, .illustration-center img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}
.main-illustration figcaption, .illustration-center figcaption {
    margin-top: 8px;
    font-size: 0.95em;
    text-align: center;
    padding: 0 15px;
}
.main-illustration figcaption { color: #cc0000; }
.illustration-center figcaption { color: #000000; }
.lang-selector { text-align: center; }
.lang-selector a:hover { background-color: transparent !important; }
.lang-selector img { margin: 0 5px; vertical-align: middle; }
h1 { color: #cc0000; font-size: 2.1em; font-weight: 700; margin: 10px 0; line-height: 1.2; }
h2 { color: #cc0000; font-size: 1.3em; font-weight: 600; margin: 5px 0; }
h3 { color: #cc0000; font-size: 1.07em; font-weight: 580; margin: 5px 0; }
.subtitulo {
    color: #333;
    font-weight: 560;
    margin-bottom: 0;
    margin-top: 10px;
    font-size: 1.1em;
}
/* =========================================
   5. BLOQUES ESPECIALES
   ========================================= */
.bloque-formatos {
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
    margin: 25px 60px;
    padding: 7px 0;
    text-align: center;
}
.bloque-formatos p {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.4;
    color: #000;
}
.bloque-formatos strong { font-weight: 650; font-size: 1.05em; }
.text-block { text-align: left; margin-top: 30px; margin-bottom: 20px; }
.cuadro-licencia {
    background-color: #fcd9b6ad;
    border: 1px solid #000000;
    border-radius: 15px;
    padding: 20px;
    color: #000000;
    line-height: 1.4;
    max-width: 500px;
    margin: 25px auto;
}
.cuadro-licencia h2 { margin-top: 0; font-size: 1.25em; }
aside.sidebar ul { list-style: none !important; padding: 0 !important; margin: 0 !important; }
aside.sidebar li {
    display: block;
    padding: 0;
    margin-bottom: 2px;
    line-height: 1.2;
    text-align: left;
}
aside.sidebar li a {
    color: #b30000;
    text-decoration: none;
    line-height: 1.1;
    display: inline-block;
    width: 100%;
    font-weight: normal;
    font-size: 0.94rem;
}

/* =========================================
   6. SERVICIOS Y GRID
   ========================================= */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px 20px;
    margin: 20px 0;
}

.service-item, .service-item-medium { text-align: center; }

.service-item a, .service-item-medium a {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: inherit;
}

/* Mantenemos el fondo transparente en el hover del enlace para ambos */
.service-item a:hover, .service-item-medium a:hover { 
    background-color: transparent !important; 
}

/* --- ICONO 120x120 --- */
.service-item img {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    object-fit: cover;
    transition: transform 0.2s ease;
    display: block;
    margin: 0 auto;
}
.service-item a:hover img { transform: scale(1.04); }

/* --- ICONO 120x130 (Regla completa) --- */
.service-item-medium img {
    width: 120px;
    height: 130px;
    border-radius: 20px;
    object-fit: cover;
    transition: transform 0.2s ease;
    display: block;
    margin: 0 auto;
}
.service-item-medium a:hover img { transform: scale(1.04); }

/* --- COMPORTAMIENTO DEL TEXTO (FIG CAPTION) --- */
.service-item p, .service-item-medium p {
    font-size: 0.95em;
    color: #cc0000;
    font-weight: 500;
    margin-top: 8px;
    line-height: 1.2;
    min-height: 2.4em;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background-color 0.2s;
    display: inline-block;
    text-align: center;
    width: fit-content;
}

/* Solo el párrafo se pone naranja al pasar el ratón */
.service-item a:hover p, .service-item-medium a:hover p { 
    background-color: #ff9933; 
    color: #000000; 
}

/* --- RESTO DE VARIANTES --- */
.service-item-vertical img { width: 120px; height: 180px; object-fit: cover; border-radius: 15px; }
.service-item-vertical p { margin-top: 10px; min-height: auto; }

.price-tag {
    display: block;
    font-size: 0.95em;
    color: #333;
    font-weight: 550;
    margin-top: 0;
    text-align: center;
}

/* =========================================
   7. ANUNCIOS Y FOOTER - MODIFICADO
   ========================================= */
.columna-derecha-anuncio {
    background-color: #f4f4f4;
    padding: 15px;
    text-align: center;
    max-width: 200px; /* Mantiene el ancho de tu columna */
}

.tituloanuncios {
    color: #a30000;
    font-weight: bold;
    font-size: 1.3em;
    line-height: 1.3;
    margin-bottom: 10px;
    text-align: left;
    clear: both; /* Evita que se pegue al buscador de arriba */
    display: block;
}

.fotoanuncio { 
    margin-bottom: 10px; 
    display: block; 
    clear: both;
}

.fotoanuncio img { 
    display: block; 
    margin: 0 auto; 
    height: auto; 
    max-width: 100%; 
}

.textoanuncio p {
    font-size: 0.95em;
    line-height: 1.4;
    color: #000000;
    text-align: left;
    margin: 0 0 10px 0;
    display: block;
    clear: both; /* Obliga al texto a estar debajo de la foto */
}

.textoanuncio a { 
    color: #A80000; 
    text-decoration: none; 
    font-weight: 560; 
    text-transform: uppercase; 
}

.textoanuncio a:hover { 
    text-decoration: underline; 
}

.contenedor-anuncio {
    display: block;        /* Cambiado de flex a block para evitar desbordes */
    width: 100%;
    margin-top: 15px;
    clear: both;           /* Aísla el anuncio de elementos superiores */
}

.main-footer {
    background-color: #660001;
    color: #ffffff;
    text-align: center;
    padding: 25px 20px;
    font-size: 0.85em;
}
.footer-links a, .copyright-link {
    color: #ffffff;
    text-decoration: none;
    margin: 0 10px;
    padding: 2px 4px;
    border-radius: 4px;
}
.footer-links a:hover, .copyright-link:hover {
    background-color: #ff9933;
    color: #000000;
}
/* =========================================
    8. RESPONSIVE
   ========================================= */
@media (max-width: 900px) {
    .content-wrapper { flex-direction: row; }
    .main-content { padding: 20px; }
    .services-grid { grid-template-columns: repeat(3, 1fr); gap: 20px 15px; }
    .bloque-formatos { margin: 25px 20px; }
}

@media (max-width: 650px) {
    /* Cabecera y contenido general */
    .main-header { width: 100%; overflow: hidden; }
    .main-header img { max-width: 100%; height: auto; }
    .vectorizacion-text { font-size: 18px; letter-spacing: 1px; }
    .contact-info { font-size: 0.9em; padding: 0 10px; }
    .hero-banner img { width: 100%; height: auto; }
    .content-wrapper { flex-direction: column; }
    .main-content { order: 1; padding: 20px 15px; }
    .sidebar { order: 2; flex: none; width: 100%; }
    .services-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 10px; }
    h1 { font-size: 1.7em; }
    .bloque-formatos { margin: 20px 15px; }

/* Adaptación del menú móvil (Alineado exactamente con el sándwich) */
    .menu-toggle {
        display: block;
        padding: 10px 16px; /* Define la alineación izquierda con 16px */
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 0;
        gap: 0;
    }

    .nav-menu.show {
        display: flex;
    }

    .nav-item {
        width: 100%;
        text-align: left;
    }

    /* Alinea el texto de las opciones principales exactamente con los 16px del sándwich */
    .nav-item > a {
        display: block;
        padding: 12px 16px !important; 
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 0;
    }

    .dropdown-menu {
        position: static;
        width: 100%;
        max-height: none;
        box-shadow: none;
        background-color: #4a0001;
        border-radius: 0;
    }

    /* Submenú con sangría hacia la derecha para diferenciar los niveles */
    .dropdown-menu li a {
        text-align: left;
        padding: 10px 16px 10px 32px !important; 
    }
}
/* =========================================
    9. BANNER COOKIES
   ========================================= */
#cookie-banner {
                position: fixed !important;
                bottom: 0 !important;
                left: 0 !important;
                width: 100% !important;
                background-color: rgba(34, 34, 34, 0.9) !important;
                backdrop-filter: blur(5px);
                color: #fff;
                padding: 20px;
                font-size: 0.9em;
                text-align: center;
                box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.4);
                z-index: 999999999 !important;
                display: none;
                box-sizing: border-box;
                /* CAMBIO: Priorizamos Roboto y quitamos las fuentes Apple pesadas */
                font-family: 'Roboto', Arial, sans-serif;
            }

            .cookie-content {
                max-width: 1000px;
                margin: 0 auto;
            }

            .cookie-content p {
                margin: 0 0 15px 0;
                line-height: 1.5;
                color: #fff;
            }

            .cookie-buttons {
                display: flex;
                justify-content: center;
                gap: 10px;
                flex-wrap: wrap;
                margin-bottom: 15px;
            }

            .cookie-buttons button {
                border: none;
                padding: 8px 16px;
                border-radius: 5px;
                cursor: pointer;
                font-size: 0.85em;
                /* CAMBIO: Peso 700 para que se vea bien en Roboto (Inter usaba 600) */
                font-weight: 700;
                transition: background-color 0.3s ease;
                /* CAMBIO: ELIMINADO "Inter", ahora usa la fuente del banner */
                font-family: inherit;
                width: auto;
            }

            #accept-cookies,
            #settings-cookies {
                background-color: #a90102;
                color: white;
            }

            #accept-cookies:hover,
            #settings-cookies:hover {
                background-color: #820101;
            }

            #reject-cookies {
                background-color: #6c757d;
                color: white;
            }

            #reject-cookies:hover {
                background-color: #5a6268;
            }

            .cookie-legal-links {
                margin-top: 10px;
                font-size: 0.75em;
                padding-top: 5px;
            }

            .cookie-legal-links a {
                color: #ccc;
                text-decoration: none;
                margin: 0 8px;
            }

            .cookie-legal-links a:hover {
                color: #fff;
                text-decoration: underline;
            }

            @media (max-width: 600px) {
                .cookie-buttons {
                    gap: 8px;
                }

                #cookie-banner {
                    padding: 15px 10px;
                }
            }