/* ==========================================================================
   WRAPPER E CONTAINER
   ========================================================================== */
   .carousel-wrapper {
    position: relative;
    width: 100%;
    min-width: 0;
    padding: 0 60px; /* Espaço sagrado das setas */
    box-sizing: border-box;
}

.carousel-scroll-container {
    display: flex;
    overflow-x: auto;
    padding: 20px 0 40px; 
    scrollbar-width: none;
    cursor: grab;
    
    /* Efeito de esmaecimento nas bordas laterais */
    mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

.carousel-scroll-container.is-dragging { 
    cursor: grabbing; 
}

.carousel-scroll-container::-webkit-scrollbar { 
    display: none; 
}

/* ==========================================================================
   TRILHA E ALINHAMENTOS
   ========================================================================== */
.marquee-track {
    display: flex;
    flex-wrap: nowrap;
    gap: 30px;
    width: max-content;
    
    /* CORREÇÃO DO ZIG-ZAGUE: Obriga todos os cards a terem a mesma altura */
    align-items: stretch; 
}

/* Centraliza se houver poucos cursos ou se a lista estiver vazia */
.marquee-track.centered, 
.marquee-track.is-empty {
    width: 100%;
    justify-content: center;
}

/* Quando está centrado, removemos o efeito de fade nas bordas para ficar limpo */
.carousel-scroll-container.is-centered {
    mask-image: none;
    -webkit-mask-image: none;
}

/* ==========================================================================
   CARD DO CURSO
   ========================================================================== */
.course-card {
    flex: 0 0 280px; 
    width: 280px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.03);
    height: auto; /* Deixa a altura flexível para acompanhar o align-items: stretch */
    align-items: center;
}

.course-card:hover { 
    transform: translateY(-8px); 
    box-shadow: 0 15px 35px rgba(0,0,0,0.12); 
    z-index: 10;
}

.course-card-image { 
    width: 100%; 
    height: 150px; 
    object-fit: cover; 
    pointer-events: none; /* Previne bug de arrastar a imagem nativamente */
    user-select: none;
}

.course-card-content { 
    padding: 20px; 
    display: flex; 
    flex-direction: column; 
    gap: 15px;
    flex-grow: 1; /* Preenche o resto do card, empurrando a modalidade para baixo */
}

.course-card-title { 
    font-family: 'Exo', sans-serif; 
    font-size: 1.15rem; 
    font-weight: 600; 
    color: var(--text-dark);
    line-height: 1.3;
    margin: 0;
}

.course-card-modality { 
    align-self: flex-start;
    font-size: 0.85rem; 
    color: var(--primary-green); 
    background: rgba(51, 63, 52, 0.05); 
    padding: 4px 14px; 
    border-radius: 50px; 
    font-weight: 600;
    margin: 0;
    
    /* A MAGIA DO ALINHAMENTO: Empurra este item sempre para a base absoluta do card */
    margin-top: auto; 
}

/* ==========================================================================
   SETAS DE NAVEGAÇÃO
   ========================================================================== */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    width: 45px;
    height: 45px;
    background-color: var(--primary-green);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.carousel-arrow:hover {
    background-color: #1a1d13;
    transform: translateY(-50%) scale(1.1);
}

.left-arrow { left: 5px; }
.right-arrow { right: 5px; }

/* ==========================================================================
   ESTADO VAZIO (Nenhum Curso)
   ========================================================================== */
.no-courses-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 60px 20px;
    text-align: center;
}

.no-courses-message {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 25px;
    font-family: 'EB Garamond', serif;
}

.request-course-btn {
    font-family: 'Exo', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background-color: var(--primary-green);
    border: 1px solid var(--primary-green);
    padding: 14px 30px;
    border-radius: 50px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.request-course-btn:hover {
    background-color: #1a1d13;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* ==========================================================================
   RESPONSIVIDADE (MOBILE)
   ========================================================================== */
@media screen and (max-width: 800px) {
    .carousel-wrapper { padding: 0 10px; }
    .left-arrow { left: -10px; }
    .right-arrow { right: -10px; }
    
    .course-card {
        flex: 0 0 240px;
        width: 240px;
    }
}