/* ============================================
   MELHORIAS DO CARROSSEL MOBILE
   - Aumenta tamanho dos produtos
   - Adiciona setas nos botões
   - Corrige Trust Badges no mobile
   ============================================ */

/* SETAS NOS BOTÕES - DESKTOP E MOBILE */
/* Esconder ícones antigos */
.owl-prev i,
.owl-next i,
.owl-prev span,
.owl-next span {
    display: none !important;
}

.trust-badges .carousel-btn i,
.trust-badges .carousel-btn span {
    display: none !important;
}

/* Adicionar setas usando Font Awesome */
.owl-prev::before {
    content: '\f104'; /* Seta esquerda */
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 18px;
    color: #333;
}

.owl-next::before {
    content: '\f105'; /* Seta direita */
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 18px;
    color: #333;
}

.trust-badges .carousel-btn.prev::before {
    content: '\f104'; /* Seta esquerda */
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 18px;
    color: #333;
}

.trust-badges .carousel-btn.next::before {
    content: '\f105'; /* Seta direita */
    font-family: "Font Awesome 5 Free", "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 18px;
    color: #333;
}

/* Garantir que botões estejam centralizados */
.owl-prev,
.owl-next,
.trust-badges .carousel-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* MOBILE - Produtos maiores e botões com setas */
@media (max-width: 768px) {
    /* Aumentar tamanho dos produtos no mobile */
    .products-swiper .swiper-slide,
    .products-carousel .swiper-slide {
        width: 180px !important; /* Aumentado de ~150px para 180px */
        min-width: 180px !important;
    }
    
    .product-card {
        width: 100% !important;
        max-width: 180px !important;
    }
    
    .product-card .product-image {
        height: 220px !important; /* Aumentado proporcionalmente */
    }
    
    .product-card .product-image img {
        height: 220px !important;
        object-fit: cover;
    }
    
    /* Ajustar espaçamento entre produtos */
    .swiper-wrapper {
        gap: 12px !important;
    }
    
    /* BOTÕES COM SETAS - Owl Carousel (produtos) */
    .owl-prev,
    .owl-next {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 40px !important;
        height: 40px !important;
        background-color: rgba(255, 255, 255, 0.95) !important;
        border: 2px solid #ddd !important;
        border-radius: 50% !important;
        cursor: pointer;
        z-index: 10;
        transition: all 0.3s;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }
    
    .owl-prev:hover,
    .owl-next:hover {
        background-color: #fff !important;
        border-color: #000 !important;
        box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    }
    
    .owl-prev {
        left: 5px;
    }
    
    .owl-next {
        right: 5px;
    }
    
    /* BOTÕES COM SETAS - Trust Badges (SOMENTE MOBILE) */
    .trust-badges .carousel-btn {
        width: 40px !important;
        height: 40px !important;
        background-color: rgba(255, 255, 255, 0.95) !important;
        border: 2px solid #ddd !important;
        border-radius: 50% !important;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
        cursor: pointer;
        transition: all 0.3s;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }
    
    .trust-badges .carousel-btn:hover {
        background-color: #fff !important;
        border-color: #000 !important;
        box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    }
    
    .trust-badges .carousel-btn.prev {
        left: 5px;
    }
    
    .trust-badges .carousel-btn.next {
        right: 5px;
    }
    
    /* CORREÇÃO TRUST BADGES - Scroll Perfeito no Mobile */
    .badges-grid {
        display: flex !important;
        gap: 0 !important;
        overflow-x: scroll !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        /* ADICIONADO: Força o scroll a parar em cada ponto de ancoragem (do fix anterior) */
        scroll-snap-stop: always !important; 
    }
    
    .badges-grid::-webkit-scrollbar {
        display: none !important;
    }
    
    .badge-item {
        flex: 0 0 100% !important;
        scroll-snap-align: start !important;
        min-width: 100% !important;
        max-width: 100% !important;
        scroll-snap-stop: always !important;
        padding: 0 10px !important;
        box-sizing: border-box !important;
    }
    
    /* Remover qualquer margem extra */
    .badge-item:last-child {
        margin-right: 0 !important;
    }
    
    .badge-item:first-child {
        margin-left: 0 !important;
    }
    
    /* Container dos badges ajustado - sem padding */
    .trust-badges {
        position: relative;
        overflow: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        
        /* NOVO: Adiciona espaço acima do Trust Badges no mobile */
        margin-top: 20px !important; 
    }
    
    /* Garantir que o container não adicione espaço extra */
    .trust-badges > div {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Ajustar container para acomodar produtos maiores */
    .products-section .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .products-carousel {
        margin: 0 -5px;
    }
    
    /* Garantir que o swiper mostre 2 produtos por vez */
    .swiper-container {
        overflow: visible !important;
    }
    
    /* Ajustar título do produto para caber melhor */
    .product-card .product-title {
        font-size: 13px !important;
        line-height: 1.3 !important;
        height: auto !important;
        min-height: 35px !important;
    }
    
    .product-card .product-title a {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    /* Ajustar preços */
    .product-prices-wrapper {
        padding: 8px 10px !important;
    }
    
    .product-prices-wrapper .sale-price {
        font-size: 16px !important;
    }
    
    .product-prices-wrapper .installment,
    .product-prices-wrapper .pix-price {
        font-size: 11px !important;
    }
    
    /* Botão comprar */
    .product-card .buy-btn {
        padding: 10px !important;
        font-size: 13px !important;
    }
    
    /* Badges de desconto e wishlist */
    .discount-badge {
        font-size: 11px !important;
        padding: 4px 8px !important;
    }
    
    .wishlist-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 14px !important;
    }
}

/* DESKTOP - Esconder botões do Trust Badges */
@media (min-width: 769px) {
    .trust-badges .carousel-btn {
        display: none !important;
    }
    
    .trust-badges .carousel-btn.prev,
    .trust-badges .carousel-btn.next {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    .trust-badges .carousel-btn::before {
        display: none !important;
    }
}

/* Ajustes para telas muito pequenas (< 360px) */
@media (max-width: 360px) {
    .products-swiper .swiper-slide,
    .products-carousel .swiper-slide {
        width: 165px !important;
        min-width: 165px !important;
    }
    
    .product-card {
        max-width: 165px !important;
    }
    
    .product-card .product-image {
        height: 200px !important;
    }
    
    .product-card .product-image img {
        height: 200px !important;
    }
    
    /* Trust Badges menor em telas pequenas */
    .badge-item {
        min-width: 220px !important;
        max-width: 220px !important;
    }
}

/* Ajustes para telas médias (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .products-swiper .swiper-slide,
    .products-carousel .swiper-slide {
        width: 200px !important;
        min-width: 200px !important;
    }
    
    .product-card {
        max-width: 200px !important;
    }
    
    .product-card .product-image {
        height: 240px !important;
    }
    
    .product-card .product-image img {
        height: 240px !important;
    }
}

/* Garantir que os botões fiquem visíveis e desabilitados quando necessário */
.owl-prev:disabled,
.owl-next:disabled,
.carousel-btn:disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.owl-prev:disabled::before,
.owl-next:disabled::before,
.carousel-btn:disabled::before {
    color: #999 !important;
}