
/* 1. Root Variables & Basic Reset */
:root {
    --primary-color: #ee0f0f;
    --secondary-color: #faa405;
    --accent-color: #faa405;
    --light-gray-color: #777777;
    --medium-gray-color: #bef00a;
    --dark-gray-color: #050811;
    --text-color: #000000;
    --white-color: #dadada;
    --font-family-primary: 'Arial', sans-serif;
    --box-shadow: 0 4px 12px rgba(56, 58, 56, 0.1);
    --border-radius: 8px;
    --transition-speed: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family-primary);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white-color);
}

/* 2. General Styles & Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--accent-color);
}

.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

.bg-light {
    background-color: var(--light-gray-color);
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 12px 28px;
    border-radius: var(--border-radius);
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color var(--transition-speed), transform var(--transition-speed);
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--accent-color);
    color: var(--white-color);
    transform: translateY(-3px);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--dark-gray-color);
}

.btn-secondary:hover {
    background-color: var(--accent-color);
}

.btn-link {
    color: var(--primary-color);
    font-weight: bold;
}

.btn-link:hover {
    text-decoration: underline;
}

.text-center {
    text-align: center;
}

.text-justify {
    text-align: justify;
}

.img-center {
    margin-left: auto;
    margin-right: auto;
}


/* 3. Header & Navigation */
.header {
    background-color: var(--white-color);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s, padding 0.3s, box-shadow 0.3s;
}

.header.scrolled {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.cabecera {
    background-color: #ffffff;
    padding: 10px 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.cabecera-contenido {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo-contenedor .logo-imagen {
    height: 35px;
}

.formulario-busqueda {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 25px;
    overflow: hidden;
}

.campo-busqueda {
    padding: 8px 15px;
    border: none;
    outline: none;
    font-size: 1rem;
    width: 250px;
}

.boton-busqueda {
    padding: 8px 20px;
    border: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.boton-busqueda:hover {
    background-color: var(--accent-color);
}


.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    padding-bottom: 10px;
}

.logo-link .logo-img {
    height: 80px;
    transition: height var(--transition-speed);
}

.header.scrolled .logo-link .logo-img {
    height: 60px;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.8rem;
    cursor: pointer;
}

.nav-menu {
    display: flex;
    align-items: center;
}

.nav-menu-item {
    margin-left: 30px;
    position: relative;
}

.nav-menu-link {
    color: var(--dark-gray-color);
    font-weight: 500;
    padding: 10px 0;
    position: relative;
    letter-spacing: 0.5px;
}

.nav-menu-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width var(--transition-speed);
}

.nav-menu-link:hover, .nav-menu-link.active {
    color: var(--primary-color);
}

.nav-menu-link:hover::after, .nav-menu-link.active::after {
    width: 100%;
}

.dropdown-icon {
    margin-left: 5px;
    font-size: 0.8em;
    transition: transform var(--transition-speed);
}

.dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--white-color);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 10px 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-speed);
}

.dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-link {
    display: block;
    padding: 10px 20px;
    color: var(--dark-gray-color);
    white-space: nowrap;
}

.dropdown-link:hover {
    background-color: var(--light-gray-color);
    color: var(--primary-color);
}

/* 4. Popup Modal */
.modal {
    display: none; /* Oculto por defecto */
    position: fixed; /* Se queda fijo en la pantalla */
    z-index: 1000; /* Se muestra por encima de todo */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Permite scroll si el contenido es muy largo */
    background-color: rgba(0, 0, 0, 0.6); /* Fondo oscuro semitransparente */
    display: flex; /* Use flexbox to truly center content */
    justify-content: center;
    align-items: center;
}

.modal-contenido {
    background-color: #fff;
    margin: 20px; /* Add some margin for smaller screens */
    padding: 15px;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%; /* Use percentage for width */
    max-width: 500px; /* A sensible max-width for larger screens */
    text-align: center;
    position: relative;
    animation: aparecer 0.5s ease-out;
    box-sizing: border-box; /* Include padding in the width calculation */
}

@keyframes aparecer {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cerrar-btn {
    color: #ec9c07;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
    z-index: 1001; /* Ensure close button is above everything */
}

.cerrar-btn:hover,
.cerrar-btn:focus {
    color: #e60808;
    text-decoration: none;
}

.modal-contenido h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: clamp(1.5em, 5vw, 2em); /* Responsive font size */
}

/* Estilos del Slider de Imágenes */
.slider-imagenes {
    position: relative;
    width: 100%;
    /* Use a responsive height, e.g., aspect ratio trick */
    padding-bottom: 75%; /* 4:3 Aspect Ratio (height is 75% of width) */
    /* For 16:9 aspect ratio, use padding-bottom: 56.25%; */
    /* Adjust as needed for your common image aspect ratio */
    height: 0; /* Important to make padding-bottom work for height */
    overflow: hidden; 
    margin-bottom: 20px;
    border-radius: 5px;
    background-color: #f0f0f0; /* Placeholder background */
}

.slider-imagenes img {
    position: absolute; /* Position images absolutely within the container */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* **KEY CHANGE**: `contain` will fit the whole image within the box without cropping. Use `cover` if you prefer to fill the box and crop edges. */
    display: none; 
    border-radius: 5px;
    transition: opacity 0.5s ease-in-out; /* Smooth transition for slide change */
}

.slider-imagenes img.slide-activo {
    display: block;
    opacity: 1;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

.controles-slider {
    margin-bottom: 20px;
    display: flex; /* Use flexbox for buttons */
    justify-content: center; /* Center the buttons */
    gap: 10px; /* Space between buttons */
}

.controles-slider button {
    background-color: #ee0909;
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 5px;
    font-size: clamp(1em, 3vw, 1.2em); /* Responsive font size for buttons */
    flex-grow: 1; /* Allow buttons to grow */
    max-width: 100px; /* Max width for buttons */
}

.controles-slider button:hover {
    background-color: #ec6e07;
}

/* Estilos del Botón de Detalles */
.btn-detalles {
    display: inline-block;
    background-color: #da6e09;
    color: rgb(0, 0, 0);
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    font-size: clamp(1em, 3.5vw, 1.1em); /* Responsive font size */
    width: auto; /* Allow button to adjust width based on content */
    max-width: 90%; /* Max width for button */
}

.btn-detalles:hover {
    background-color: #1e7e34;
}

/* Media Queries for finer control on smaller screens */
@media (max-width: 600px) {
    .modal-contenido {
        padding: 10px;
        margin: 10px;
        border-radius: 20px;
    }

    .cerrar-btn {
        font-size: 24px;
        top: 5px;
        right: 10px;
    }

    .slider-imagenes {
        padding-bottom: 85%; /* Slightly taller aspect ratio for mobile images */
    }

    .controles-slider button {
        padding: 8px 12px;
        font-size: 0.9em;
    }

    .btn-detalles {
        padding: 10px 20px;
        font-size: 0.95em;
    }
}

@media (max-width: 400px) {
    .modal-contenido {
        width: 95%; /* Even wider on very small screens */
    }

    .slider-imagenes {
        padding-bottom: 95%; /* Closer to square for very small screens */
    }
}

/* 5. Hero Slider */
.slider {
    position: relative;
    height: calc(100vh - 125px); /* Full viewport height minus header height */
    min-height: 500px;
    overflow: hidden;
    margin-top: 125px; /* Space for the entire fixed header */
    background-color: var(--dark-gray-color);
}

.slider-container {
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.slide {
    min-width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.3));
}

.slide-content {
    position: relative;
    z-index: 1;
    color: var(--white-color);
    max-width: 800px;
    padding: 20px;
    animation: slideUpContent 1s 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes slideUpContent {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-content h2 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}

.slide-content p {
    font-size: 1.25rem;
    margin-bottom: 30px;
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--white-color);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: background-color var(--transition-speed);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-nav:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

.slider-nav.prev { left: 20px; }
.slider-nav.next { right: 20px; }

/* 6. Page Sections */
/* Nosotros Section */
/* General responsive styling */
    .container {
        max-width: 1200px; /* Or a suitable max-width for your design */
        margin: 0 auto;
        padding: 0 15px; /* Add some horizontal padding */
    }

    .section {
        padding: 40px 0; /* Vertical padding for sections */
    }

    /* Nosotros section specific styling */
    .nosotros-content {
        display: flex;
        flex-wrap: wrap; /* Allows items to wrap to the next line on smaller screens */
        gap: 20px; /* Space between flex items */
        justify-content: center; /* Center items when they wrap */
    }

    .nosotros-text,
    .nosotros-image {
        flex: 1; /* Allow items to grow and shrink */
        min-width: 300px; /* Minimum width before wrapping */
    }

    .nosotros-image img.img-center {
        max-width: 100%; /* Ensure image is responsive */
        height: auto;
        display: block; /* Remove extra space below image */
        margin: 0 auto; /* Center the image */
    }

    /* Responsive video container */
    .video-responsive {
        position: relative;
        padding-bottom: 56.25%; /* 16:9 aspect ratio (height / width = 9 / 16 = 0.5625) */
        height: 0;
        overflow: hidden;
        margin-top: 20px; /* Space above the video */
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    .video-responsive video,
    .video-responsive iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: 0;
    }

    /* Additional video gallery styling (from your provided CSS) */
    .seccion-videos {
        max-width: 900px;
        margin: 20px auto;
        padding: 20px;
        background-color: #ffffff;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .seccion-videos h2 {
        text-align: center;
        color: #333;
        margin-bottom: 30px;
    }

    .galeria-videos {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Adjusted minmax for better responsiveness */
        gap: 20px;
    }

    .video-container {
        position: relative;
        padding-bottom: 56.25%; /* 16:9 aspect ratio */
        height: 0;
        overflow: hidden;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    .video-container video,
    .video-container iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: 0;
    }

    .video-item p {
        margin-top: 10px;
        font-size: 0.9em;
        color: #666;
        text-align: center; /* Center video captions */
    }

/* Niveles Educativos */
.niveles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.nivel-card {
    background-color: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    display: flex;
    flex-direction: column;
}

.nivel-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.nivel-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.nivel-card-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.nivel-card-content h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.nivel-card-content p {
    margin-bottom: 25px;
    flex-grow: 1;
}

/* Noticias / Eventos */
.noticias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.noticia-card {
    background-color: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.noticia-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.noticia-card:hover img {
    transform: scale(1.05);
}

.noticia-card-content {
    padding: 25px;
    flex-grow: 1;
}

.noticia-card-content h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.noticia-card-content h3 a {
    color: var(--primary-color);
}

.noticia-card-content p {
    font-size: 0.95rem;
    margin-bottom: 20px;
    color: #555;
}

/* 7. Image Gallery & Lightbox */
.filter-container {
    text-align: center;
    margin-bottom: 40px;
}

.filter-btn {
    border: 1px solid var(--primary-color);
    background-color: transparent;
    color: var(--primary-color);
    padding: 10px 24px;
    margin: 5px;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s;
    font-size: 1rem;
    font-weight: 500;
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.gallery-item {
    overflow: hidden;
    cursor: pointer;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    height: 250px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item.hide { display: none; }
.gallery-item.show { animation: fadeInScale 0.5s ease; }

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Lightbox */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 85%;
    max-height: 85vh;
    animation: zoomIn 0.5s;
}

@keyframes zoomIn {
    from { transform: scale(0.8); }
    to { transform: scale(1); }
}

.close-btn, .prev-btn, .next-btn {
    position: absolute;
    color: white;
    font-size: 40px;
    transition: 0.3s;
    cursor: pointer;
    user-select: none;
}

.close-btn { top: 15px; right: 35px; }
.prev-btn, .next-btn { top: 50%; transform: translateY(-50%); padding: 16px; }
.prev-btn { left: 10px; }
.next-btn { right: 10px; }

.close-btn:hover, .prev-btn:hover, .next-btn:hover {
    color: var(--secondary-color);
}


/*SECCION DE VIDEOS*/

.seccion-videos {
            max-width: 900px;
            margin: 20px auto;
            padding: 20px;
            background-color: #ffffff;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

        .seccion-videos h2 {
            text-align: center;
            color: #333;
            margin-bottom: 30px;
        }

        .galeria-videos {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
            gap: 20px;
        }

        .video-container {
            position: relative;
            padding-bottom: 56.25%; /* Proporción 16:9 para videos responsivos */
            height: 0;
            overflow: hidden;
            border-radius: 8px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }

        .video-container video,
        .video-container iframe {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border: 0;
        }

        .video-item p {
            margin-top: 10px;
            font-size: 0.9em;
            color: #666;
        }


/* 8. Secundaria con formación técnica (SFT) Slider */

.specialties-section {
    width: 100%; /* Cambiado de 90% a 100% para mejor control con max-width */
    max-width: 800px;
    margin: 2rem auto;
    text-align: center;
}

h4 {
    color: #111d46;
    margin-bottom: 2rem;
    font-size: 2rem; /* Tamaño base para escritorio */
}

h5 {
    color: #141414;
    margin-bottom: 2rem;
    font-size: 1rem; /* Tamaño base para escritorio */
}

.specialties-container {
    position: relative;
    width: 100%;
    /* La altura ahora será adaptable gracias a 'aspect-ratio' */
    aspect-ratio: 16 / 9; /* Mantiene una proporción de 16:9, puedes cambiarla a 4/3, etc. */
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.specialty-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    transform: scale(0.95);
}

.specialty-slide.active {
    opacity: 1;
    transform: scale(1);
}

.specialty-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.specialty-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.5s ease-in-out;
}

.specialty-slide.active .specialty-info {
    transform: translateY(0);
}

.specialty-info h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.8rem;
}

.specialty-info p {
    margin: 0;
    font-size: 1rem;
}

.navigation-buttons {
    margin-top: 1.5rem;
}

.specialties-section {
    background-color: #a7a7a7;
      color: #ecf0f1;
      padding: 40px 25px;
      border-radius: 8px;
      margin-bottom: 20px;
    }


#prevBtn, #nextBtn {
    background-color: #d80b0b;
    color: rgb(255, 255, 255);
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin: 0 0.5rem;
}

#prevBtn:hover, #nextBtn:hover {
    background-color: #f3a108;
}

/* --- Media Queries para Responsividad --- */

@media (max-width: 768px) {
    h1 {
        font-size: 2rem; /* Reduce el tamaño del título principal en pantallas más pequeñas */
    }

    .specialties-container {
        /* Puedes cambiar la proporción para pantallas verticales si lo deseas */
        aspect-ratio: 4 / 3;
    }

    .specialty-info {
        padding: 1rem; /* Reduce el padding del texto sobre la imagen */
    }

    .specialty-info h2 {
        font-size: 1.5rem; /* Reduce el tamaño del título de la especialidad */
    }

    .specialty-info p {
        font-size: 0.9rem; /* Reduce el tamaño del párrafo */
    }

    .navigation-buttons {
        /* Apila los botones verticalmente para un mejor uso en móviles */
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.75rem; /* Añade espacio entre los botones apilados */
    }

    #prevBtn, #nextBtn {
        width: 80%; /* Hace que los botones sean más anchos y fáciles de tocar */
        padding: 1rem; /* Aumenta el área táctil */
        margin: 0;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.5rem; /* Menos padding en las pantallas más pequeñas */
    }

    h1 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .specialties-container {
        border-radius: 10px; /* Bordes ligeramente menos redondeados */
        aspect-ratio: 1 / 1; /* Podría ser mejor una proporción cuadrada en móviles */
    }

    .specialty-info h2 {
        font-size: 1.2rem;
    }

    .specialty-info p {
        font-size: 0.8rem;
    }
}

/* 9. Contact Form & Info */
.contacto-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: flex-start;
}

.formulario-contacto h3, .info-ubicacion h3 {
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: 1.6rem;
}

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: bold; }

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(207, 7, 7, 0.15);
}

.form-message {
    margin-top: 15px;
    font-weight: bold;
    padding: 10px;
    border-radius: 5px;
    display: none;
}
.form-message.success { display: block; color: #155724; background-color: #d4edda; border: 1px solid #c3e6cb;}
.form-message.error { display: block; color: #721c24; background-color: #f8d7da; border: 1px solid #f5c6cb;}

.info-ubicacion p {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    font-size: 1.05rem;
}

.info-ubicacion p i {
    color: var(--primary-color);
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.mapa {
    margin-top: 25px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    border: 1px solid #ddd;
}
.mapa iframe { display: block; }

/* 10. Footer & Social Links */
.footer {
    background-color: var(--dark-gray-color);
    color: var(--light-gray-color);
    padding-bottom: 25px;
}
.section-otros {
    padding: 50px 0;
    border-bottom: 2px solid #ff8800;
}

.otros-flex {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
}

.otros-col { flex: 1; min-width: 250px; }
.otros-col h4 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 1.2rem;
}
.otros-col ul li { margin-bottom: 10px; }
.otros-col ul li a {
    color: var(--light-gray-color);
    transition: color var(--transition-speed), padding-left var(--transition-speed);
}
.otros-col ul li a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: transform 0.3s ease-in-out, opacity 0.3s;
}
.social-icon:hover {
    transform: translateY(-4px);
    opacity: 0.9;
}
.social-icon img { width: 100%; height: 100%; object-fit: cover; }

.footer .container:last-child {
    text-align: center;
    padding-top: 25px;
}
.footer p { margin-bottom: 5px; font-size: 0.9rem; }
.footer .fa-heart { color: var(--accent-color); }
img, iframe {
    max-width: 100%;
    height: auto; /* Maintain aspect ratio */
}

/* 11. Widgets (Chat, Back to Top) */
/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: var(--primary-color);
    color: var(--white-color);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    box-shadow: var(--box-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-speed);
    z-index: 999;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background-color: var(--accent-color);
    transform: scale(1.1);
}

/* Chat Widget */
.chat-fab {
    position: fixed;
    bottom: 25px;
    left: 25px;
    background-color: #f09f09;
    color: rgb(14, 55, 102);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 1000;
}
.chat-fab:hover { transform: scale(1.1); }
.chat-fab i { font-size: 1.8rem; }

.chat-ventana {
    position: fixed;
    bottom: 100px;
    left: 25px;
    width: 350px;
    max-width: 85vw;
    height: 385px;
    max-height: 70vh;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.5) translateY(50px);
    opacity: 0;
    transform-origin: bottom left;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.chat-ventana.abierto {
    display: flex;
    opacity: 1;
    transform: scale(1) translateY(0);
}

.chat-cabecera {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-cabecera h2 { margin: 0; font-size: 1.2em; }

.cerrar-chat {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s;
}
.cerrar-chat:hover { opacity: 1; }

.chat-cuerpo {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.mensaje {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.4;
}
.mensaje.usuario {
    background-color: var(--secondary-color);
    color: #333;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}
.mensaje.bot {
    background-color: #171a33;
    color: #fffefe;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.chat-pie {
    display: flex;
    padding: 10px;
    border-top: 1px solid #eee;
    background-color: #f1f1f1;
}
#chat-entrada {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    margin-right: 10px;
    font-size: 0.95em;
    outline: none;
}
#enviar-mensaje {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    transition: background-color 0.3s ease;
}
#enviar-mensaje:hover { background-color: var(--accent-color); }


/* 12. Responsive Media Queries */
@media (max-width: 992px) {
    .section-title { font-size: 2.2rem; }
    .slide-content h2 { font-size: 2.8rem; }
    .contacto-grid { grid-template-columns: 1fr; gap: 40px; }
    
    .nav-toggle { display: block; z-index: 1001; }
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 320px;
        height: 100vh;
        background-color: var(--dark-gray-color);
        flex-direction: column;
        align-items: flex-start;
        padding: 100px 30px 30px;
        box-shadow: -5px 0 15px rgba(0,0,0,0.2);
        transition: right 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    }
    .nav-menu.active { right: 0; }
    .nav-menu-item { margin-left: 0; margin-bottom: 25px; width: 100%; }
    .nav-menu-link { color: var(--white-color); font-size: 1.2rem; display: block; }
    .nav-menu-link:hover, .nav-menu-link.active { color: var(--secondary-color); }
    .nav-menu-link::after { display: none; }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background-color: transparent;
        padding-left: 20px;
        display: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-out;
    }
    .dropdown-menu.open { display: block; max-height: 500px; }
    .dropdown-link { color: var(--light-gray-color); padding: 8px 0; }
    .dropdown:hover .dropdown-icon { transform: none; }
    .dropdown.open .dropdown-icon { transform: rotate(180deg); }
}

@media (max-width: 768px) {
    .cabecera-contenido { flex-direction: column; gap: 15px; }
    .slider { height: calc(80vh - 175px); margin-top: 175px;}
    .slide-content h2 { font-size: 2rem; }
    .nosotros-content { flex-direction: column; }
    .nosotros-image { order: -1; margin-bottom: 30px; }
    .testimonio-nav { display: none; } /* On mobile, users can swipe (if implemented) */
}

@media (max-width: 480px) {
    .container { padding: 0 15px; }
    .section { padding: 50px 0; }
    .section-title { font-size: 1.8rem; }
    .formulario-busqueda, .campo-busqueda { width: 100%; }
    .logo-link .logo-img { height: 50px; }
    .header.scrolled .logo-link .logo-img { height: 45px; }

    .chat-fab { width: 50px; height: 50px; left: 15px; bottom: 15px;}
    .chat-fab i { font-size: 1.5rem; }
    .chat-ventana { left: 10px; bottom: 80px; }
}

 /* Media queries for fine-tuning responsiveness */
    @media (max-width: 768px) {
        .nosotros-content {
            flex-direction: column; /* Stack text and image vertically on smaller screens */
        }

        .nosotros-text,
        .nosotros-image {
            min-width: unset; /* Remove min-width when stacking */
            width: 100%;
        }

        .galeria-videos {
            grid-template-columns: 1fr; /* Single column for video gallery on small screens */
        }
    }

    @media (max-width: 480px) {
        .section-title {
            font-size: 1.8em; /* Adjust font size for smaller screens */
        }

        h3 {
            font-size: 1.2em;
        }

        p {
            font-size: 0.9em;
        }
    }