/* ============================================================
   BAJA SAE IBERO PUEBLA — style.css (limpio)
   ============================================================ */

/* --- VARIABLES --- */
:root {
    --color-primary: #ad0000;
    --color-dark:    #000000;
    --color-accent:  #342F29;
    --color-light:   #ffffff;

    body {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 400; /* Peso normal para texto corriente */
}

}


/* ============================================================
   GLOBAL
   ============================================================ */
html, body {
    overflow-y: auto    !important;
    overflow-x: hidden  !important;
    height: auto        !important; 
    display: block      !important;
}

.text-white {
    color: var(--color-light) !important;
}


/* ============================================================
   FONDO GENERAL
   ============================================================ */
.bg-custom-grey {
    background: linear-gradient(
        to bottom,
        var(--color-accent) 0%,
        #1a1a1a 70%,
        var(--color-dark) 100%
    ) !important;
    position: relative;
    overflow: hidden;
}

.bg-custom-grey::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}

.bg-custom-grey .container {
    position: relative;
    z-index: 1;
}


/* ============================================================
   NAVBAR
   ============================================================ */
.navbar-custom {
    background-color: transparent !important;
    backdrop-filter: blur(0px);
    transition: all 0.4s ease-in-out;
    border-bottom: 1px solid transparent;
}

.navbar-scrolled {
    background-color: rgba(173, 0, 0, 0.9) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

/* En páginas que NO son el home el navbar siempre es rojo */
body:not(.home-page) .navbar-custom {
    background-color: rgba(173, 0, 0, 0.9) !important;
    backdrop-filter: blur(10px);
}

.brand-title {
    color: var(--color-light) !important;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1.5rem;

    font-family: 'Barlow Condensed', sans-serif;
    letter-spacing: 3px;
    font-weight: 700;
}

.navbar-custom .nav-link {
    background-color: transparent !important;
    color: rgba(255,255,255) !important;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.95rem;
    letter-spacing: 1px;
    padding: 10px 15px !important;
    display: inline-block;
    border-bottom: 3px solid transparent !important;
    transition: transform 0.3s ease, border-bottom 0.3s ease, color 0.3s ease;

    font-family: 'Barlow Condensed', sans-serif;
    letter-spacing: 3px;
    font-weight: 700;
}

.navbar-custom .nav-link,
.brand-title,
.main-title,
h1, h2, h3, h4 {
    font-weight: 700;
}


.navbar-custom .nav-link:hover {
    color: #ffffff !important;
    transform: translateY(-5px);
    border-bottom: 3px solid #ffffff !important;
    background-color: transparent !important;
}

.navbar-custom .nav-link.active,
.nav-pills .nav-link.active {
    color: #ffffff !important;
    opacity: 1 !important;
    background-color: transparent !important;
    transform: translateY(0) !important;
    border-bottom: 3px solid #ffffff !important;
}

@media (max-width: 768px) {
    .navbar-collapse {
        background: rgba(0,0,0,0.95);
        padding: 20px;
        border-radius: 15px;
        margin-top: 15px;
        border: 1px solid rgba(255,255,255,0.1);
    }

    .navbar-custom .nav-link {
        text-align: center;
        padding: 15px !important;
        border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    }

    .main-title {
        font-size: 2.5rem !important;
    }

    .time-block span {
        font-size: 2rem !important;
    }
}


/* ============================================================
   ANIMACIONES DE REVELADO
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}


/* ============================================================
   HERO / VIDEO
   ============================================================ */
.hero-section {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 1 !important;
    transform: none !important;
}

.video-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%) scale(1);
    z-index: -2;
    object-fit: cover;
    object-position: center;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.7) 0%,
        rgba(0,0,0,0.2) 60%,
        var(--color-accent) 100%
    );
    z-index: -1;
}

.hero-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 1;
    color: white;
}

.main-title {
    font-size: 5rem;
    font-weight: 900;
}

.countdown-container {
    display: flex;
    gap: 20px;
    align-items: center;
}


/* ============================================================
   SECCIÓN EL VEHÍCULO (EXPLODED)
   ============================================================ */
.exploded-section {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    background-color: var(--color-dark) !important;
    display: flex;
    align-items: center;
    margin-top: -1px;
}

.video-bg-exploded {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    z-index: 1;
    object-fit: cover;
    object-position: center 30%;
}

.video-overlay-grad {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        var(--color-dark) 0%,
        rgba(0,0,0,0.5) 25%,
        rgba(0,0,0,0.5) 75%,
        var(--color-dark) 100%
    );
    z-index: 2;
    pointer-events: none;
}

.exploded-section .container {
    position: relative;
    z-index: 3;
}

.spec-label {
    color: var(--color-light) !important;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1.2rem;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.spec-text {
    color: var(--color-light);
    font-size: 1rem;
    opacity: 0.85;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

@media (max-width: 991px) {
    .exploded-section { height: auto; padding: 80px 0; }
    .spec-label { font-size: 1rem; }
    .spec-text  { font-size: 0.9rem; }
}


/* ============================================================
   CARRUSEL
   ============================================================ */
.carousel-img {
    height: 500px;
    object-fit: cover;
    filter: brightness(50%);
}

.custom-caption {
    background: rgba(0,0,0,0.4);
    padding: 2rem;
    border-radius: 15px;
    bottom: 20%;
}

.custom-caption h2 {
    font-size: 3rem !important;
}

@media (max-width: 768px) {
    .carousel-img          { height: 350px; }
    .custom-caption h2     { font-size: 1.5rem !important; }
    .custom-caption p      { font-size: 0.9rem; }
}


/* ============================================================
   PATROCINADORES
   ============================================================ */
#patrocinadores.bg-custom-grey {
    background: linear-gradient(
        to bottom,
        var(--color-dark) 0%,
        #1a1a1a 30%,
        var(--color-accent) 100%
    ) !important;
    margin-top: -1px;
}

.card-sponsor {
    position: relative;
    background: #1a1a1a;
    min-height: 350px;
    transition: transform 0.4s ease;
}

.card-bg-image {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(2px) brightness(0.4);
    z-index: 1;
    transition: 0.5s;
}

.card-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.8));
    z-index: 2;
}

.card-body-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.sponsor-logo {
    max-width: 80%;
    max-height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
    transition: 0.3s;
}

.card-sponsor:hover {
    transform: translateY(-10px);
}

.card-sponsor:hover .card-bg-image {
    transform: scale(1.1);
    filter: blur(0px) brightness(0.6);
}


/* ============================================================
   FORMULARIO DE CONTACTO
   ============================================================ */
.bg-dark-subtle-custom {
    background-color: rgba(30,30,30,0.6) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1) !important;
}

.form-control {
    background-color: #121212 !important;
    color: white !important;
    border-color: #444 !important;
}

.form-control:focus {
    background-color: #1a1a1a !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(173,0,0,0.25);
    color: white !important;
}

.form-floating > label {
    color: rgba(255,255,255,0.6);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--color-primary);
}


/* ============================================================
   BOTONES GLOBALES
   ============================================================ */
.btn-custom-red {
    background-color: var(--color-primary) !important;
    color: var(--color-light) !important;
    border: none;
    font-weight: bold;
    transition: 0.3s;
}

.btn-custom-red:hover {
    background-color: #8b0000 !important;
    color: white !important;
    transform: translateY(-3px);
}

.title-red {
    color: var(--color-primary) !important;
}


/* ============================================================
   MERCH
   ============================================================ */
.merch-page-container {
    padding-top: 130px !important;
    padding-bottom: 80px;
}

.merch-card {
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-width: 2px !important;
}

.merch-card:hover {
    transform: translateY(-15px);
    border-color: var(--color-primary) !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6) !important;
}

.merch-card:hover .merch-btn {
    background-color: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    color: white !important;
}

.merch-card:hover .card-header {
    background-color: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
}

.merch-card.featured {
    border-color: var(--color-primary) !important;
    transform: scale(1.05);
}

.merch-card.featured:hover {
    transform: scale(1.08) translateY(-10px);
}

.card-img-wrapper {
    height: 250px;
    overflow: hidden;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.merch-card:hover .card-img-wrapper img {
    transform: scale(1.1);
}


/* ============================================================
   EQUIPO (FLIP CARDS)
   ============================================================ */
.team-grid {
    perspective: 1000px;
}

.flip-card {
    background-color: transparent;
    height: 400px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    border-radius: 15px;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255,255,255,0.1);
}

.flip-card-front {
    background-color: #111;
    color: white;
}

.member-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 15px 15px 0 0;
    background-color: #222;
}

.flip-card-back {
    background-color: rgba(0,0,0,0.3);
    color: white;
    transform: rotateY(180deg);
    padding: 20px;
    justify-content: center;
    align-items: center;
}

.flip-card-back p {
    font-size: 0.9rem;
    line-height: 1.4;
}

.btn-contact {
    border: 1px solid white;
    color: white;
    background: transparent;
    transition: 0.3s;
    z-index: 10;
}

.btn-contact:hover {
    background: white;
    color: var(--color-primary);
}


/* ============================================================
   LÍNEA DEL TIEMPO
   ============================================================ */
.timeline-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 0;
}

.timeline-container::after {
    content: '';
    position: absolute;
    width: 3px;
    background-color: var(--color-primary);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1.5px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
    box-sizing: border-box;
}

.timeline-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: #ffffff;
    border: 4px solid var(--color-primary);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
    transition: 0.3s;
}

.timeline-item:nth-child(odd)  { left: 0;   text-align: right; }
.timeline-item:nth-child(even) { left: 50%; text-align: left;  }
.timeline-item:nth-child(even) .timeline-dot { left: -10px; }

.timeline-date {
    font-weight: 900;
    color: var(--color-primary);
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.timeline-content {
    padding: 20px;
    background-color: #111;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: white;
    transition: 0.3s;
}

.timeline-item:hover .timeline-content {
    border-color: var(--color-primary);
    transform: scale(1.02);
}

.timeline-item:hover .timeline-dot {
    background-color: var(--color-primary);
}

@media screen and (max-width: 768px) {
    .timeline-container::after { left: 31px; }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
        text-align: left !important;
    }

    .timeline-item:nth-child(even) { left: 0%; }
    .timeline-dot { left: 21px !important; }
}


/* ============================================================
   FOOTER
   ============================================================ */
.footer-custom {
    background-color: #7C1514 !important;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,0.1);
    width: 100%;
}

.footer-custom .text-white {
    opacity: 0.9;
    transition: 0.3s;
}

.ig-link:hover {
    opacity: 1 !important;
    transform: scale(1.05);
}