/**
 * Estilos para o carrossel de produtos no frontend
 * 
 * @package ALCE_Carrossel_Blog
 */

@import url('https://fonts.googleapis.com/css2?family=Albert+Sans:wght@400;600&display=swap');

/* Container principal do carrossel */
.alce-carousel-container {
    position: relative;
    margin: 20px 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Albert Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.alce-carousel-swiper {
    position: relative;
    overflow: hidden;
    padding: 0 0 40px 0; /* Espaço para paginação */
}

/* Slides do carrossel */
.alce-product-slide {
    height: auto;
    display: flex;
}

/* Card do produto */
.alce-product-card {
    background: transparent;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.alce-product-card:hover {
    transform: translateY(-2px);
}

/* Imagem do produto */
.alce-product-image {
    position: relative;
    overflow: hidden;
    background-color: #f8f9fa;
    aspect-ratio: 1;
}

.alce-product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.alce-product-card:hover .alce-product-img {
    transform: scale(1.05);
}

/* Badge de oferta */
.alce-sale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e74c3c;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 2;
}



/* Informações do produto */
.alce-product-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #ffffff;
    color: #000000;
}

/* Avaliação */
.alce-product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #000000;
}

.alce-stars {
    display: flex;
    gap: 1px;
}

.alce-star {
    color: #ddd;
    font-size: 14px;
    transition: color 0.2s ease;
}

.alce-star.filled {
    color: #ffc107;
}

.alce-star.empty {
    color: #e0e0e0;
}

.alce-review-count {
    color: #000000;
    font-size: 11px;
}

/* Título do produto */
.alce-product-title {
    margin: 0;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.3;
    flex: 1;
    font-family: 'Albert Sans', sans-serif;
    color: #000000;
}

.alce-product-title a {
    color: #000000 !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.alce-product-title a:hover {
    color: #db1215;
}

.alce-product-title a:visited {
    color: #000000 !important;
    text-decoration: none !important;
}
body.single-post .alce-blog a, body.single-post .alce-blog a:visited {
    color: #00000 !important;
    text-decoration: none !important;
}

/* Preço */
.alce-product-price {
    font-size: 14px;
    font-weight: 600;
    color: #000000;
    margin: 5px 0;
    font-family: 'Albert Sans', sans-serif;
}

.alce-product-price del {
    color: #000000;
    font-weight: 400;
    font-size: 14px;
    margin-right: 5px;
}

.alce-product-price ins {
    text-decoration: none;
    color: #000000;
}

/* Botões de ação - Ocultos */
.alce-product-button {
    display: none;
}

/* Estados de loading */
.alce-add-to-cart-btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.alce-add-to-cart-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: alce-spin 1s linear infinite;
}

@keyframes alce-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Oculta apenas as setas padrão do Swiper (não as customizadas) */
.alce-carousel-container .swiper-button-next:not(.alce-carousel-next),
.alce-carousel-container .swiper-button-prev:not(.alce-carousel-prev) {
    display: none !important;
}

/* Navegação do carrossel customizada */
.alce-carousel-next,
.alce-carousel-prev {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    color: #333;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Estilos específicos para as setas do Ecomus */
.ecomus-svg-icon.alce-carousel-next,
.ecomus-svg-icon.alce-carousel-prev {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    color: #333;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alce-carousel-next,
.ecomus-svg-icon.alce-carousel-next {
    right: 10px;
}

.alce-carousel-prev,
.ecomus-svg-icon.alce-carousel-prev {
    left: 10px;
}

.alce-carousel-next:hover,
.alce-carousel-prev:hover,
.ecomus-svg-icon.alce-carousel-next:hover,
.ecomus-svg-icon.alce-carousel-prev:hover {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
    transform: translateY(-50%) scale(1.1);
}

.alce-carousel-next.swiper-button-disabled,
.alce-carousel-prev.swiper-button-disabled,
.ecomus-svg-icon.alce-carousel-next.swiper-button-disabled,
.ecomus-svg-icon.alce-carousel-prev.swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Garante que as setas sejam clicáveis */
.alce-carousel-next:not(.swiper-button-disabled),
.alce-carousel-prev:not(.swiper-button-disabled),
.ecomus-svg-icon.alce-carousel-next:not(.swiper-button-disabled),
.ecomus-svg-icon.alce-carousel-prev:not(.swiper-button-disabled) {
    pointer-events: auto;
    cursor: pointer;
}

/* Paginação */
.alce-carousel-pagination {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.alce-carousel-pagination .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #ccc;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 1;
}

.alce-carousel-pagination .swiper-pagination-bullet-active {
    background: #2271b1;
    transform: scale(1.2);
}

/* Loading overlay */
.alce-carousel-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.alce-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    animation: alce-spin 1s linear infinite;
}

/* Mensagem quando não há produtos */
.alce-carousel-no-products {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border: 1px dashed #ddd;
    border-radius: 8px;
    margin: 20px 0;
}

/* Responsividade */
@media (max-width: 1199px) {
    .alce-carousel-next,
    .ecomus-svg-icon.alce-carousel-next {
        right: 8px;
    }
    
    .alce-carousel-prev,
    .ecomus-svg-icon.alce-carousel-prev {
        left: 8px;
    }
}

@media (max-width: 991px) {
    .alce-carousel-next,
    .alce-carousel-prev,
    .ecomus-svg-icon.alce-carousel-next,
    .ecomus-svg-icon.alce-carousel-prev {
        width: 36px;
        height: 36px;
    }
    
    .alce-carousel-next,
    .ecomus-svg-icon.alce-carousel-next {
        right: 5px;
    }
    
    .alce-carousel-prev,
    .ecomus-svg-icon.alce-carousel-prev {
        left: 5px;
    }
    
    .alce-product-info {
        padding: 12px;
    }
    
    .alce-product-title {
        font-size: 13px;
    }
    
    .alce-product-price {
        font-size: 15px;
    }
}

@media (max-width: 767px) {
    .alce-carousel-container {
        margin: 15px 0;
    }
    
    .alce-carousel-next,
    .alce-carousel-prev,
    .ecomus-svg-icon.alce-carousel-next,
    .ecomus-svg-icon.alce-carousel-prev {
        display: none; /* Esconde navegação em mobile */
    }
    

    
    .alce-product-info {
        padding: 10px;
        gap: 6px;
    }
    
    .alce-add-to-cart-btn,
    .alce-select-options-btn,
    .alce-view-product-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}

@media (max-width: 479px) {
    .alce-carousel-swiper {
        padding: 0 0 30px 0;
    }
    
    .alce-product-card {
        border-radius: 6px;
    }
    
    .alce-product-info {
        padding: 8px;
    }
    
    .alce-product-title {
        font-size: 12px;
    }
    
    .alce-product-price {
        font-size: 14px;
    }
    
    .alce-carousel-pagination .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
    }
}

/* Animações de entrada */
@keyframes alce-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alce-carousel-container {
    animation: alce-fade-in-up 0.6s ease-out;
}

/* Melhorias de acessibilidade */
.alce-product-card:focus-within {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.alce-add-to-cart-btn:focus,
.alce-select-options-btn:focus,
.alce-view-product-btn:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Modo escuro (se suportado pelo tema) */
@media (prefers-color-scheme: dark) {
    .alce-product-card {
        background: #1a1a1a;
        border-color: #333;
        color: #fff;
    }
    
    .alce-product-title a {
        color: #000000;
    }
    
    .alce-product-title a:hover {
        color: #db1215;
    }
    
    .alce-carousel-next,
    .alce-carousel-prev {
        background: rgba(26, 26, 26, 0.9);
        border-color: #333;
        color: #fff;
    }
    
    .alce-carousel-no-products {
        background: #1a1a1a;
        border-color: #333;
        color: #ccc;
    }
}

/* Print styles */
@media print {
    .alce-carousel-container {
        display: none;
    }
}