/* --- ESTILOS GERAIS (CSS) --- */
:root {
    --primary-color: #CB9B2A; /* Rosa Confeitaria */
    --primary-color1: #d85c86;
    --secondary-color: #AF7E33; /* Marrom Chocolate */
    --secondary-color1: #5d4037;
    --accent-color: #ecdb8b69; /* Fundo claro */
    --card-bg: #ffffff;
    --text-color: #AF7E33;
    --text-color1: #333;
    --radius: 15px;
    --rosa-ygor: #F3E5F5
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

body {
    /* Imagem de fundo da página (Substitua a URL abaixo) */
    background-image: url('./Background_pages.png'); 
    background-attachment: fixed;
    background-size: cover;
    background-repeat: no-repeat;
    color: var(--text-color);
    padding-bottom: 80px; /* Espaço para o footer mobile */
}

/* --- HEADER --- */
header {
    
    padding: 20px;
    text-align: center;
    
    position: relative;
    top: 0;
    z-index: 1000;
    
}

/* --- ANIMAÇÃO DE CARREGAMENTO (BTN LOADING) --- */

/* Cria o movimento do degradê */
@keyframes gradient-move {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Classe que será adicionada via Javascript */
.btn-loading {
    /* O texto original do botão */
    color: white !important;
    
    /* O fundo degradê (Rosa Escuro -> Rosa Claro -> Rosa Escuro) */
    background: linear-gradient(45deg, #e4a20a, #d8b665, #e4a20a, #AF7E33) !important;
    background-size: 300% 300% !important;
    
    /* Ativa a animação */
    animation: gradient-move 2s ease infinite !important;
    
    /* Deixa o botão sem clique enquanto carrega */
    cursor: wait !important;
    opacity: 0.9;
    pointer-events: none; /* Impede clicar duas vezes */
    border: none !important;
}

.logo-area h1 {
    color: var(--primary-color);
    font-family: 'Georgia', serif;
    font-size: 2.5rem;
}

.logo-area p { color: var(--secondary-color); }

/* --- LAYOUT PRINCIPAL --- */
.container {
    display: flex;
    max-width: 1800px;
    margin: 20px auto;
    gap: 20px;
    padding: 0 15px;
}

/* --- SIDEBAR (ASIDE) --- */
aside {
    flex: 0 0 250px;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: var(--radius);
    height: fit-content;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

aside h3 { margin-bottom: 15px; color: var(--secondary-color); }

.search-box { width: 100%; padding: 10px; margin-bottom: 20px; border: 1px solid var(--secondary-color); border-radius: 8px; }
.filter-group { margin-bottom: 20px; }
.filter-group label { display: block; margin-bottom: 8px; cursor: pointer; accent-color: var(--secondary-color);}
.sort-select { width: 100%; padding: 8px; border-radius: 8px; border: 1px solid var(--secondary-color); margin-bottom: 20px; color: var(--secondary-color); }

/* --- CATÁLOGO DE PRODUTOS --- */
.catalog-section {
    flex: 1;
    /* Fundo diferente para área de produtos com pontas arredondadas */
    background-color: rgba(255, 255, 255, 0.50); 
    padding: 20px;
    border-radius: var(--radius);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* Aumentei um pouco a largura mínima para caber as setas */
    gap: 20px;
}

/* CARD DO PRODUTO */
.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden; /* Importante para o carrossel */
}

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

.product-title {
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
    color: var(--secondary-color);
    font-size: 1.1rem;
    white-space: nowrap; /* Evita quebra de linha em títulos longos */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- NOVO CSS DO CARROSSEL INTERATIVO --- */
.carousel-container {
    position: relative;
    width: 100%;
    height: 200px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    height: 100%;
    scrollbar-width: none; /* Firefox */
    scroll-behavior: smooth; /* Rolagem suave ao clicar */
}
.carousel-track::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.carousel-track img {
    scroll-snap-align: center;
    min-width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Botões de navegação (setas) */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: #cb9b2a52;
    color: rgba(255, 255, 255, 0.623);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}
.carousel-btn:hover { background-color: #af7d33c2; }
.carousel-btn.prev { left: 5px; }
.carousel-btn.next { right: 5px; }
/* Esconde botões se tiver apenas 1 imagem */
.hidden-btn { display: none; }

/* Contador de imagens */
.carousel-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: #cb9b2ae1;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    z-index: 2;
}
/* ------------------------------------ */
.price {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: bold;
    margin: 5px 0;
    text-align: center;
}

.controls {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

.qty-input { width: 50px; padding: 5px; text-align: center; border: 1px solid var(--primary-color); border-radius: 5px; color: var(--secondary-color); }

.btn-add {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    flex: 1;
}
.btn-add:hover { background-color: var(--secondary-color); }

/* --- CHECKOUT --- */
#checkout-section {
    background-color: white; max-width: 1200px; margin: 30px auto; padding: 30px;
    border-radius: var(--radius); box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    transition: opacity 0.3s; /* Suavizar aparecimento */
}
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.cart-table th, .cart-table td { padding: 10px; text-align: left; border-bottom: 1px solid #eee; }
.total-row { font-size: 1.5rem; font-weight: bold; color: var(--secondary-color); text-align: right; }

.payment-methods { display: flex; gap: 20px; margin-top: 30px; flex-wrap: wrap; }
.btn-payment {
    border: 2px solid #ddd; padding: 15px; border-radius: 10px; flex: 1;
    cursor: pointer; text-align: center; transition: 0.2s;
}
.btn-payment.selected { border-color: var(--primary-color); background-color: var(--accent-color); box-shadow: 0 0 0 2px var(--primary-color) inset; }

.btn-finish {
    width: 100%; margin-top: 20px; padding: 15px; background: #2ecc71; color: white;
    border: none; font-size: 1.2rem; border-radius: 10px; cursor: pointer;
}

/* --- BARRA FLUTUANTE (AGORA VISÍVEL PC E MOBILE) --- */
#floating-cart-bar {
    display: flex; /* Visível por padrão em todas telas */
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%;
    background-color: var(--secondary-color); 
    color: white; 
    padding: 15px 30px; /* Mais padding lateral */
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2); 
    z-index: 2000;
    justify-content: space-between; 
    align-items: center;
    
    /* Animação para esconder/mostrar */
    transition: transform 0.4s ease-in-out, opacity 0.4s;
    transform: translateY(0); /* Posição normal */
    opacity: 1;
}

/* Classe para esconder a barra (empurra para baixo) */
#floating-cart-bar.bar-hidden {
    transform: translateY(100%); /* Desce 100% da própria altura */
    opacity: 0;
}

#floating-cart-bar button {
    background-color: #fff; color: var(--secondary-color); border: none;
    padding: 10px 30px; border-radius: 30px; font-weight: bold; cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}
#floating-cart-bar button:hover { background-color: #f0f0f0; }

/* --- MODAL DE PAGAMENTO PIX (NOVO) --- */
.modal-overlay {
    display: none; /* Escondido por padrão */
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); z-index: 3000;
    align-items: center; justify-content: center;
}
.modal-content {
    background: white; padding: 30px; border-radius: 20px;
    max-width: 400px; width: 90%; text-align: center; position: relative;
}
#qrcode-container { margin: 20px auto; display: flex; justify-content: center; }
#qrcode-container img { border: 5px solid white; box-shadow: 0 0 10px rgba(0,0,0,0.1); }
.pix-code-box {
    background: #f0f0f0; padding: 10px; word-break: break-all;
    font-family: monospace; font-size: 0.8rem; margin: 15px 0; border-radius: 5px;
    max-height: 100px; overflow-y: auto; text-align: left;
}
.btn-copy {
    background: var(--primary-color); color: white; border: none; padding: 10px 20px;
    border-radius: 50px; cursor: pointer; font-weight: bold; margin-bottom: 10px; width: 100%;
}
.close-modal {
    position: absolute; top: 10px; right: 15px; font-size: 24px; cursor: pointer; color: #aaa;
}

/* --- ESTILOS DO FAQ (PERGUNTAS FREQUENTES) --- */
#faq-section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 15px;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.faq-item {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border-left: 5px solid var(--primary-color); /* Detalhe rosa na lateral */
    transition: transform 0.3s ease;
}

.faq-item:hover {
    transform: translateY(-5px); /* Leve subida ao passar o mouse */
}

.faq-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.faq-item h4 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.faq-item p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
}

footer { background-color: #33333363; color: white; align-items: center; padding: 15px; margin-top: 50px; margin-bottom: -80px; }

footer h4 {
    text-align: center;
}

footer a {
    text-decoration: none; 
    color: #fff;
}

/* --- BOTÃO FLUTUANTE VOLTAR AO TOPO --- */
#btnVoltarTopo {
    display: none; /* Começa invisível */
    position: fixed; /* Fixo na tela */
    bottom: 80px;    /* Distância do fundo */
    right: 20px;     /* Distância da direita */
    z-index: 9999;   /* Fica acima de tudo */
    font-size: 1.5rem;
    border: none;
    outline: none;
    background-color: #CB9B2A; /* Rosa da sua marca */
    color: white;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%; /* Deixa redondo */
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); /* Sombra */
    transition: background-color 0.3s, transform 0.3s;
}

#btnVoltarTopo:hover {
    background-color: #AF7E33; /* Muda para marrom ao passar o mouse */
    transform: scale(1.1); /* Aumenta um pouquinho */
}

@media (max-width: 768px) {
    .logo-area { 
        display: flex; 
        flex-direction: column; /* Para organizar itens verticalmente */
        align-items: center; /* Centraliza horizontalmente */
        justify-content: center; /* Centraliza verticalmente (se houver altura) */}
    .container { flex-direction: column; max-width: 400px; }
    aside { width: 100%; }
    #checkout-section { margin-bottom: 80px; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(60%, 1fr)); gap: 10px; }
    #floating-cart-bar { padding: 15px; } /* Menor padding no mobile */
    svg { width: 5%; height: 5%;}
}
