:root {
    --bg-color: #F9F7F2;
    --card-bg: #FFFFFF;
    --text-primary: #4A403A;
    --text-secondary: #8C8581;
    --accent-gold: #D4C4A8;
    --accent-dark: #2C2A28;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Lato', sans-serif;
    --transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* O fundo que cobre a tela */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff; /* Cor de fundo (pode ser a cor institucional) */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s;
}

/* Estilo da Logo */
.pulsing-logo {
    width: 100px; /* Ajuste o tamanho da logo aqui */
    height: auto;
    animation: pulse 1.5s infinite ease-in-out; /* Velocidade da pulsação */
}

/* A animação de Pulso */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1); /* Aumenta 10% */
        opacity: 0.7; /* Fica um pouco transparente */
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Classe para esconder */
.preloader-hide {
    opacity: 0;
    visibility: hidden;
}

body {
    background-color: var(--bg-color);
    font-family: var(--font-sans);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden; /* Evita scroll horizontal */
}

/* --- 2. Header --- */
header {
    position: fixed;
    top: 0; width: 100%;
    padding: 1.2rem 5%;
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(249, 247, 242, 0.95);
    backdrop-filter: blur(8px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

/* O contêiner do botão Home */
.nav-left {
    flex: 1; /* Ocupa espaço igual ao lado direito */
    display: flex;
    justify-content: flex-start; /* Alinha conteúdo à esquerda */
}

/* O contêiner do botão Carrinho */
.nav-right {
    flex: 1; /* Ocupa espaço igual ao lado esquerdo */
    display: flex;
    justify-content: flex-end; /* Alinha conteúdo à direita */
}

.home-btn {
    text-decoration: none; color: var(--text-primary);
    text-transform: uppercase; letter-spacing: 2px; font-size: 0.8rem;
}

/*
.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}*/

/*.brand-logo img {
    height: 50px; /* Altura fixa para manter o header elegante. Ajuste se necessário.
    width: auto;
    object-fit: contain;
}*/
.brand-logo {
    /* Removemos absolute, left, top, transform */
    display: flex;
    align-items: center;
    justify-content: center;
    /* Se quiser garantir que ela não estique: */
    flex: 0 0 auto; 
}

/* Mantenha o controle de altura da imagem como você já tinha */
.brand-logo img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

/* Ajuste específico para mobile se quiser a logo menor */
@media (max-width: 768px) {
    .brand-logo img {
        height: 40px; /* Logo um pouco menor no celular */
    }
}

.cart-trigger {
    background: none; border: none; cursor: pointer;
    font-family: var(--font-sans); text-transform: uppercase;
    letter-spacing: 1px; font-size: 0.8rem;
    display: flex; align-items: center; gap: 8px;
    transition: opacity 0.3s;

    /* --- CORREÇÃO DE COR MOBILE --- */
    color: var(--text-primary) !important; /* Força a cor marrom */
    text-decoration: none !important; /* Remove sublinhado se houver */
    -webkit-text-fill-color: var(--text-primary); /* Garante cor no iOS */
}
.cart-trigger:hover { opacity: 0.7; }
.cart-count { font-weight: bold; }

/* --- 3. Hero & Grid --- */
.hero { padding: 80px 5% 30px; text-align: center; }
.hero h1 {
    font-family: var(--font-serif); font-size: 3rem; margin-bottom: 1rem;
    animation: fadeInUp 1s forwards; opacity: 0; transform: translateY(20px);
}
.hero p {
    color: var(--text-secondary); max-width: 600px; margin: 0 auto;
    animation: fadeInUp 1s 0.3s forwards; opacity: 0; transform: translateY(20px);
}

.catalog-container {
    /*
    max-width: 1400px; margin: 0 auto; padding: 0 5% 100px;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    */
    max-width: 1400px; 
    margin: 0 auto; 
    padding: 0 5% 100px;
    display: grid; 
    /* Trocamos auto-fill por auto-fit para o sistema de centralização funcionar melhor */
    grid-template-columns: repeat(auto-fit, minmax(280px, 320px)); 
    gap: 30px;
    justify-content: center; /* ISSO CENTRALIZA OS CARDS */
}

.product-card {
    background: var(--card-bg); border-radius: 2px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
    transition: var(--transition); cursor: pointer;
    display: flex; flex-direction: column; overflow: hidden;
    opacity: 0; transform: translateY(30px);
}
.product-card.visible { opacity: 1; transform: translateY(0); }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0,0,0,0.06); }

.card-image-wrapper { height: 320px; overflow: hidden; background-color: #f0f0f0; }
.card-image-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s ease; }
.product-card:hover .card-image-wrapper img { transform: scale(1.05); }

.card-info { padding: 20px; text-align: center; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; }
.card-title { font-family: var(--font-serif); font-size: 1.3rem; margin-bottom: 5px; color: var(--accent-dark); }
.card-price { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 15px; }

.btn-elegant {
    display: block; width: 100%; padding: 12px;
    background: transparent; border: 1px solid var(--text-primary);
    color: var(--text-primary); text-transform: uppercase;
    letter-spacing: 2px; font-size: 0.7rem; cursor: pointer;
    transition: var(--transition);
}
.btn-elegant:hover { background: var(--text-primary); color: #fff; }

/* --- 4. Modal de Produto --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(44, 42, 40, 0.4); backdrop-filter: blur(4px);
    z-index: 2000; opacity: 0; visibility: hidden; transition: var(--transition);
    display: flex; justify-content: center; align-items: center; padding: 20px;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

/*
.modal-content {
    background: var(--bg-color); width: 100%; max-width: 900px; max-height: 90vh;
    overflow-y: auto; display: flex; box-shadow: 0 30px 60px rgba(0,0,0,0.15);
    transform: scale(0.95); transition: var(--transition); position: relative;
}
*/
/* --- Ajuste do Modal para Formato Vertical --- */
.modal-content {
    background: var(--bg-color); 
    width: 100%; 
    max-width: 550px; /* Reduzi a largura para ficar elegante na vertical */
    max-height: 90vh;
    overflow-y: auto; 
    display: flex; 
    flex-direction: column; /* Força imagem em cima e texto embaixo */
    box-shadow: 0 30px 60px rgba(0,0,0,0.15);
    transform: scale(0.95); 
    transition: var(--transition); 
    position: relative;
    border-radius: 8px; /* Opcional: cantos levemente arredondados */
}

.modal-overlay.active .modal-content { transform: scale(1); }

.close-modal {
    position: absolute; top: 15px; right: 20px; font-size: 2rem;
    background: none; border: none; cursor: pointer; color: var(--text-primary); z-index: 10;
}

/*.modal-img-col { width: 50%; background: #ddd; }*/
.modal-img-col { 
    width: 100% !important; /* Força largura total */
    height: 350px; /* Altura fixa para a imagem não ocupar a tela toda */
}


.modal-img-col img { width: 100%; height: 100%; object-fit: cover; }

/*.modal-text-col { width: 50%; padding: 40px; display: flex; flex-direction: column; }*/
.modal-text-col { 
    width: 100% !important; /* Força largura total */
    padding: 30px; 
}

.modal-title { font-family: var(--font-serif); font-size: 2rem; margin-bottom: 10px; }

/*.modal-desc { color: var(--text-secondary); margin-bottom: 25px; font-size: 0.95rem; }*/
/* Ajuste fino na descrição para não sobrar espaço */
.modal-desc { 
    color: var(--text-secondary); 
    margin-bottom: 20px; 
    font-size: 1rem; 
}

/*
.prep-box {
    background: #FFF; padding: 20px; border-left: 2px solid var(--accent-gold); margin-bottom: 25px;
}
.prep-title { font-family: var(--font-serif); font-size: 1rem; margin-bottom: 8px; color: var(--accent-dark); text-transform: uppercase; }
.prep-steps { font-size: 0.85rem; color: var(--text-primary); }*/

/* Controles de Quantidade no Modal */
.qty-wrapper {
    display: flex; align-items: center; gap: 15px; margin-bottom: 20px;
}
.qty-label { text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1px; }
.qty-selector {
    display: flex; border: 1px solid #ddd;
}
.qty-btn {
    background: none; border: none; padding: 10px 15px; cursor: pointer; font-size: 1.1rem;
    transition: 0.2s;
}
.qty-btn:hover { background: #eee; }
.qty-display { padding: 10px 15px; min-width: 40px; text-align: center; font-weight: bold; }

.btn-add-cart {
    background-color: var(--accent-dark); color: white; border: none;
    padding: 16px; text-transform: uppercase; letter-spacing: 2px; font-size: 0.85rem;
    cursor: pointer; transition: var(--transition); width: 100%;
}
.btn-add-cart:hover { background-color: #4a403a; }

/* --- 5. Carrinho Lateral (Drawer) --- */
.cart-sidebar {
    position: fixed; top: 0; right: -400px; width: 400px; height: 100%;
    background: #FFF; z-index: 3000; box-shadow: -5px 0 30px rgba(0,0,0,0.1);
    transition: right 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex; flex-direction: column;
    max-width: 85vw; /* Responsivo mobile */
}
.cart-sidebar.open { right: 0; }

.cart-header {
    padding: 25px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center;
}
.cart-header h2 { font-family: var(--font-serif); font-size: 1.5rem; }
.close-cart { background: none; border: none; font-size: 1.5rem; cursor: pointer; }

.cart-items { flex-grow: 1; overflow-y: auto; padding: 25px; }
.empty-msg { text-align: center; color: var(--text-secondary); margin-top: 40px; }

.cart-item {
    display: flex; gap: 15px; margin-bottom: 20px; border-bottom: 1px solid #f9f9f9; padding-bottom: 20px;
}
.cart-item-img { width: 70px; height: 70px; object-fit: cover; border-radius: 2px; }
.cart-item-details { flex-grow: 1; }
.cart-item-name { font-family: var(--font-serif); font-size: 1rem; margin-bottom: 5px; }
.cart-item-price { color: var(--text-secondary); font-size: 0.9rem; }
.cart-item-controls { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }

.cart-qty-mini { display: flex; border: 1px solid #eee; }
.cart-qty-btn { padding: 2px 8px; border: none; background: none; cursor: pointer; }
.cart-qty-num { padding: 2px 8px; font-size: 0.9rem; }

.remove-btn { font-size: 0.7rem; color: #a00; text-transform: uppercase; cursor: pointer; background: none; border: none; letter-spacing: 1px; }

.cart-footer { padding: 30px; border-top: 1px solid #eee; background: #F9F7F2; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.2rem; font-weight: bold; margin-bottom: 20px; font-family: var(--font-serif); }

.btn-whatsapp {
    width: 100%; background-color: #25D366; color: white; border: none;
    padding: 15px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600;
    cursor: pointer; display: flex; justify-content: center; gap: 10px; align-items: center;
    transition: var(--transition);
}
.btn-whatsapp:hover { background-color: #1ebc57; }

/* Toast Notification */
.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: var(--accent-dark); color: #fff; padding: 12px 25px;
    border-radius: 30px; opacity: 0; pointer-events: none; transition: 0.3s;
    z-index: 4000; font-size: 0.9rem;
}
.toast.show { opacity: 1; bottom: 40px; }

/* Animations & Responsive */
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }

/*
@media (max-width: 768px) {
    .hero h1 { font-size: 2.2rem; }
    .modal-content { flex-direction: column; }
    .modal-img-col, .modal-text-col { width: 100%; }
    .modal-img-col { height: 250px; }
    .modal-text-col { padding: 25px; }
}*/
/* ... (Mantenha o CSS anterior até chegar na parte do .cart-trigger) ... */

/* Adicione estas classes novas logo após .cart-trigger no seu CSS */
.cart-icon {
    display: none; /* Escondido no desktop */
    width: 20px;
    height: 20px;
    fill: var(--text-primary);
}

.cart-text {
    display: inline; /* Texto visível no desktop */
}

/* ... (Mantenha o resto do CSS) ... */

/* --- ATUALIZE A SEÇÃO @MEDIA NO FINAL DO CSS --- */
@media (max-width: 768px) {

    /* NOVA REGRA: Reduz o espaço no topo para o título subir */
    .hero { 
        padding: 100px 5% 40px; /* Era 140px no desktop, agora 100px no mobile */
    }

    .hero h1 { font-size: 2.2rem; }
    .modal-content { flex-direction: column; }
    .modal-img-col, .modal-text-col { width: 100%; }
    .modal-img-col { height: 250px; }
    .modal-text-col { padding: 25px; }

    /* NOVA REGRA: Centralizar Logo Absolutamente */
    .brand-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .brand-logo img{
        height: 40px;
    }
    
    /* NOVA REGRA: Trocar texto por ícone */
    .cart-text { display: none; } /* Esconde a palavra Carrinho */
    .cart-icon { display: block; } /* Mostra o ícone */
    
    /* Ajuste fino para o botão ficar alinhado */
    .cart-trigger {
        gap: 5px;
        padding: 5px; /* Reduz padding para economizar espaço */
    }
}