/* =================================================================== */
/* ARQUIVO DE ESTILO DEFINITIVO - Farma Rocha                          */
/* VERSÃO OTIMIZADA: Estilos do card de produto foram removidos.       */
/* O estilo do card agora é controlado por 'product_card_v2.css'.      */
/* =================================================================== */

/* --- 1. VARIÁVEIS DE COR E CONFIGURAÇÕES GLOBAIS --- */
:root {
    --farma-rocha-amarelo: #FFF212;
    --farma-rocha-vermelho: #DC3545;
    --farma-rocha-preto: #212529;
    --farma-rocha-cinza: #6c757d;
}

body {
    padding-top: 70px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #ffffff;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* =================================================================== */
/* 3. LAYOUT RESPONSIVO DO CATÁLOGO                                    */
/* =================================================================== */

/* --- ORDEM DO MENU LATERAL NO MOBILE --- */
@media (max-width: 991px) { /* Ativa em tablets e celulares */
    .catalogo-container {
        display: flex;
        flex-direction: column;
    }
    .catalogo-produtos {
        order: 1; /* Produtos primeiro */
    }
    .catalogo-sidebar {
        order: 2; /* Filtros depois */
        margin-top: 30px;
    }
}

/* =================================================================== */
/* 4. ESTILOS DE COMPONENTES (CARROSSÉIS, FOOTER, ETC)                 */
/* =================================================================== */

.section-title {
    font-weight: 700;
    color: #333;
    border-left: 4px solid var(--farma-rocha-amarelo);
    padding-left: 1rem;
}

.bg-primary {
    background-color: var(--farma-rocha-amarelo) !important;
}
.footer .text-muted {
    color: white !important;
}

.footer {
    background-color: var(--farma-rocha-preto) !important;
    color: white !important;
}
.footer a {
    color: var(--farma-rocha-amarelo) !important;
}

.product-carousel-wrapper {
    position: relative;
}
.product-carousel {
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    padding: 1rem;
    scroll-snap-type: x mandatory;
}
.product-carousel::-webkit-scrollbar { display: none; }
.product-carousel { -ms-overflow-style: none; scrollbar-width: none; }

.carousel-product-item {
    scroll-snap-align: start;
    flex: 0 0 220px;
}
.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background-color: white;
    border: 1px solid #ddd;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: none;
}
.carousel-nav-btn.prev-btn { left: -15px; }
.carousel-nav-btn.next-btn { right: -15px; }

@media (min-width: 768px) {
    .carousel-product-item {
        flex: 0 0 250px;
    }
    .carousel-nav-btn {
        display: block;
    }
}

/* =================================================================== */
/* 5. ANIMAÇÕES CUSTOMIZADAS (NOVO)                                    */
/* =================================================================== */

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
  }
}

.promo-badge-pulse {
  animation: pulse 2s infinite;
}

/* --- Estilos para a Barra de Pesquisa com Sugestões --- */
.search-container {
    position: relative;
    flex-grow: 1;
    max-width: 500px;
}

.search-results-wrapper {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.search-results-wrapper .list-group-item {
    border: none;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}
.search-results-wrapper .list-group-item:last-child {
    border-bottom: none;
}
.search-results-wrapper .list-group-item:hover {
    background-color: #f8f9fa;
}
.search-item-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-right: 15px;
    border-radius: 0.25rem;
}
.search-item-info .nome-produto {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
}
.search-item-info .preco-final {
    font-weight: 700;
    color: #dc3545;
}
.search-item-info .preco-original {
    font-size: 0.85rem;
    text-decoration: line-through;
    color: #6c757d;
}

/* --- Estilos para Filtros com Scroll --- */
.filter-list-scrollable {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 10px;
}
.filter-list-scrollable::-webkit-scrollbar {
  width: 8px;
}
.filter-list-scrollable::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}
.filter-list-scrollable::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}
.filter-list-scrollable::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* ========================================= */
/* OTIMIZAÇÃO DA HOMEPAGE E ELEMENTOS GERAIS */
/* ========================================= */

.home-container, .home-section {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 15px;
}

@media (min-width: 768px) {
    .home-container, .home-section {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}
.home-section img {
    max-width: 100%;
    height: auto;
    margin-bottom: 15px;
}
@media (min-width: 768px) {
    .home-section img {
        margin-bottom: 0;
    }
}
/* ========================================================== */
/* ESTILIZAÇÃO FINAL DO BANNER DA HOMEPAGE (PC E MOBILE) */
/* ========================================================== */

.banner-container .carousel {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.banner-container .carousel-item img {
    display: block;
    width: 100%;
    object-fit: cover;
    object-position: center;
    height: auto;
}
/* =============================== */
/* BARRA FIXA DO CARRINHO (MOBILE) */
/* =============================== */

.fixed-bottom-cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #FFF212;
    color: #212529;
    padding: 10px 15px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}
.cart-bar-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #212529;
    text-decoration: none;
}
.cart-bar-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}
.cart-bar-info .item-count {
    font-size: 0.9rem;
    opacity: 0.9;
}
.cart-bar-info .total-price {
    font-size: 1.1rem;
    font-weight: bold;
}
.cart-bar-action {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    background-color: #212529;
    color: #FFF212;
    padding: 8px 16px;
    border-radius: 50px;
}
.cart-bar-action i {
    font-size: 1.4rem;
    margin-left: 5px;
}

/* =================================================================== */
/* CSS FINAL E COMPLETO (PÁGINA DE DETALHES)      */
/* =================================================================== */

.product-image-main-container {
    border: 1px solid #e9ecef;
    border-radius: 0.75rem;
    overflow: hidden;
    background-color: #fff;
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.product-image-main-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.product-thumbnail-gallery {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.product-thumbnail-item {
    width: 80px;
    height: 80px;
    border: 2px solid #ddd;
    border-radius: 0.5rem;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s ease;
    padding: 4px;
    background-color: #fff;
}
.product-thumbnail-item:hover,
.product-thumbnail-item.active {
    border-color: #0d6efd;
}
.product-thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0.25rem;
}

/* ========================================= */
/* BANNER DE CONSENTIMENTO DE COOKIES (FLUTUANTE) */
/* ========================================= */

.cookie-banner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: auto;
    max-width: 420px;
    background-color: #fff;
    color: var(--farma-rocha-preto);
    padding: 1.25rem;
    z-index: 1100;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(20px);
    opacity: 0;
}
.cookie-banner.show {
    display: block;
    transform: translateY(0);
    opacity: 1;
}
.cookie-banner-text {
    font-size: 0.9rem;
    margin: 0;
}
.cookie-banner-text a {
    color: var(--farma-rocha-vermelho);
    text-decoration: underline;
    font-weight: 500;
}
.cookie-banner .container {
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}
.cookie-banner #accept-cookies-btn {
    align-self: flex-end;
    background-color: var(--farma-rocha-amarelo);
    border-color: var(--farma-rocha-amarelo);
    color: var(--farma-rocha-preto);
    font-weight: bold;
}

@media (max-width: 480px) {
    .cookie-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }
    .content-wrapper {
        padding: 1rem;
    }
    .section-title {
        font-size: 1.25rem;
    }
    .product-image-main-container {
        height: 300px;
    }
}

/* Product Grid */
.grade-produtos .col {
    margin-bottom: 1.5rem;
}

@media (min-width: 576px) { .grade-produtos .col-sm-6 { flex: 0 0 50%; max-width: 50%; } }
@media (min-width: 768px) { .grade-produtos .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; } }
@media (min-width: 992px) { .grade-produtos .col-lg-3 { flex: 0 0 25%; max-width: 25%; } }
@media (max-width: 767px) {
    .product-details-column { margin-top: 2rem; }
    .product-price-block h3 { font-size: 2rem; }
}

@media (max-width: 991px) {
    .carrinho-container .col-lg-8, .checkout-container .col-lg-8 {
        margin-bottom: 2rem;
    }
}
/* ========================================================== */
/* ESTILOS PARA A NOVA HOME MODULAR                           */
/* ========================================================== */

.product-carousel-wrapper, .mini-banner-carousel-wrapper {
    position: relative;
    padding: 0 10px;
}
.swiper-button-prev, .swiper-button-next {
    display: none;
}

@media (min-width: 992px) {
    .swiper-button-prev, .swiper-button-next {
        display: flex;
        color: var(--farma-rocha-preto);
        background-color: rgba(255, 255, 255, 0.8);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    }
    .swiper-button-prev::after, .swiper-button-next::after {
        font-size: 1.2rem;
        font-weight: bold;
    }
}

.swiper-slide {
    height: auto;
    display: flex;
    align-items: stretch;
}

.carousel-infinito .swiper-wrapper {
    transition-timing-function: linear !important;
}

/* =============================================== */
/* AJUSTES DE ESPAÇAMENTO PARA A PÁGINA INICIAL   */
/* =============================================== */
.secao-home {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
}
.titulo-secao-home {
    margin-bottom: 1.5rem !important;
}

/* =============================================== */
/* ESTILOS PARA O MODAL DE INFORMAÇÕES DO USUÁRIO   */
/* =============================================== */

#userInfoModal .modal-header {
    background-color: var(--farma-rocha-amarelo);
    color: var(--farma-rocha-preto);
    border-bottom: none;
}
#userInfoModal .modal-title {
    font-weight: 600;
}
#userInfoModal .btn-primary {
    background-color: var(--farma-rocha-vermelho);
    border-color: var(--farma-rocha-vermelho);
}

/* =================================================================== */
/* CORREÇÃO DE SOBREPOSIÇÃO DE BADGES (NOVO)                           */
/* Adicionado em 26/09/2025 para ajustar alinhamento no menu e carrinho.*/
/* =================================================================== */

/* --- Correção para o Badge no Menu Principal ("Carrinho 3") --- */
.navbar .nav-link .badge {
    position: relative; /* Garante que o badge volte ao fluxo normal do link */
    top: -1px;          /* Ajusta a altura vertical para ficar bem alinhado */
    margin-left: 0.4rem;/* Adiciona um espaço entre a palavra "Carrinho" e o badge */
    
    /* Reseta qualquer outra regra que possa estar causando o problema */
    transform: none;
    right: auto;
}

/* --- Correção para o Badge no Título da Página do Carrinho ("3 ITENS Meu Carrinho") --- */
.carrinho-container .d-flex h2 {
    margin-right: 1rem; /* Adiciona um espaço à direita do título "Meu Carrinho" */
}

/* Opcional: Garante que o badge no título do carrinho não se sobreponha */
#cart-item-count {
    flex-shrink: 0; /* Impede que o badge encolha ou se comprima */
}
/* =================================================================== */
/* AJUSTE DE ESPAÇAMENTO PARA PREENCHER TELA NO MOBILE (NOVO)          */
/* =================================================================== */

@media (max-width: 576px) {
    /* Reduz o espaçamento lateral dos containers principais em telas pequenas */
    .container, .container-fluid {
        padding-left: 8px;
        padding-right: 8px;
    }
}