/* Estilos del carrusel - COMPONENTE INDEPENDIENTE */
.carrusel-container {
    padding: 60px 0;
    background-color: #f8f9fa;
    margin: 40px 0;
}

.carrusel-section .section-title {
    text-align: center;
    margin-bottom: 40px;
}

.carrusel-section .section-title h2 {
    font-size: 2.2rem;
    color: #2c3e50;
    font-weight: 700;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.carrusel-section .section-title h2:after {
    content: '';
    position: absolute;
    width: 60px;
    height: 3px;
    background: #28a745;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.carrusel-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 50px;
}

.carrusel {
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    height: 450px;
    /* Altura fija de 450px */
}

.carrusel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
}

.carrusel-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
}

.carrusel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Para que las imágenes se ajusten manteniendo proporción */
    object-position: center;
}

.carrusel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 20px;
    text-align: center;
}

.carrusel-caption h3 {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.carrusel-caption p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
}

/* Flechas de navegación */
.carrusel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.carrusel-btn:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 5px 15px rgba(137, 137, 137, 0.3);
}

.carrusel-btn i {
    font-size: 1.5rem;
    color: #333;
}

.carrusel-prev {
    left: 0;
}

.carrusel-next {
    right: 0;
}

/* Indicadores */
.carrusel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.carrusel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: rgba(48, 214, 6, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carrusel-indicator.active {
    background: white;
    transform: scale(1.2);
}

.carrusel-indicator:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* Responsive */
@media (max-width: 768px) {
    .carrusel-wrapper {
        padding: 0 40px;
    }

    .carrusel {
        height: 350px;
    }

    .carrusel-section .section-title h2 {
        font-size: 1.8rem;
    }

    .carrusel-caption {
        padding: 15px;
    }

    .carrusel-caption h3 {
        font-size: 1.2rem;
    }

    .carrusel-caption p {
        font-size: 0.9rem;
    }

    .carrusel-btn {
        width: 40px;
        height: 40px;
    }

    .carrusel-btn i {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .carrusel-wrapper {
        padding: 0 35px;
    }

    .carrusel {
        height: 250px;
    }

    .carrusel-section .section-title h2 {
        font-size: 1.5rem;
    }

    .carrusel-caption h3 {
        font-size: 1rem;
    }

    .carrusel-caption p {
        font-size: 0.8rem;
    }

    .carrusel-btn {
        width: 35px;
        height: 35px;
    }

    .carrusel-btn i {
        font-size: 1rem;
    }

    .carrusel-indicator {
        width: 10px;
        height: 10px;
    }
}

/* DEBUG removed: outline was temporary and has been deleted */

/* FORCE: reglas más firmes para asegurar ancho y posicionamiento dentro del contenedor
   - Estas reglas usan !important temporalmente para vencer estilos heredados/conflictos
   - Si confirman que funciona, podemos limpiar y remover !important */
.carrusel-wrapper {
    display: block !important;
    width: calc(100% - 24px) !important; /* respeta padding lateral pequeño */
    max-width: none !important;
    padding: 0 12px !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
}

.carrusel {
    width: 100% !important;
    max-width: none !important;
    position: relative !important;
}

.carrusel-prev { left: 12px !important; right: auto !important; }
.carrusel-next { right: 12px !important; left: auto !important; }

/* Si después de probar esto se soluciona, quitaré los !important y el outline */

/* MOBILE: clase específica para full-width sin cambiar flujo vertical
   - Aplicar la clase `.carrusel-fullwidth` en móviles hará que el wrapper
     use 100vw y se centre en el viewport, pero mantenga su posición vertical
     dentro del documento. Esto evita fijarlo en top:0 y evita placeholders. */
@media (max-width: 576px) {
    .carrusel-fullwidth {
        width: 100vw !important;
        max-width: none !important;
        position: relative !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        padding: 0 12px !important;
        box-sizing: border-box !important;
        z-index: 1000 !important;
    }

    .carrusel-fullwidth .carrusel {
        width: calc(100% - 24px) !important;
        max-width: none !important;
        margin: 0 auto !important;
        height: 260px !important;
    }

    .carrusel-fullwidth .carrusel-prev { left: 12px !important; }
    .carrusel-fullwidth .carrusel-next { right: 12px !important; }
}

/* Fixed-overlay helper: cuando en móvil queremos que el carrusel se superponga
   al resto de la página, JS añadirá la clase `.carrusel-fixed` al wrapper.
   La clase usa position:fixed y width:100vw para cubrir todo el viewport. */
.carrusel-fixed {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important; /* JS ajustará el top real inline para fijarlo en su posición */
    width: 100vw !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 12px !important;
    box-sizing: border-box !important;
    z-index: 10000 !important;
}

.carrusel-fixed .carrusel {
    width: calc(100% - 24px) !important;
    max-width: none !important;
}