@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Barlow:wght@300;400;500;600&display=swap');

:root {
    --color-primary: #E34234;
    --color-primary-dark: #b5301f;
    --color-dark: #111111;
    --color-mid: #555555;
    --color-light: #f0f0f0;
    --color-white: #ffffff;
    --header-height: 70px;
    --drawer-width: 300px;
    --transition: 0.4s cubic-bezier(0.77, 0, 0.175, 1);
}

/* RESET */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Barlow', sans-serif;
    background: var(--color-light);
    color: var(--color-dark);
    overflow-x: hidden;
}

/* ══════════════════════════════════════
   HEADER
══════════════════════════════════════ */
header {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--color-white);
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
    z-index: 1000;
    transition: box-shadow 0.3s;
}

header.scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.header-container {
    width: 100%;
    max-width: 1200px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
}

/* LOGO */
.brand-group {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 50%;
}

.brand-text {
    display: flex;
    align-items: baseline;
    gap: 0;
    line-height: 1;
}

.rojas {
    font-family: 'Barlow', sans-serif;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #D94A3F;
}

.tecni {
    font-family: 'Barlow', sans-serif;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #918989;
}

.cad {
    font-family: 'Barlow', sans-serif;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #4E4E4E;
}

/* ══════════════════════════════════════
   NAV DESKTOP
══════════════════════════════════════ */
.nav-wrapper {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-menu ul {
    display: flex;
    gap: 4px;
    list-style: none;
}

.nav-menu a {
    position: relative;
    text-decoration: none;
    color: var(--color-mid);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 6px 12px;
    transition: color 0.25s;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 12px;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

.nav-menu a:hover {
    color: var(--color-dark);
}

.nav-menu a:hover::after {
    width: calc(100% - 24px);
}

/* BOTÓN LOGIN */
.btn-login {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: linear-gradient(135deg, #111111 0%, #050505 100%);
    color: #f3e9e7;
    text-decoration: none;
    font-family: 'Barlow', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid rgba(217, 74, 63, 0.6);
    border-radius: 16px;
    transition: background 0.25s, border-color 0.25s, transform 0.25s, box-shadow 0.25s;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.btn-login::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #D94A3F;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    flex-shrink: 0;
}

.btn-login::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: #D94A3F;
    transition: width 0.25s;
}

.btn-login:hover {
    background: linear-gradient(135deg, #171313 0%, #090909 100%);
    border-color: rgba(217, 74, 63, 0.85);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.16);
}

.btn-login:hover::after {
    width: 5px;
}

/* ══════════════════════════════════════
   HAMBURGUESA
══════════════════════════════════════ */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    padding: 4px;
    z-index: 1100;
}

.menu-toggle span {
    display: block;
    height: 2px;
    background: var(--color-dark);
    border-radius: 2px;
    transition: var(--transition);
    transform-origin: center;
}

/* Animación X al abrir */
.menu-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.menu-toggle.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.menu-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ══════════════════════════════════════
   OVERLAY
══════════════════════════════════════ */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    z-index: 900;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ══════════════════════════════════════
   MAIN / CARRUSEL
══════════════════════════════════════ */
main {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 0 40px;
}

.carousel-section {
    width: 100%;
    max-width: 1200px;
    margin: auto;
    padding: 0 24px;
}

.carousel-container {
    display: grid;
    grid-template-columns: 1fr 2.2fr 1fr;
    gap: 0;
    background: var(--color-white);
    border-radius: 18px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* PANEL LATERAL */
.side-bar {
    padding: 36px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--color-white);
}

.side-bar:first-child {
    border-right: 1px solid #eee;
}

.side-bar:last-child {
    border-left: 1px solid #eee;
}

#nombre-imagen {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 28px;
    letter-spacing: 2px;
    color: var(--color-dark);
    line-height: 1.1;
    margin-bottom: 12px;
}

#nombre-imagen::before {
    content: '';
    display: block;
    width: 30px;
    height: 3px;
    background: var(--color-primary);
    margin-bottom: 14px;
}

#descripcion-imagen {
    font-size: 14px;
    font-weight: 300;
    color: var(--color-mid);
    line-height: 1.7;
}

/* IMAGEN CENTRAL */
.image-center {
    position: relative;
    aspect-ratio: 16/9;
    background: #111;
    overflow: hidden;
}

.carousel-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
    transform: scale(1.03);
}

.carousel-img.active {
    opacity: 1;
    transform: scale(1);
}

/* INDICADORES */
.indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.dot.active-dot {
    background: var(--color-primary);
    transform: scale(1.3);
}

/* BARRA DE PROGRESO */
.progress-bar-wrap {
    height: 3px;
    background: #eee;
    margin-top: 14px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--color-primary);
    width: 0%;
    transition: width linear;
}

/* ══════════════════════════════════════
   MOBILE  ≤ 900px
══════════════════════════════════════ */
@media (max-width: 900px) {

    .menu-toggle {
        display: flex;
    }

    /* ── DRAWER ── */
    .nav-wrapper {
        position: fixed;
        top: 0;
        right: 0;
        width: var(--drawer-width);
        height: 100dvh;
        background: var(--color-white);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: calc(var(--header-height) + 20px) 0 40px;
        transform: translateX(100%);
        transition: transform var(--transition);
        z-index: 1001;
        box-shadow: -8px 0 30px rgba(0,0,0,0.12);
        overflow-y: auto;
    }

    .nav-wrapper.active {
        transform: translateX(0);
    }

    /* Franja roja decorativa en el drawer */
    .nav-wrapper::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 4px;
        height: 100%;
        background: var(--color-primary);
    }

    /* Logo dentro del drawer */
    .drawer-brand {
        display: flex !important;
        align-items: center;
        gap: 10px;
        padding: 0 28px 28px;
        border-bottom: 1px solid #eee;
        margin-bottom: 16px;
        width: 100%;
    }

    .drawer-brand .rojas  { font-size: 20px; }
    .drawer-brand .tecnicad { font-size: 10px; }

    /* Links del menú */
    .nav-menu { width: 100%; }

    .nav-menu ul {
        flex-direction: column;
        gap: 0;
        align-items: flex-start;
    }

    .nav-menu ul li {
        width: 100%;
    }

    .nav-menu a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 15px 28px;
        font-size: 14px;
        letter-spacing: 2px;
        color: var(--color-dark);
        border-bottom: 1px solid #f5f5f5;
        transition: background 0.2s, color 0.2s, padding-left 0.2s;
    }

    .nav-menu a::after { display: none; }

    .nav-menu a:hover {
        background: #fef5f4;
        color: var(--color-primary);
        padding-left: 36px;
    }

    /* Ícono por ítem (usando data-icon) */
    .nav-menu a[data-icon]::before {
        content: attr(data-icon);
        font-style: normal;
        font-size: 16px;
        opacity: 0.5;
    }

    .btn-login {
        margin: 28px 28px 0;
        display: inline-block;
        text-align: center;
    }

    /* ── CARRUSEL MOBILE ── */
    .carousel-container {
        grid-template-columns: 1fr;
    }

    /* Nombre arriba */
    .side-bar:first-child {
        border-right: none;
        border-bottom: 1px solid #eee;
        order: 1;
    }

    /* Imagen en el medio */
    .image-center { order: 2; }

    /* Descripción abajo */
    .side-bar:last-child {
        border-left: none;
        border-top: 1px solid #eee;
        order: 3;
    }

    #nombre-imagen { font-size: 22px; }
}

/* ══════════════════════════════════════
   UTILIDADES OCULTAS EN DESKTOP
══════════════════════════════════════ */
.drawer-brand { display: none; }

/* ══════════════════════════════════════
   FRANJA TÉCNICA / INSTITUCIONAL
══════════════════════════════════════ */
.tech-stats-section {
    width: 100%;
    max-width: 1200px;
    margin: 36px auto 0;
    padding: 0 24px;
}

.tech-stats-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 13px;
    letter-spacing: 4px;
    color: var(--color-mid);
    text-transform: uppercase;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tech-stats-title::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 2px;
    background: var(--color-primary);
}

.tech-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.tech-stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px 22px;
    background: var(--color-dark);
    color: var(--color-white);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.tech-stat::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(227, 66, 52, 0.16), transparent 55%);
    pointer-events: none;
}

.tech-stat-icon {
    width: 26px;
    height: 26px;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.tech-stat strong {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.2rem;
    letter-spacing: 1px;
    line-height: 1;
}

.tech-stat-text {
    font-family: 'Barlow', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.tech-stat span {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 900px) {
    .tech-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════════
   SECCIÓN VIDEOS
══════════════════════════════════════ */
.videos-section {
    width: 100%;
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 0 24px;
}

.videos-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 13px;
    letter-spacing: 4px;
    color: var(--color-mid);
    text-transform: uppercase;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.videos-title::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 2px;
    background: var(--color-primary);
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.video-card {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    background: var(--color-dark);
    border-radius: 16px;
    text-decoration: none;
}

.video-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 50%);
    z-index: 1;
    transition: opacity 0.3s;
}

.video-card:hover::after {
    opacity: 0.5;
}

.video-card video {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.video-card:hover video {
    transform: scale(1.04);
}

/* Ícono play */
.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: opacity 0.3s, transform 0.3s, background 0.3s;
    backdrop-filter: blur(4px);
}

.video-play-icon svg {
    width: 16px;
    height: 16px;
    fill: white;
    margin-left: 3px;
}

.video-card:hover .video-play-icon {
    opacity: 0;
    transform: translate(-50%, -60%) scale(0.8);
}

/* Info inferior */
.video-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 18px;
    z-index: 2;
    transition: transform 0.3s ease;
}

.video-info-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.video-info-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px;
    letter-spacing: 1.5px;
    color: white;
    line-height: 1.1;
}

/* Badge "VER MÁS" al hover */
.video-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--color-primary);
    color: white;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 5px 10px;
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
    z-index: 3;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.3s, transform 0.3s;
}

.video-card:hover .video-badge {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile videos */
@media (max-width: 900px) {
    .videos-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   CARRUSEL INFERIOR CONTINUO
   ========================================================= */
.gallery-band-section {
    width: 100%;
    max-width: none;
    margin: 34px 0 0;
    padding: 0 0 32px;
}

.gallery-band-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 13px;
    letter-spacing: 4px;
    color: var(--color-mid);
    text-transform: uppercase;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 1200px;
    padding: 0 24px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-band-title::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 2px;
    background: var(--color-primary);
}

.gallery-band {
    width: 100%;
    overflow: hidden;
    border-top: 1px solid #e7e7e7;
    border-bottom: 1px solid #e7e7e7;
    background: #f8f8f8;
}

.gallery-track {
    display: flex;
    width: max-content;
    animation: gallery-scroll 28s linear infinite;
}

.gallery-card {
    position: relative;
    flex: 0 0 calc(100vw / 6);
    max-width: calc(100vw / 6);
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    background: #111;
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(0.92) contrast(1.04);
    transform: scale(1.02);
}

.gallery-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 65%);
}

.gallery-card span {
    position: absolute;
    left: 12px;
    bottom: 10px;
    z-index: 1;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

@keyframes gallery-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@media (max-width: 1100px) {
    .gallery-card {
        flex-basis: calc(100vw / 4);
        max-width: calc(100vw / 4);
    }
}

@media (max-width: 700px) {
    .gallery-card {
        flex-basis: calc(100vw / 2);
        max-width: calc(100vw / 2);
    }

    .gallery-track {
        animation-duration: 18s;
    }
}
