/* GLOBAL VARIABLES */
:root {
    --bg-dark: #f4f4f4; /* Fondo principal claro */
    --bg-light: #ffffff; /* Fondo para tarjetas/secciones */
    --text-main: #333333;
    --text-muted: #777777;
    --brand-dark-red: rgb(81, 19, 24);
    --brand-teal: rgb(94, 164, 164);
    --brand-orange: rgb(226, 75, 59);
    --brand-yellow: rgb(247, 174, 58);
    --accent: var(--brand-dark-red); /* Color principal de acento */
    --font-main: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark); /* Fondo gris claro */
    color: var(--text-main); /* Texto oscuro */
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

a {
    text-decoration: none;
    color: var(--text-main);
}

ul {
    list-style: none;
}

.text-center { text-align: center; }
.mt-4 { margin-top: 2rem; }

/* UTILITY CLASSES (Placeholders) */
.placeholder-box {
    background-color: #e9e9e9;
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: #999;
}

/* BUTTONS */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.btn-primary {
    background-color: var(--accent);
    color: #f5f5f5; /* Texto claro para contraste en botón rojo */
}

.btn-primary:hover {
    background-color: #fff;
    color: #000;
}

.btn-secondary {
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-secondary:hover {
    background-color: var(--accent);
    color: #f5f5f5;
}

/* NAVBAR */
.navbar {
    background-color: rgba(255, 255, 255, 0.95);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #e0e0e0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px; /* Espacio entre el logo y el título */
}

.logo img {
    max-height: 60px; /* Controla la altura del logo para que encaje en la navbar */
    width: auto;
}

.logo h2 {
    font-weight: 800;
    font-size: 1.3rem; /* Tamaño ligeramente ajustado para encajar bien con la imagen */
    margin: 0;
    color: var(--brand-dark-red);
}

/* Añadimos ">" para afectar solo al menú principal y no forzar al submenú a estar abierto */
.main-nav > ul {
    display: flex;
    gap: 30px;
}

.main-nav a {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--accent);
}

/* DROPDOWN MENU */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-light);
    padding: 10px 0;
    min-width: 150px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    flex-direction: column;
    gap: 0 !important;
}

.dropdown:hover .dropdown-menu {
    display: flex;
}

.dropdown-menu li a {
    padding: 10px 20px;
    display: block;
}

.dropdown-menu li a:hover {
    background-color: var(--bg-dark);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 2rem;
    cursor: pointer;
}

/* HERO SECTION */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 80px;
    position: relative;
    overflow: hidden;
    background-color: #121212; /* Evita el destello blanco al cargar */
}

.hero-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-slideshow li {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    background-size: cover;
    background-position: center;
    animation: heroSlide 25s linear infinite;
}

/* Imágenes de la galería con overlay oscurecido para que el texto resalte */
.hero-slideshow li:nth-child(1) {
    background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('assets/carousel/01.webp');
    animation-delay: 0s;
}
.hero-slideshow li:nth-child(2) {
    background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('assets/carousel/02.webp');
    animation-delay: 5s; /* Entra 5 segundos después */
}
.hero-slideshow li:nth-child(3) {
    background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('assets/carousel/03.webp');
    animation-delay: 10s; /* Entra 10 segundos después */
}
.hero-slideshow li:nth-child(4) {
    background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('assets/carousel/04.webp');
    animation-delay: 15s; /* Entra 15 segundos después */
}
.hero-slideshow li:nth-child(5) {
    background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('assets/carousel/05.webp');
    animation-delay: 20s; /* Entra 20 segundos después */
}

@keyframes heroSlide {
    0% { opacity: 0; transform: scale(1); }
    3% { opacity: 1; }
    20% { opacity: 1; }
    23% { opacity: 0; transform: scale(1.05); } /* Efecto de ligero zoom antes de desaparecer */
    100% { opacity: 0; transform: scale(1); }
}

.hero h1 { font-size: 4rem; font-weight: 800; margin-bottom: 10px; color: #ffffff; }
.hero h2 { font-size: 1.5rem; font-weight: 300; color: #dddddd; margin-bottom: 20px; }
.hero p { color: #f5f5f5; }
.hero .container { position: relative; z-index: 1; } /* Asegura que el texto siempre quede por encima de las fotos */

/* SECTIONS PADDING */
section {
    padding: 80px 0;
}

/* PORTFOLIO */
.portfolio h2 { margin-bottom: 10px; }

/* VIDEO GALLERY */
.video-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 40px 0;
}
.video-gallery iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* YOUTUBE FACADE (Mejora drástica de rendimiento) */
.youtube-facade {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    cursor: pointer;
    overflow: hidden;
}
.youtube-facade:hover .play-button {
    background-color: #ff0000;
    transform: translate(-50%, -50%) scale(1.05);
}
.youtube-facade .play-button {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 68px; height: 48px;
    background-color: rgba(33, 33, 33, 0.9);
    border-radius: 12px;
    transition: all 0.2s ease;
}
.youtube-facade .play-button::before {
    content: ""; position: absolute;
    top: 50%; left: 55%;
    transform: translate(-50%, -50%);
    border-style: solid; border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent #fff;
}

/* FACILITIES SPLIT LAYOUT */
.split-layout {
    display: flex;
    align-items: center;
    gap: 50px;
    margin-bottom: 60px;
}

.split-layout.reverse {
    flex-direction: row-reverse;
}

.facility-info { flex: 1; }
.facility-image { flex: 1; }
.facility-info h2 { font-size: 2.5rem; margin-bottom: 20px; color: var(--accent); }
.facility-info p { margin-bottom: 15px; color: var(--text-muted); }

/* EQUIPMENT LIST */
.equipment-section {
    margin-top: 60px;
}
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 30px;
}
.equipment-category {
    background-color: var(--bg-light);
    padding: 30px;
    border-radius: 8px;
    border-top: 3px solid var(--accent);
}
.equipment-category h3 {
    color: var(--accent);
    margin-bottom: 20px;
    text-transform: uppercase;
    font-size: 1.2rem;
    letter-spacing: 1px;
}
.equipment-category ul {
    list-style-type: none;
}
.equipment-category li {
    position: relative;
    padding-left: 15px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.equipment-category li::before {
    content: "•";
    color: var(--accent);
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
}

/* SERVICES GRID */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: var(--bg-light);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.service-card h3 {
    color: var(--accent);
    margin-bottom: 15px;
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 10px;
}

/* HIGHLIGHT BANNER (INTERCONEXIÓN) */
.highlight-banner {
    background-color: var(--bg-light);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-top: 60px;
    border-top: 3px solid var(--accent);
}
.highlight-banner p {
    font-size: 1.05rem;
    max-width: 800px;
    margin: 0 auto;
}

.service-card li {
    color: var(--text-muted);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

/* LOCATION & CTA */
.location-cta {
    background-color: var(--bg-light);
}

/* CONTACT PAGE */
.contact-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 50px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.contact-item .whatsapp-link {
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.contact-item .whatsapp-link:hover { transform: scale(1.15); }
.contact-item .whatsapp-icon { width: 30px; height: 30px; color: #25D366; }

/* FOOTER */
footer {
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid #e0e0e0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* RESPONSIVE TABLET */
@media (max-width: 950px) {
    .video-gallery { grid-template-columns: repeat(2, 1fr); }
}

/* RESPONSIVE DESIGN (Mobile adjustments) */
@media (max-width: 768px) {
    .split-layout, .split-layout.reverse { flex-direction: column; }
    
    .video-gallery {
        grid-template-columns: 1fr;
    }
    
    .main-nav {
        display: none;
        width: 100%;
        position: absolute;
        top: 80px;
        left: 0;
        background-color: var(--bg-light);
        padding: 20px 0;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .main-nav.active { display: block; }
    .main-nav > ul { flex-direction: column; align-items: center; }
    .mobile-toggle { display: block; }
    
    .hero h1 { font-size: 2.5rem; }
}