/**
 * Estilos para o Carousel da Home
 * NextLevel Theme - Mobile First & Responsivo
 */

/* ==========================================================================
   HERO CAROUSEL - CONTAINER E ESTRUTURA BASE
   ========================================================================== */

.hero-carousel {
    position: relative;
    overflow: hidden;
}

.carousel-section {
    position: relative;
    overflow: hidden;
}

/* ==========================================================================
   CAROUSEL ITEMS E TRANSIÇÕES
   ========================================================================== */

.carousel-item {
    position: relative;
    transition: transform 0.6s ease-in-out;
}

.carousel-item.active,
.carousel-item-next,
.carousel-item-prev {
    display: block;
}

/* Animações suaves */
.carousel-item-next.carousel-item-start,
.carousel-item-prev.carousel-item-end {
    transform: translateX(0);
}

.carousel-item-next,
.active.carousel-item-end {
    transform: translateX(100%);
}

.carousel-item-prev,
.active.carousel-item-start {
    transform: translateX(-100%);
}

/* ==========================================================================
   IMAGENS DO CAROUSEL
   ========================================================================== */

.carousel-image,
.carousel-item img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* ==========================================================================
   CAPTION STYLING - MOBILE FIRST
   ========================================================================== */

.hero-carousel .carousel-caption,
.carousel-caption {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: transparent !important;
    border-radius: 0.5rem;
    backdrop-filter: none;
    color: white;
    padding: 1rem;
    text-align: left;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

/* Títulos responsivos */
.hero-carousel .carousel-caption h5,
.hero-carousel .carousel-caption h1,
.hero-carousel .carousel-caption h2,
.hero-carousel .carousel-caption h3,
.hero-carousel .carousel-caption h4,
.carousel-caption h2 {
    font-size: 1.25rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

/* Texto de descrição */
.hero-carousel .carousel-caption p,
.carousel-caption p {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    opacity: 0.95;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

/* Links/botões no carousel */
.hero-carousel .carousel-caption a,
.carousel-caption .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    background: #007bff !important;
    color: white !important;
    border: 2px solid white !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

/* ==========================================================================
   CONTROLES DO CAROUSEL
   ========================================================================== */

.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover,
.carousel-control-prev:focus,
.carousel-control-next:focus {
    opacity: 1;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 2rem;
    height: 2rem;
    background-size: 100% 100%;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* ==========================================================================
   INDICADORES
   ========================================================================== */

.carousel-indicators {
    margin-bottom: 1rem;
}

.carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 4px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    background-color: rgba(255, 255, 255, 0.7);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.carousel-indicators .active {
    background-color: white;
    opacity: 1;
    transform: scale(1.2);
}

/* ==========================================================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ========================================================================== */

/* Mobile First - Smartphones (≤576px) */
@media (max-width: 576px) {
    .hero-carousel {
        margin-bottom: 2rem !important;
    }

    .hero-carousel .carousel-inner,
    .carousel-inner {
        height: 300px;
        overflow: hidden;
    }

    .hero-carousel .carousel-item img,
    .carousel-image,
    .carousel-item img {
        height: 300px;
        object-fit: cover;
        width: 100%;
    }

    .hero-carousel .carousel-caption,
    .carousel-caption {
        position: absolute !important;
        bottom: 2.5rem !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        padding: 0.75rem 1rem !important;
        text-align: center !important;
        background: transparent !important;
        border-radius: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        min-height: 70px !important;
        max-height: none !important;
        overflow: visible !important;
        margin: 0 !important;
    }

    .hero-carousel .carousel-caption h5,
    .hero-carousel .carousel-caption h1,
    .hero-carousel .carousel-caption h2,
    .hero-carousel .carousel-caption h3,
    .hero-carousel .carousel-caption h4,
    .carousel-caption h2 {
        font-size: 0.85rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.5rem !important;
        display: block !important;
        color: white !important;
        font-weight: 700 !important;
        width: 100% !important;
        text-align: center !important;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9) !important;
    }

    .hero-carousel .carousel-caption p,
    .carousel-caption p {
        display: none !important;
    }

    .hero-carousel .carousel-caption a,
    .hero-carousel .carousel-caption .btn,
    .carousel-caption .btn,
    .carousel-caption a {
        font-size: 0.75rem !important;
        padding: 0.4rem 0.8rem !important;
        display: inline-block !important;
        margin-top: 0.5rem !important;
        white-space: nowrap !important;
        min-height: 28px !important;
        line-height: 1.2 !important;
        background: #007bff !important;
        color: white !important;
        border: 2px solid white !important;
        border-radius: 0.25rem !important;
        text-decoration: none !important;
        text-align: center !important;
        align-self: center !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
        font-weight: 600 !important;
    }

    /* Meta informações compactas */
    .hero-carousel .carousel-caption .carousel-meta,
    .carousel-caption .carousel-meta {
        font-size: 0.65rem !important;
        margin-bottom: 0.25rem !important;
        color: rgba(255, 255, 255, 0.8) !important;
        display: block !important;
    }

    /* Controles menores no mobile */
    .hero-carousel .carousel-control-prev,
    .hero-carousel .carousel-control-next,
    .carousel-control-prev,
    .carousel-control-next {
        width: 10%;
    }

    .hero-carousel .carousel-control-prev-icon,
    .hero-carousel .carousel-control-next-icon,
    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 1.5rem;
        height: 1.5rem;
    }

    /* Indicadores menores e reposicionados */
    .hero-carousel .carousel-indicators,
    .carousel-indicators {
        margin-bottom: 0.5rem !important;
        z-index: 15 !important;
        position: absolute !important;
        bottom: 0.5rem !important;
    }

    .hero-carousel .carousel-indicators [data-bs-target],
    .carousel-indicators [data-bs-target] {
        width: 8px;
        height: 8px;
        margin: 0 2px;
        background-color: rgba(255, 255, 255, 0.8) !important;
        border: 1px solid rgba(255, 255, 255, 0.9) !important;
    }
}

/* Tablets (577px - 768px) */
@media (min-width: 577px) and (max-width: 768px) {
    .hero-carousel .carousel-inner,
    .carousel-inner {
        height: 350px;
    }

    .hero-carousel .carousel-item img,
    .carousel-image,
    .carousel-item img {
        height: 350px;
        object-fit: cover;
    }

    .hero-carousel .carousel-caption,
    .carousel-caption {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        text-align: center;
    }

    .hero-carousel .carousel-caption h5,
    .hero-carousel .carousel-caption h1,
    .hero-carousel .carousel-caption h2,
    .hero-carousel .carousel-caption h3,
    .hero-carousel .carousel-caption h4,
    .carousel-caption h2 {
        font-size: 1.1rem;
    }

    .hero-carousel .carousel-caption p,
    .carousel-caption p {
        font-size: 0.85rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 0.75rem;
    }
}

/* Desktop pequeno (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-carousel .carousel-inner,
    .carousel-inner {
        height: 400px;
    }

    .hero-carousel .carousel-item img,
    .carousel-image,
    .carousel-item img {
        height: 400px;
        object-fit: cover;
    }

    .hero-carousel .carousel-caption h5,
    .hero-carousel .carousel-caption h1,
    .hero-carousel .carousel-caption h2,
    .hero-carousel .carousel-caption h3,
    .hero-carousel .carousel-caption h4,
    .carousel-caption h2 {
        font-size: 1.4rem;
    }

    .hero-carousel .carousel-caption p,
    .carousel-caption p {
        font-size: 1rem;
    }
}

/* Desktop grande (≥1025px) */
@media (min-width: 1025px) {
    .hero-carousel .carousel-inner,
    .carousel-inner {
        height: 500px;
    }

    .hero-carousel .carousel-item img,
    .carousel-image,
    .carousel-item img {
        height: 500px;
        object-fit: cover;
    }

    .hero-carousel .carousel-caption,
    .carousel-caption {
        bottom: 2rem;
        left: 2rem;
        right: 2rem;
        max-width: 600px;
        text-align: left;
    }

    .hero-carousel .carousel-caption h5,
    .hero-carousel .carousel-caption h1,
    .hero-carousel .carousel-caption h2,
    .hero-carousel .carousel-caption h3,
    .hero-carousel .carousel-caption h4,
    .carousel-caption h2 {
        font-size: 1.6rem;
    }

    .hero-carousel .carousel-caption p,
    .carousel-caption p {
        font-size: 1.1rem;
    }
}

/* ==========================================================================
   HERO SECTION (quando há apenas 1 item)
   ========================================================================== */

.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-image {
    position: relative;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    height: 500px;
}

.hero-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    padding: 2rem;
}

.hero-content h1 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.hero-content p {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

@media (max-width: 768px) {
    .hero-image {
        height: 350px;
    }
    
    .hero-content {
        padding: 1rem;
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .hero-content p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-image {
        height: 280px;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .hero-content .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
}

/* ==========================================================================
   LOADING STATES E MELHORIAS UX
   ========================================================================== */

/* Loading placeholder */
.carousel-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 500px;
    background: linear-gradient(135deg, #0d6efd, #6c757d);
    color: white;
}

.carousel-loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Loading state para carousel */
.hero-carousel .carousel-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero-carousel .carousel-inner.loading::before {
    opacity: 0.3;
}

/* ==========================================================================
   MELHORIAS DE ACESSIBILIDADE
   ========================================================================== */

.carousel-control-prev:focus,
.carousel-control-next:focus,
.carousel-indicators button:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Hover effects melhorados */
.hero-carousel .carousel-control-prev:hover,
.hero-carousel .carousel-control-next:hover {
    opacity: 0.9;
}