/* static/css/home.css */

/* ===== CARRUSEL MODERNO ===== */
.hero-carousel {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    aspect-ratio: 16 / 9;
    max-height: 85vh;
    min-height: 400px;
    margin-bottom: 5em;
    overflow: hidden;
    background-color: var(--negro);
    border-top: 1px solid rgba(192, 8, 18, 0.3);
    border-bottom: 1px solid rgba(192, 8, 18, 0.3);
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-in-out, visibility 1s;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 85%;
    opacity: 1;
    will-change: transform;
}

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

.carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(10, 10, 10, 0.9) 0%, rgba(10, 10, 10, 0.2) 50%, transparent 100%);
    z-index: 3;
}

/* Textos del Carrusel Limpios y Agresivos */
.slide-content {
    position: absolute;
    bottom: 20%;
    left: 10%;
    z-index: 10;
    max-width: 700px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.8s ease 0.3s;
}

.carousel-slide.active .slide-content {
    transform: translateY(0);
    opacity: 1;
}

.slide-title {
    font-size: 5rem;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--blanco);
    letter-spacing: 2px;
    line-height: 1;
    margin-bottom: 0.5rem;
    text-shadow: 2px 4px 10px rgba(0, 0, 0, 0.8);
}

.slide-subtitle {
    font-size: 1.5rem;
    color: var(--gris-texto);
    text-transform: uppercase;
    letter-spacing: 5px;
    margin-bottom: 2rem;
    font-weight: 400;
}

.slide-subtitle span {
    color: var(--rojo-rvm);
    font-weight: 800;
}

.slide-btn {
    display: inline-block;
    padding: 1rem 3rem;
    background: var(--rojo-rvm);
    color: var(--blanco);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.slide-btn:hover {
    background: var(--rojo-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(192, 8, 18, 0.4);
}

.carousel-indicators {
    position: absolute;
    bottom: 40px;
    left: 10%;
    display: flex;
    gap: 10px;
    z-index: 20;
}

.indicator {
    width: 40px;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.indicator.active {
    background: var(--rojo-rvm);
    width: 60px;
}

/* ===== FLECHAS DEL CARRUSEL ===== */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10, 10, 10, 0.4);
    color: var(--blanco);
    border: none;
    font-size: 2rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
    border-radius: 4px;
    backdrop-filter: blur(5px);
}

.carousel-arrow:hover {
    background: var(--rojo-rvm);
    transform: translateY(-50%) scale(1.1);
}

.carousel-arrow.prev {
    left: 20px;
}

.carousel-arrow.next {
    right: 20px;
}

/* ===== SECCIONES Y TARJETAS (BANNERS PREMIUM DIAGONAL) ===== */
.section-wrapper {
    padding: 0 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.category-section {
    margin-bottom: 6em;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.category-title {
    font-size: 2.5rem;
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.category-title::before {
    content: '';
    display: block;
    width: 12px;
    height: 25px;
    background-color: var(--rojo-rvm);
}

/* 👇 SOLUCIÓN AL COLOR AZUL/VIOLETA 👇 */
.category-title a {
    color: #ffffff !important;
    text-decoration: none;
    transition: color 0.3s;
}

.category-title a:hover {
    color: var(--rojo-rvm) !important;
}

/* 👇 DISEÑO EN PILA VERTICAL 👇 */
.subcategory-grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.subcategory-card {
    position: relative;
    height: 380px;
    overflow: hidden;
    border-radius: 4px;
    display: flex;
    flex-direction: row;
    align-items: center;
    text-decoration: none;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: none;
}

.subcategory-card:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

/* 👇 Lado Izquierdo: Bloque oscuro con CORTE DIAGONAL 👇 */
.subcategory-overlay {
    flex: 0 0 42%;
    height: 100%;
    background: linear-gradient(135deg, #111 0%, #000 100%);
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    z-index: 2;
    clip-path: polygon(0 0, 100% 0, 85% 100%, 0 100%);
    border-left: 4px solid var(--rojo-rvm);
    transition: all 0.5s ease;
}

.subcategory-card:hover .subcategory-overlay {
    background: linear-gradient(135deg, #1a1a1a 0%, #050505 100%);
    padding-left: 4.5rem;
}

.subcategory-name {
    color: #ffffff;
    font-size: 3.2rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.subcategory-explore-btn {
    color: var(--rojo-rvm);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.95rem;
    transition: transform 0.3s ease;
    margin-top: 1rem;
}

.subcategory-card:hover .subcategory-explore-btn {
    transform: translateX(10px);
}

/* 👇 Lado Derecho: Contenedor gigante para la moto 👇 */
.subcategory-img-container {
    flex: 1;
    height: 100%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: -10%;
    padding: 2rem 3rem 2rem 12%;
}

.subcategory-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    transform-origin: center right;
}

.subcategory-card:hover .subcategory-img {
    transform: scale(1.08) translateX(-15px);
}

@media (max-width: 992px) {
    .subcategory-card {
        flex-direction: column;
        height: auto;
        min-height: 450px;
    }

    .subcategory-overlay {
        flex: none;
        width: 100%;
        height: auto;
        clip-path: none;
        padding: 2.5rem;
        align-items: center;
        text-align: center;
        border-left: none;
        border-top: 4px solid var(--rojo-rvm);
    }

    .subcategory-card:hover .subcategory-overlay {
        padding-left: 2.5rem;
    }

    .subcategory-name {
        font-size: 2.2rem;
    }

    .subcategory-img-container {
        flex: none;
        width: 100%;
        height: 300px;
        margin-left: 0;
        padding: 1.5rem;
    }

    .subcategory-card:hover .subcategory-img {
        transform: scale(1.05);
    }
}

/* ===== MAPA DE UBICACIÓN ===== */
.map-section {
    margin-top: 6em;
    margin-bottom: 2em;
}

.map-container {
    width: 100%;
    height: 450px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    filter: grayscale(80%) contrast(1.2) invert(90%) hue-rotate(180deg);
    transition: filter 0.5s ease;
}

.map-container:hover iframe {
    filter: grayscale(20%) contrast(1);
}

/* ===== ANIMACIONES AL HACER SCROLL ===== */
.reveal-up {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    will-change: opacity, transform;
}

.reveal-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Efecto cascada (stagger) para tarjetas */
.subcategory-card.reveal-up {
    transition-delay: calc(var(--delay) * 150ms);
}

/* ===== BANNERS EXTREME / RACING ===== */
.extreme-banner {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding: 6rem 2rem;
    background: linear-gradient(135deg, #111 0%, #050505 100%);
    position: relative;
    overflow: hidden;
    margin-bottom: 6em;
    border-top: 2px solid rgba(255, 255, 255, 0.05);
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
}

/* Líneas diagonales rojas (Efecto velocidad) */
.extreme-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 200%;
    background: rgba(192, 8, 18, 0.05);
    transform: rotate(35deg);
    border-left: 2px solid var(--rojo-rvm);
    z-index: 0;
}

.banner-content {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.banner-text-side {
    flex: 1;
}

.banner-title {
    font-size: 3.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.banner-title span {
    color: var(--rojo-rvm);
}

.banner-desc {
    font-size: 1.1rem;
    color: #aaa;
    margin-bottom: 2.5rem;
    max-width: 600px;
}

/* Botón inclinado estilo competición */
.btn-racing {
    display: inline-block;
    padding: 1rem 3rem;
    background: var(--rojo-rvm);
    color: var(--blanco);
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 2px;
    text-decoration: none;
    transform: skewX(-15deg);
    transition: all 0.3s ease;
}

.btn-racing span {
    display: inline-block;
    transform: skewX(15deg);
}

.btn-racing:hover {
    background: var(--blanco);
    color: var(--rojo-rvm);
    box-shadow: 0 10px 30px rgba(192, 8, 18, 0.3);
}

.banner-stats {
    flex: 1;
    display: flex;
    gap: 3rem;
    justify-content: center;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 4rem;
    font-weight: 900;
    color: var(--blanco);
    text-shadow: 0 0 20px rgba(192, 8, 18, 0.4);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--rojo-rvm);
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
}

@media (max-width: 768px) {
    .banner-content {
        flex-direction: column;
        text-align: center;
    }

    .banner-stats {
        flex-wrap: wrap;
        justify-content: center;
    }

    .extreme-banner::before {
        display: none;
    }

    .banner-title {
        font-size: 2.5rem;
    }
}

/* ===== BENEFICIOS Y FINANCIACIÓN (OPCIÓN 2) ===== */
.benefits-section {
    padding: 4rem 2rem;
    background: linear-gradient(to bottom, #0a0a0a, #111);
    margin-bottom: 6em;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.benefits-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
}

@media (min-width: 576px) {
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .benefits-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

.benefit-item {
    text-align: center;
    padding: 3rem 2rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.benefit-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--rojo-rvm);
    transition: width 0.4s ease;
}

.benefit-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(192, 8, 18, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.benefit-item:hover::before {
    width: 100%;
}

.benefit-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(192, 8, 18, 0.05);
    border-radius: 50%;
    color: var(--rojo-rvm);
    transition: all 0.4s ease;
}

.benefit-item:hover .benefit-icon {
    background: var(--rojo-rvm);
    color: var(--blanco);
    transform: scale(1.1) rotate(5deg);
}

.benefit-title {
    color: var(--blanco);
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

.benefit-desc {
    color: #888;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Efectos Premium Extra */
.subcategory-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 40%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.35) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    z-index: 10;
    pointer-events: none;
}

.subcategory-card:hover::after {
    animation: premiumShine 0.75s ease-out forwards;
}

@keyframes premiumShine {
    0% {
        left: -150%;
    }

    100% {
        left: 200%;
    }
}

.subcategory-name,
.subcategory-explore-btn {
    transition: text-shadow 0.4s ease, transform 0.4s ease, color 0.4s ease;
}

.subcategory-card:hover .subcategory-name {
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

.subcategory-card:hover .subcategory-explore-btn {
    text-shadow: 0 0 12px rgba(192, 8, 18, 0.7);
}


/* =========================================================
   CONTROL TOTAL DEL TALLER (PC Y MÓVIL)
   ========================================================= */

/* 1. DISEÑO PARA PC (Reemplaza al style incrustado que borramos) */
.taller-content {
    flex-direction: row-reverse !important;
    /* Foto izquierda, texto derecha */
    align-items: center !important;
}

/* 2. DISEÑO PARA CELULARES (La magia que no funcionaba) */
@media (max-width: 1024px) {
    .taller-content {
        flex-direction: column-reverse !important;
        /* FOTO ARRIBA, TEXTO ABAJO */
        text-align: center !important;
        padding: 2rem 1rem !important;
        gap: 2rem !important;
    }

    .taller-content .banner-stats {
        width: 100% !important;
        margin-bottom: 0 !important;
        display: block !important;
    }

    .taller-content .banner-stats img {
        width: 100% !important;
        max-height: 250px !important;
        object-fit: cover !important;
        transform: none !important;
        /* Anulamos el movimiento hover en móvil */
    }

    .taller-content .banner-text-side {
        width: 100% !important;
    }

    .taller-content ul {
        display: inline-block !important;
        text-align: left !important;
        margin: 0 auto 2rem auto !important;
        padding: 0 !important;
    }
}

/* =========================================================
   CARRUSEL: SOLUCIÓN DEFINITIVA PARA MÓVILES (IMAGEN COMPLETA)
   ========================================================= */
@media (max-width: 768px) {
    .hero-carousel {
        height: 65vh; /* Lo hacemos un poco menos alto para que quede proporcionado */
        min-height: 480px;
        background-color: #050505 !important; /* Fondo negro sólido detrás de la foto */
    }

    /* 1. MAGIA: Mostramos la foto entera sin recortar y la pegamos arriba */
    .carousel-slide img {
        object-fit: contain !important; 
        object-position: center 10% !important; /* La sube para dejar espacio al texto abajo */
    }

    /* 2. Oscurecemos solo la parte de abajo donde va el texto */
    .carousel-overlay {
        background: linear-gradient(to top, rgba(5, 5, 5, 1) 0%, rgba(5, 5, 5, 0.95) 45%, transparent 80%) !important;
    }

    /* 3. Textos centrados en la parte oscura inferior */
    .slide-content {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        bottom: 8% !important; 
        padding: 0 10% !important; 
    }

    /* 4. Tipografías ajustadas */
    .slide-title {
        font-size: 2.2rem !important; 
        margin-bottom: 0.5rem;
        line-height: 1.1 !important;
    }

    .slide-subtitle {
        font-size: 0.9rem !important;
        margin-bottom: 0.8rem !important;
    }

    .slide-content p {
        font-size: 0.85rem !important; 
        line-height: 1.4 !important;
        margin-bottom: 1.5rem !important;
        color: #ddd !important; /* Un gris más claro para que resalte más */
    }

    /* 5. Botón y flechas */
    .slide-btn {
        padding: 0.8rem 1.5rem !important;
        font-size: 0.8rem !important;
    }

    .carousel-arrow {
        font-size: 1.2rem !important; 
        padding: 0.5rem 0.7rem !important;
        background: rgba(10, 10, 10, 0.4) !important;
        border-radius: 50% !important; 
        top: 30% !important; /* Subimos las flechas para que queden al lado de la moto, no del texto */
    }

    .carousel-arrow.prev { left: 5px !important; }
    .carousel-arrow.next { right: 5px !important; }

    .carousel-indicators {
        left: 0;
        width: 100%;
        transform: none;
        justify-content: center;
        bottom: 10px;
    }
}