/* =========================================
   1. VARIÁVEIS DE CORES E TEMA (MAIS SABOR - IDENTIDADE DEFINITIVA)
   ========================================= */
:root {
    --primary-color: #C55A3D; /* Terracota - Cor principal de botões e destaques */
    --primary-hover: #A84930; /* Terracota levemente escurecido para o clique */
    --secondary-color: #E07A5F; /* Terracota claro (da paleta) para gradientes */
    --background-color: #F7EFE3; /* Creme - Fundo principal do site */
    --card-bg: #ffffff; /* Fundo branco nos cards para dar contraste com o creme */
    --text-dark: #5A3E2B; /* Marrom - Cor principal dos textos e títulos */
    --text-light: #8B5E3C; /* Marrom claro (da paleta) para subtítulos e textos menores */
    --price-color: #C55A3D; /* Usando o Terracota para destacar o preço */
    --border-color: #D9C7B3; /* Creme escuro (da paleta) para bordas sutis */
    --shadow-soft: 0 4px 12px rgba(90, 62, 43, 0.05); /* Sombra suave baseada no Marrom */
    --shadow-hover: 0 8px 24px rgba(197, 90, 61, 0.15); /* Sombra de destaque baseada no Terracota */
}

/* =========================================
   2. RESET BÁSICO E TIPOGRAFIA
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-dark);
    line-height: 1.5;
}

/* =========================================
   3. CABEÇALHO E HERO SECTION (AJUSTADO)
   ========================================= */
.loja-header {
    background-color: var(--background-color); /* Usa a cor Creme (#F7EFE3) do site em vez de branco! */
    box-shadow: none; /* Remove a sombra da caixa branca antiga */
    position: relative;
    padding-bottom: 0;
}

.capa-fundo {
    width: 100%;
    height: 180px; /* Mantém a altura da capa */
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color)); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative; 
}

.overlay-escuro {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(90, 62, 43, 0.15);
}

.loja-info-container {
    margin-top: -100px; /* Puxa a metade da logo de 200px para cima do banner */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 15px 10px;
    position: relative; 
    z-index: 2; 
    background-color: transparent; /* Transparente para não cobrir o banner */
}

.loja-logo-centro {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: none;
    background-color: transparent;
    object-fit: cover;
}

.loja-nome {
    margin: 1px 0 4px 0; /* Margem reduzida: aproxima o nome da logo e do status */
    font-size: 1.6rem;
    color: var(--text-dark);
    font-weight: 700;
}

.status-badge {
    margin-top: 2px; /* Aproxima o status do nome da loja */
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mantemos o Verde/Vermelho para UX clara, mas um pouco mais terrosos */
.status-badge.aberto {
    background-color: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #C8E6C9;
}

.status-badge.fechado {
    background-color: #FFEBEE;
    color: #C62828;
    border: 1px solid #FFCDD2;
}

/* Barra de Benefícios */
.barra-beneficios {
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 12px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}
.barra-beneficios i {
    color: var(--primary-color);
    margin-right: 4px;
}

/* =========================================
   4. SISTEMA DE BUSCA E LAYOUT PRINCIPAL
   ========================================= */
.container-principal {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 15px;
}

.search-container {
    margin-bottom: 30px;
}

.search-bar {
    display: flex;
    background: #ffffff;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    padding: 5px 20px;
    align-items: center;
    border: 2px solid transparent;
    transition: border 0.3s;
}

.search-bar:focus-within {
    border: 2px solid var(--primary-color);
}

.icon-busca {
    color: var(--text-light);
    font-size: 1.1rem;
}

.search-bar input {
    width: 100%;
    padding: 12px 15px;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.search-bar button {
    background: var(--background-color);
    border: none;
    padding: 8px 12px;
    border-radius: 50%;
    color: var(--text-dark);
    cursor: pointer;
    transition: background 0.3s;
}
.search-bar button:hover {
    background: var(--border-color);
}

/* =========================================
   5. SEÇÕES E TÍTULOS
   ========================================= */
.secao-vendas {
    margin-bottom: 40px;
}

.titulo-secao {
    margin-bottom: 20px;
}

.titulo-secao h2 {
    font-size: 1.4rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}
.titulo-secao h2 i {
    color: var(--primary-color);
}
.titulo-secao .subtitulo {
    font-size: 0.9rem;
    color: var(--text-light);
}

.horizontal-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 5px 20px 5px;
    scrollbar-width: none; 
}
.horizontal-scroll::-webkit-scrollbar { display: none; }

/* =========================================
   6. DESIGN DOS CARDS DE PRODUTO
   ========================================= */
.card-produto {
    display: flex;
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    gap: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.card-produto:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: #F2C4A7; /* Cor da paleta para hover suave da borda */
}

.card-produto img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0; 
}

.card-produto .info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-produto .info span[style*="font-size: 0.8rem"] {
    background: #F2C4A7; /* Fundo pêssego da paleta */
    color: var(--text-dark) !important;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 5px;
}

.card-produto .info h3 {
    font-size: 1.05rem;
    color: var(--text-dark);
    font-weight: 600;
    line-height: 1.2;
}

.card-produto .info .descricao {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-produto .info .preco-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.card-produto .info .preco {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--price-color);
}

.card-produto .btn-add {
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(197, 90, 61, 0.3); /* Sombra Terracota */
    transition: background 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-produto .btn-add:hover {
    background-color: var(--primary-hover);
    transform: scale(1.1);
}

/* Promoções / Horizontal */
.horizontal-scroll .card-produto {
    flex-direction: column; 
    min-width: 220px; 
    max-width: 240px;
    flex-shrink: 0;
}
.horizontal-scroll .card-produto img {
    width: 100%;
    height: 150px;
}

/* =========================================
   7. BOTÕES DE AÇÃO GERAIS
   ========================================= */
.btn-acao {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: 0.3s;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.btn-primario { background: var(--primary-color); color: white; }
.btn-primario:hover { background: var(--primary-hover); }
.btn-secundario { background: var(--border-color); color: var(--text-dark); margin-bottom: 10px; }
.btn-secundario:hover { background: #C8B5A1; }

/* =========================================
   8. CARRINHO FLUTUANTE E SIDEBAR
   ========================================= */
.cart-icon {
    position: fixed; 
    bottom: 25px; 
    right: 25px; 
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    border: none;
    width: 65px; 
    height: 65px;
    border-radius: 50%;
    box-shadow: 0 6px 20px rgba(197, 90, 61, 0.4); 
    cursor: pointer;
    font-size: 1.6rem;
    z-index: 990; 
    transition: transform 0.3s ease;
}
.cart-icon:hover { transform: scale(1.1) rotate(5deg); }

.cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--text-dark); /* Cor Marrom para contraste da bolinha */
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.cart-sidebar {
    background-color: #ffffff;
    box-shadow: -5px 0 25px rgba(90, 62, 43, 0.15); /* Sombra baseada no marrom */
    position: fixed; top: 0; right: -100%; width: 100%; max-width: 400px; height: 100%; z-index: 1000; display: flex; flex-direction: column; transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); 
}
.cart-sidebar.active { right: 0; }

.cart-header {
    background: var(--background-color);
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cart-header h2 { font-size: 1.2rem; font-weight: 700; color: var(--text-dark); }
.close-cart { background: none; border: none; font-size: 1.5rem; color: var(--text-light); cursor: pointer; transition: color 0.2s; }
.close-cart:hover { color: var(--primary-color); }

.cart-items { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 15px; }

.cart-item {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--background-color); padding: 12px; border-radius: 10px;
}
.cart-item-title { font-weight: 600; font-size: 0.95rem; color: var(--text-dark); }
.cart-item-price { color: var(--price-color); font-weight: 700; font-size: 0.9rem; }

.cart-qty-control {
    display: flex; align-items: center; background: white; border-radius: 8px; border: 1px solid var(--border-color); overflow: hidden;
}
.cart-qty-control button { background: transparent; border: none; width: 30px; height: 30px; color: var(--primary-color); font-weight: bold; cursor: pointer; }
.cart-qty-control button:hover { background: var(--background-color); }
.cart-qty-control span { width: 30px; text-align: center; font-size: 0.9rem; font-weight: 600; color: var(--text-dark); }
.remove-item { color: var(--primary-color); background: none; border: none; font-size: 1.1rem; cursor: pointer; padding: 5px; margin-left: 10px;}

.cart-footer-pedido {
    background: white; padding: 25px 20px; box-shadow: 0 -4px 15px rgba(90, 62, 43, 0.05);
}
.cart-total-area { display: flex; justify-content: space-between; align-items: center; font-size: 1.1rem; font-weight: 600; margin-bottom: 20px; color: var(--text-dark); }
.valor-destaque { font-size: 1.5rem; color: var(--price-color); font-weight: 800; }

.btn-whatsapp-final {
    background: #25D366; /* Mantendo verde do whatsapp (Oficial da marca WhatsApp) */
    color: white;
    font-size: 1.1rem;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}
.btn-whatsapp-final:hover { background: #1EBE5D; transform: translateY(-2px); }

/* =========================================
   ALERTA DE CARRINHO VAZIO
   ========================================= */
.cart-warning {
    display: none; /* Esconde a mensagem por padrão */
    background-color: #FFEBEE;
    color: #C62828;
    border: 1px solid #FFCDD2;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 15px;
}

/* Quando o JavaScript adiciona a classe 'active', ele aparece! */
.cart-warning.active {
    display: block;
    animation: tremer 0.3s ease-in-out;
}

/* Efeito extra de atenção quando o cliente clica sem nada no carrinho */
@keyframes tremer {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
}


/* =========================================
   FILTROS AVANÇADOS - ESTILO CHIPS
   ========================================= */
.filtro-modal {
    position: fixed; 
    bottom: -100%; 
    left: 0; 
    width: 100%; 
    max-height: 85vh; 
    z-index: 1000; 
    display: flex; 
    flex-direction: column; 
    transition: bottom 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); 
    border-radius: 24px 24px 0 0;
    background-color: var(--background-color);
    box-shadow: 0 -10px 30px rgba(90, 62, 43, 0.15);
}

.filtro-modal.active { bottom: 0; }
.filtro-body { flex: 1; overflow-y: auto; padding: 20px; }

.filtro-grupo { 
    background-color: #ffffff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
}

.filtro-grupo h3 { 
    font-size: 1.1rem; 
    color: var(--text-dark); 
    margin-bottom: 15px; 
    font-weight: 700; 
    display: flex; align-items: center; gap: 8px;
}
.filtro-grupo h3 i { color: var(--primary-color); }
.filtro-opcoes { display: flex; flex-wrap: wrap; gap: 10px; }
.filtro-opcoes input[type="radio"] { display: none; }
.filtro-opcoes label { 
    background-color: #ffffff; 
    color: var(--text-light);
    padding: 8px 18px; 
    border-radius: 30px; 
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    user-select: none;
    display: inline-block;
}

.filtro-opcoes label:hover {
    background-color: var(--background-color);
    color: var(--text-dark);
}

.filtro-opcoes input[type="radio"]:checked + label {
    background-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(197, 90, 61, 0.3);
    border-color: var(--primary-color);
    transform: scale(1.05); 
}

/* Overlay Global Escurecido em Tom de Marrom */
.cart-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(90, 62, 43, 0.6); z-index: 999; display: none; backdrop-filter: blur(2px); }
.cart-overlay.active { display: block; }

/* =========================================
   9. RODAPÉ
   ========================================= */
footer { 
    background: var(--text-dark); 
    color: white; 
    padding: 40px 20px; 
    text-align: center; 
    margin-top: 40px;
}
.footer-info h3 { 
    font-size: 1.5rem; 
    margin-bottom: 10px; 
    color: var(--background-color); 
}
.footer-info p { 
    color: #D9C7B3; 
    margin-bottom: 20px; 
}
.sociais-footer { 
    display: flex; 
    justify-content: center; 
    align-items: center; /* Mantém os itens perfeitamente alinhados na mesma linha */
    gap: 20px; 
    font-size: 0.95rem; 
    flex-wrap: wrap;
}
.sociais-footer a, .sociais-footer span { 
    color: white; 
    text-decoration: none; 
    display: flex; 
    align-items: center; 
    gap: 8px;
    transition: color 0.3s ease; /* Transição suave */
}
.sociais-footer a:hover { 
    color: var(--secondary-color); 
}

/* =========================================
   11. MODAL DE DETALHES DO PRODUTO
   ========================================= */
#modal-produto-detalhe {
    padding: 0; 
    overflow: hidden;
}

#modal-produto-detalhe .modal-detalhe-header {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-soft);
}

.modal-detalhe-body {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: calc(85vh - 80px); 
}

.modal-detalhe-body img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.modal-detalhe-body h2 {
    padding: 15px 20px 5px;
    font-size: 1.4rem;
    color: var(--text-dark);
}

.descricao-detalhe {
    padding: 0 20px 15px;
    color: var(--text-light);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color);
}

.secao-observacoes {
    padding: 20px;
}

.secao-observacoes h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.secao-observacoes textarea {
    width: 100%;
    height: 80px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    resize: none;
    outline: none;
    background-color: var(--background-color);
    color: var(--text-dark);
    transition: 0.3s;
}

.secao-observacoes textarea:focus {
    border-color: var(--primary-color);
    background-color: #ffffff;
}

.quantidade-controle-modal {
    display: flex;
    align-items: center;
    background: var(--background-color);
    border-radius: 8px;
    margin-right: 15px;
}

.quantidade-controle-modal button {
    background: transparent;
    border: none;
    width: 40px;
    height: 45px;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.4rem;
    cursor: pointer;
}

.quantidade-controle-modal span {
    width: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-dark);
}

/* =========================================
   10. RESPONSIVIDADE (DESKTOP E TABLET)
   ========================================= */
@media (min-width: 768px) {
    .product-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .product-list .card-produto { margin-bottom: 0; }
    .filtro-modal { width: 450px; left: 50%; transform: translateX(-50%); bottom: auto; top: -100%; border-radius: 16px; }
    .filtro-modal.active { top: 50%; bottom: auto; transform: translate(-50%, -50%); }
}

@media (min-width: 1024px) {
    .product-list { grid-template-columns: repeat(3, 1fr); gap: 25px; }
    .cart-icon { right: 40px; bottom: 40px; width: 75px; height: 75px; font-size: 1.8rem; }
    .cart-count { width: 28px; height: 28px; font-size: 1rem; }
    .capa-fundo { height: 220px; }
    .loja-logo-centro { width: 140px; height: 140px; }
    
    .card-produto:hover {
        transform: translateY(-5px);
    }
}