/* =================================================
   ESTILOS MEJORADOS PARA HERO SECTION
   Texto centrado con estilo elegante
   ================================================= */

.header {
    position: relative;
    height: 100vh;
    min-height: 700px;
    max-height: 1200px;
    background: linear-gradient(135deg, 
                rgba(26, 75, 140, 0.85) 0%, 
                rgba(42, 110, 219, 0.85) 100%), 
                url('https://res.cloudinary.com/dhij6pjjp/image/upload/v1752012695/motoresyaccesorios_txenog.webp') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
    margin-top: 82px;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, 
                rgba(255,255,255,0.1) 0%, 
                rgba(255,255,255,0) 70%);
    z-index: 1;
}

.header-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 0 2rem;
    transform: translateY(20px);
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.3s forwards;
}

/* Título principal */
.header h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1.1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
    font-family: 'Montserrat', sans-serif;
    color: #fff;
}

.header h1 p {
    display: block;
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-top: 0.5rem;
    background: linear-gradient(90deg, #f5a623, #ffc107);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    position: relative;
}

.header h1 p::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, #f5a623, #ffc107);
    border-radius: 3px;
}

/* Subtítulo - Tecnología de punta... */
.header .subtitle {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.95;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
    line-height: 1.6;
    letter-spacing: 0.3px;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    display: inline-block;
    backdrop-filter: blur(5px);
}

/* Botón CTA */
.btn-cta {
    display: inline-block;
    padding: 18px 42px;
    background: linear-gradient(135deg, var(--success-color), #044e15);
    color: white;
    font-weight: 700;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 0 10px 30px rgba(13, 192, 102, 0.4);
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    z-index: 1;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e6951a, var(--accent-color));
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
}

.btn-cta:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(245, 166, 35, 0.6);
    color: white;
    text-decoration: none;
}

.btn-cta:hover::before {
    opacity: 1;
}

/* Indicador de scroll */
.header-scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: bounce 2s infinite;
}

.header-scroll-indicator span {
    display: block;
    width: 24px;
    height: 40px;
    border: 2px solid white;
    border-radius: 12px;
    position: relative;
}

.header-scroll-indicator span::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: white;
    border-radius: 2px;
    animation: scrollIndicator 2s infinite;
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scrollIndicator {
    0% {
        opacity: 1;
        transform: translateY(0) translateX(-50%);
    }
    100% {
        opacity: 0;
        transform: translateY(20px) translateX(-50%);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-20px) translateX(-50%);
    }
    60% {
        transform: translateY(-10px) translateX(-50%);
    }
}

/* =================================================
   RESPONSIVE PARA HERO SECTION
   ================================================= */

@media (max-width: 992px) {
    .header h1 {
        font-size: 3.2rem;
    }
    
    .header h1 p {
        font-size: 2rem;
    }
    
    .header .subtitle {
        font-size: 1.2rem;
        padding: 0.6rem 1.2rem;
    }
    
    .btn-cta {
        padding: 15px 35px;
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .header {
        min-height: 600px;
        margin-top: 70px;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .header h1 p {
        font-size: 1.6rem;
    }
    
    .header .subtitle {
        font-size: 1rem;
        max-width: 90%;
        padding: 0.5rem 1rem;
    }
    
    .btn-cta {
        padding: 12px 28px;
        font-size: 0.9rem;
    }
    
    .header-scroll-indicator {
        bottom: 20px;
    }
}

@media (max-width: 576px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .header h1 p {
        font-size: 1.3rem;
        margin-top: 0.3rem;
    }
    
    .header h1 p::after {
        width: 70px;
        bottom: -7px;
    }
    
    .header .subtitle {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
        margin-bottom: 1.5rem;
    }
    
    .btn-cta {
        padding: 10px 24px;
        font-size: 0.85rem;
    }
}

/* Sección de accesorios */
.accesorios-showcase {
    background-color: var(--light-color);
    padding: 4rem 0 6rem;
    position: relative;
}

.accesorios-showcase .section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.accesorios-showcase .section-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.accesorios-showcase .section-header h2 span {
    color: var(--success-color);
}

.accesorios-showcase .section-header .subtitle {
    font-size: 1.1rem;
    color: var(--gray-medium);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Grid de accesorios - 4 columnas en desktop */
.accesorios-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 0;
}

/* Tarjetas de accesorio */
.accesorio-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    text-align: center;
}

.accesorio-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--box-shadow-hover);
}

.accesorio-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    padding: 1.2rem;
    margin: 0;
    background: white;
    border-bottom: 1px solid var(--gray-light);
}

/* Contenedor de imagen */
.img-container {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #0f172a;
}

.img-container img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.img-container:hover img {
    transform: scale(1.08);
}

/* Overlay desplegable */
.accesorio-overlay {
    background: var(--dark-color);
    color: white;
    padding: 0 1.2rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
}

.img-container:hover .accesorio-overlay {
    max-height: 280px;
    padding: 1.2rem;
}

.accesorio-overlay p {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 0.8rem;
    color: var(--gray-light);
}

.accesorio-overlay span {
    font-weight: bold;
    font-size: 1.2rem;
    display: block;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

/* Botón de compra */
.btn-accesorio {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    background: linear-gradient(135deg, var(--whatsapp-color), #128C7E);
    color: white;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-accesorio:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #128C7E, var(--whatsapp-color));
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* =================================================
   SECCIÓN DE MARCAS - CARRUSEL SUAVE CON ESQUINAS ELEGANTES
   ================================================= */

.brands-section {
    background: linear-gradient(135deg, var(--dark-color), #2c3e50);
    color: white;
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

/* Fondo decorativo */
.brands-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path fill="rgba(255,255,255,0.03)" d="M0,0 L100,0 L100,100 Q50,80 0,100 Z"/></svg>') bottom center/100% 20% no-repeat;
    pointer-events: none;
}

/* Header de la sección */
.brands-section .section-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    z-index: 2;
}

.brands-section .section-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gray-light);
    margin-bottom: 1rem;
}

.brands-section .section-header h2 span {
    color: var(--success-color);
    position: relative;
}

.brands-section .section-header .subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 700px;
    margin: 0 auto;
}

/* Contenedor principal del carrusel */
.brands-carousel-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 1rem 0;
    margin-top: 2rem;
}

/* Carrusel que se desplaza */
.brands-carousel {
    display: flex;
    gap: 2rem;
    animation: scrollLeft 30s linear infinite;
    width: max-content;
}

/* Pausar animación al hacer hover */
.brands-carousel-container:hover .brands-carousel {
    animation-play-state: paused;
}

/* Tarjetas de marcas - ESQUINAS ELEGANTES */
.brand-card {
    background: white;
    color: var(--dark-color);
    padding: 1.5rem;
    border-radius: 24px;
    text-align: center;
    transition: var(--transition);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    min-width: 220px;
    width: 220px;
    flex-shrink: 0;
    backdrop-filter: blur(0px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Efecto de borde superior elegante */
.brand-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color), var(--accent-color));
    transition: height 0.3s ease;
    border-radius: 24px 24px 0 0;
}

.brand-card:hover::before {
    height: 6px;
}

.brand-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.2);
}

/* Imágenes elegantes */
.brand-card img {
    max-height: 70px;
    width: auto;
    margin-bottom: 1rem;
    object-fit: contain;
    filter: grayscale(20%);
    opacity: 0.9;
    transition: all 0.4s ease;
}

.brand-card:hover img {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.08);
}

/* Títulos y descripciones */
.brand-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.brand-card p {
    font-size: 0.85rem;
    color: var(--gray-medium);
    line-height: 1.5;
    margin: 0;
}

/* Animación suave de derecha a izquierda */
@keyframes scrollLeft {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* =================================================
   RESPONSIVE DESIGN
   ================================================= */

/* Tablets y pantallas medianas */
@media (max-width: 1200px) {
    .accesorios-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.8rem;
    }
}

@media (max-width: 992px) {
    .accesorios-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.8rem;
    }
    
    .accesorio-card {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .accesorios-showcase {
        padding: 3rem 0 4rem;
    }
    
    .accesorios-showcase .section-header h2 {
        font-size: 2rem;
    }
    
    .accesorios-grid {
        gap: 1.5rem;
    }
    
    .img-container img {
        height: 210px;
    }
    
    .accesorio-card h3 {
        font-size: 1.3rem;
        padding: 1rem;
    }
    
    .accesorio-overlay p {
        font-size: 0.8rem;
    }
    
    .btn-accesorio {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
    
    /* Marcas responsive */
    .brands-section {
        padding: 4rem 0;
    }
    
    .brands-section .section-header h2 {
        font-size: 2rem;
    }
    
    .brands-section .section-header .subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .brand-card {
        min-width: 180px;
        width: 180px;
        padding: 1.2rem;
        border-radius: 20px;
    }
    
    .brand-card img {
        max-height: 55px;
        margin-bottom: 0.8rem;
    }
    
    .brand-card h3 {
        font-size: 1rem;
    }
    
    .brand-card p {
        font-size: 0.75rem;
        display: none;
    }
    
    .brands-carousel {
        gap: 1.2rem;
    }
}

@media (max-width: 576px) {
    .accesorios-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .accesorios-showcase .section-header h2 {
        font-size: 1.8rem;
    }
    
    .accesorios-showcase .section-header .subtitle {
        font-size: 1rem;
    }
    
    .img-container img {
        height: 190px;
    }
    
    .accesorio-overlay span {
        font-size: 1rem;
    }
    
    .brand-card {
        min-width: 150px;
        width: 150px;
        padding: 1rem;
        border-radius: 18px;
    }
    
    .brand-card img {
        max-height: 50px;
    }
    
    .brand-card h3 {
        font-size: 0.9rem;
    }
    
    .brands-carousel {
        gap: 1rem;
    }
}

/* Pantallas muy grandes */
@media (min-width: 1400px) {
    .accesorios-grid {
        gap: 2.5rem;
    }
    
    .brand-card {
        min-width: 260px;
        width: 260px;
        border-radius: 28px;
    }
    
    .brand-card img {
        max-height: 85px;
    }
}

/* =================================================
   ANIMACIONES DE SCROLL (A prueba de fallos)
   ================================================= */

/* Estado inicial: invisible y un poco más abajo */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    /* Aseguramos que el contenido no bloquee clicks si es invisible */
    pointer-events: none; 
}

/* Estado animado (clase inyectada por tu JS): visible y en su lugar */
.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Fallback de seguridad por si el JS tarda en cargar o falla */
@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll {
        transition: none;
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }
}