/*
 * SEÇÃO CATEGORIAS - CÍRCULOS VERMELHOS PERFEITOS
 * Carrossel infinito com espaçamento igual ao tamanho dos círculos
 */

/* ==================== SEÇÃO CATEGORIAS ==================== */

.categories-section {
    padding: 4rem 0 !important;
    background-color: transparent !important; /* 100% TRANSPARENTE */
    overflow: hidden !important;
}

.categories-section .section-header {
    text-align: center !important;
    margin-bottom: 3rem !important;
    background-color: transparent !important; /* 100% TRANSPARENTE */
}

.categories-section .section-title {
    font-size: 2rem !important;
    font-weight: 600 !important;
    color: #333333 !important;
    margin-bottom: 1rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    background-color: transparent !important; /* 100% TRANSPARENTE */
}

.categories-section .section-line {
    width: 4rem !important;
    height: 2px !important;
    background-color: var(--accent-color) !important;
    margin: 0 auto !important;
}

/* ==================== CARROSSEL DE CATEGORIAS ==================== */

.categories-carousel {
    width: 100% !important;
    position: relative !important;
    overflow: hidden !important;
    background-color: transparent !important; /* 100% TRANSPARENTE */
}

.categories-swiper {
    width: 100% !important;
    padding: 2rem 0 !important;
    background-color: transparent !important; /* 100% TRANSPARENTE */
    /* Configurações para carrossel infinito suave */
    overflow: hidden !important;
    position: relative !important;
}

.categories-swiper .swiper-wrapper {
    display: flex !important;
    align-items: center !important;
    transition-timing-function: linear !important;
    background-color: transparent !important; /* 100% TRANSPARENTE */
    /* Configurações para movimento contínuo infinito */
    animation-timing-function: linear !important;
    will-change: transform !important; /* Otimização de performance */
}

.categories-swiper .swiper-slide {
    width: 150px !important; /* Tamanho fixo e uniforme */
    height: 200px !important; /* Altura fixa para uniformidade total */
    flex-shrink: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important;
    margin-right: 150px !important; /* Espaçamento igual ao tamanho */
    box-sizing: border-box !important;
    background-color: transparent !important; /* 100% TRANSPARENTE */
}

/* ==================== CÍRCULO TRANSPARENTE COM IMAGEM DE BACKGROUND ==================== */

.category-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    background-color: transparent !important; /* 100% TRANSPARENTE */
}

.category-circle {
    width: 150px !important; /* TAMANHO FIXO E UNIFORME */
    height: 150px !important; /* TAMANHO FIXO E UNIFORME */
    border-radius: 50% !important;
    /* CÍRCULO TRANSPARENTE COM IMAGEM DE BACKGROUND */
    background-color: transparent !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    background-position: center !important;
    /* Propriedades para uniformidade perfeita */
    display: block !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15) !important;
    position: relative !important;
    overflow: hidden !important;
    border: none !important;
    outline: none !important;
    box-sizing: border-box !important;
    /* CÍRCULO MATEMATICAMENTE PERFEITO */
    aspect-ratio: 1 / 1 !important;
    flex-shrink: 0 !important;
    margin: 0 !important; /* Remove todas as margens */
    margin-bottom: 0.75rem !important; /* Apenas espaço para texto embaixo */
    /* Qualidade de background otimizada */
    image-rendering: -webkit-optimize-contrast !important;
    image-rendering: crisp-edges !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    backface-visibility: hidden !important;
    transform: translateZ(0) !important;
}

.category-circle:hover {
    transform: scale(1.05) translateZ(0) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
}

.category-circle:active {
    transform: scale(0.98) translateZ(0) !important;
    transition: all 0.1s ease !important;
}

/* ==================== TEXTO CLEAN ABAIXO DO CÍRCULO ==================== */

.category-name {
    color: #333333 !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    text-align: center !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    padding: 0 0.25rem !important;
    /* Layout clean */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    text-rendering: optimizeLegibility !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    /* Transição suave */
    transition: color 0.3s ease !important;
}

.category-item:hover .category-name {
    color: var(--accent-color, #e4002b) !important;
}

/* ==================== FALLBACK PARA QUANDO NÃO HÁ IMAGEM ==================== */

.category-circle.no-image {
    background-color: #e4002b !important;
    background-image: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.category-circle.no-image::before {
    content: attr(data-name) !important;
    color: #ffffff !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    text-align: center !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

/* ==================== CARROSSEL INFINITO ==================== */

.categories-swiper.swiper-container {
    overflow: visible !important;
}

/* Remover navegação padrão */
.categories-swiper .swiper-button-next,
.categories-swiper .swiper-button-prev {
    display: none !important;
}

/* Remover paginação */
.categories-swiper .swiper-pagination {
    display: none !important;
}

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

/* Tablet */
@media (max-width: 1024px) {
    .categories-swiper .swiper-slide {
        width: 120px !important; /* TAMANHO UNIFORME */
        height: 160px !important; /* ALTURA FIXA UNIFORME */
        margin-right: 120px !important; /* Espaçamento igual */
        box-sizing: border-box !important;
    }
    
    .category-circle {
        width: 120px !important; /* TAMANHO FIXO UNIFORME */
        height: 120px !important; /* TAMANHO FIXO UNIFORME */
        aspect-ratio: 1 / 1 !important;
        margin: 0 !important;
        margin-bottom: 0.5rem !important;
        box-sizing: border-box !important;
    }
    
    .category-name {
        font-size: 0.75rem !important;
    }
    
    .category-circle.no-image::before {
        font-size: 0.6rem !important;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .categories-section {
        padding: 3rem 0 !important;
    }
    
    .categories-section .section-title {
        font-size: 1.5rem !important;
    }
    
    .categories-swiper .swiper-slide {
        width: 100px !important; /* TAMANHO UNIFORME */
        height: 130px !important; /* ALTURA FIXA UNIFORME */
        margin-right: 100px !important; /* Espaçamento igual */
        box-sizing: border-box !important;
    }
    
    .category-circle {
        width: 100px !important; /* TAMANHO FIXO UNIFORME */
        height: 100px !important; /* TAMANHO FIXO UNIFORME */
        aspect-ratio: 1 / 1 !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15) !important;
        margin: 0 !important;
        margin-bottom: 0.5rem !important;
        box-sizing: border-box !important;
    }
    
    .category-circle:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
    }
    
    .category-name {
        font-size: 0.65rem !important;
    }
    
    .category-circle.no-image::before {
        font-size: 0.5rem !important;
    }
}

/* Mobile pequeno */
@media (max-width: 480px) {
    .categories-swiper .swiper-slide {
        width: 80px !important; /* TAMANHO UNIFORME */
        height: 110px !important; /* ALTURA FIXA UNIFORME */
        margin-right: 80px !important; /* Espaçamento igual */
        box-sizing: border-box !important;
    }
    
    .category-circle {
        width: 80px !important; /* TAMANHO FIXO UNIFORME */
        height: 80px !important; /* TAMANHO FIXO UNIFORME */
        aspect-ratio: 1 / 1 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
        margin: 0 !important;
        margin-bottom: 0.4rem !important;
        box-sizing: border-box !important;
    }
    
    .category-name {
        font-size: 0.55rem !important;
    }
    
    .category-circle.no-image::before {
        font-size: 0.45rem !important;
    }
}

/* ==================== ANIMAÇÕES ==================== */

/* Animação de entrada */
@keyframes categoryFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.category-circle {
    animation: categoryFadeIn 0.6s ease-out !important;
}

/* Delay escalonado para animação */
.categories-swiper .swiper-slide:nth-child(1) .category-circle { animation-delay: 0.1s !important; }
.categories-swiper .swiper-slide:nth-child(2) .category-circle { animation-delay: 0.2s !important; }
.categories-swiper .swiper-slide:nth-child(3) .category-circle { animation-delay: 0.3s !important; }
.categories-swiper .swiper-slide:nth-child(4) .category-circle { animation-delay: 0.4s !important; }
.categories-swiper .swiper-slide:nth-child(5) .category-circle { animation-delay: 0.5s !important; }
.categories-swiper .swiper-slide:nth-child(6) .category-circle { animation-delay: 0.6s !important; }

/* ==================== ACESSIBILIDADE ==================== */

.category-circle {
    outline: none !important;
}

.category-circle:focus {
    outline: 3px solid #007bff !important;
    outline-offset: 2px !important;
}

/* Alto contraste */
@media (prefers-contrast: high) {
    .category-circle {
        border: 2px solid #ffffff !important;
    }
    
    .category-name {
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
    }
}

/* Redução de movimento */
@media (prefers-reduced-motion: reduce) {
    .category-circle {
        animation: none !important;
        transition: none !important;
    }
    
    .category-circle:hover {
        transform: none !important;
    }
}

/* ==================== PERFORMANCE ==================== */

.category-circle {
    will-change: transform !important;
    backface-visibility: hidden !important;
    transform: translateZ(0) !important;
}

.categories-swiper {
    contain: layout style paint !important;
}
