/* ============================================
   SORTEIOS ENCERRADOS - CSS SEPARADO
   ============================================ */

/* Seção principal */
.encerrados-section {
    padding: 2rem 0;
    margin-top: 2rem;
}

.encerrados-list {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Carrossel wrapper */
.encerrados-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    width: 100%;
}

.encerrados-carousel-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-width: 0;
}

.encerrados-grid {
    display: flex;
    gap: 1.25rem;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.encerrados-grid.centered {
    justify-content: center;
}

/* Botões de navegação */
.encerrados-carousel-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    z-index: 10;
}

.encerrados-carousel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.encerrados-carousel-btn:active {
    transform: scale(0.95);
}

/* Card de sorteio encerrado */
.sorteio-encerrado-card {
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(15, 23, 42, 0.04);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.sorteio-encerrado-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 28px 65px rgba(15, 23, 42, 0.2);
}

/* Media (imagem) do card */
.sorteio-encerrado-media {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 18px 18px 0 0;
    flex-shrink: 0;
}

.sorteio-encerrado-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
    display: block;
}

.sorteio-encerrado-card:hover .sorteio-encerrado-image {
    transform: scale(1.04);
}

/* Badge "Finalizado" */
.badge-finalizado {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #00A859, #1B5E20);
    color: white;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 168, 89, 0.3);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    z-index: 10;
}

.badge-finalizado i {
    font-size: 0.8rem;
}

/* Content (conteúdo) do card */
.sorteio-encerrado-content {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    gap: 0.5rem;
    flex: 1;
    position: relative;
}

/* Título do sorteio */
.sorteio-encerrado-title {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    word-break: break-word;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

/* Prêmio */
.sorteio-encerrado-premio {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    color: #f97316;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    word-break: break-word;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

.sorteio-encerrado-premio i {
    display: inline-block;
    font-size: 0.9rem;
    margin-right: 0.5rem;
    color: #f97316;
}

.sorteio-encerrado-premio span {
    display: inline;
}

/* Data */
.sorteio-encerrado-data {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

.sorteio-encerrado-data i {
    display: inline-block;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    color: #64748b;
}

.sorteio-encerrado-data span {
    display: inline;
}

/* Animação */
.sorteio-encerrado-card.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

/* Desktop - 4 cards por vez */
.encerrados-grid .sorteio-encerrado-card {
    flex: 0 0 calc(25% - 0.9375rem);
    max-width: 320px;
    min-width: 260px;
}

/* Tablet grande - 3 cards por vez */
@media (max-width: 1024px) {
    .encerrados-grid .sorteio-encerrado-card {
        flex: 0 0 calc(33.333% - 0.833rem);
    }
    
    .sorteio-encerrado-media {
        height: 170px;
    }
}

/* Tablet - 2 cards por vez */
@media (max-width: 768px) {
    .encerrados-carousel-btn {
        display: none !important;
    }
    
    .encerrados-carousel-wrapper {
        gap: 0;
    }
    
    .encerrados-carousel-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }
    
    .encerrados-grid {
        scroll-snap-type: x mandatory;
    }
    
    .encerrados-grid .sorteio-encerrado-card {
        flex: 0 0 calc(50% - 0.625rem);
        min-width: 240px;
        scroll-snap-align: center;
    }
    
    .sorteio-encerrado-media {
        height: 160px;
    }
    
    .sorteio-encerrado-content {
        padding: 1rem;
        gap: 0.4rem;
    }
    
    .sorteio-encerrado-title {
        font-size: 1rem;
    }
    
    .sorteio-encerrado-premio {
        font-size: 0.9rem;
    }
    
    .sorteio-encerrado-data {
        font-size: 0.8rem;
    }
}

/* Mobile - 1 card por vez */
@media (max-width: 640px) {
    .encerrados-carousel-wrapper {
        gap: 0;
    }
    
    .encerrados-carousel-btn {
        display: none !important;
    }
    
    .encerrados-carousel-container {
        padding: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }
    
    .encerrados-grid {
        gap: 1rem;
        scroll-snap-type: x mandatory;
    }
    
    .encerrados-grid .sorteio-encerrado-card {
        flex: 0 0 calc(100% - 2rem) !important;
        max-width: calc(100% - 2rem) !important;
        min-width: calc(100% - 2rem) !important;
        width: calc(100% - 2rem) !important;
        margin: 0 1rem;
        scroll-snap-align: center;
    }
    
    .sorteio-encerrado-media {
        height: 200px;
        border-radius: 16px 16px 0 0;
    }
    
    .sorteio-encerrado-content {
        padding: 1.25rem 1rem;
        gap: 0.5rem;
    }
    
    .sorteio-encerrado-title {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }
    
    .sorteio-encerrado-premio {
        font-size: 1rem;
        margin: 0.25rem 0;
    }
    
    .sorteio-encerrado-data {
        font-size: 0.9rem;
        margin-top: 0.25rem;
    }
}
