/* --- ESTILOS GERAIS --- */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', 'Segoe UI', sans-serif; }
body { background-color: #f8f9fa; overflow-x: hidden; color: #333; }

/* --- HEADER --- */
header { 
    background-color: var(--cor-header); 
    padding: 10px 20px; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
    position: sticky; top: 0; z-index: 1000;
}

.header-container {
    max-width: 1300px; margin: 0 auto;
    display: flex; flex-direction: column; align-items: center; gap: 15px;
}

.logo-area img { max-height: 60px; transition: 0.3s; }
.logo-area img:hover { transform: scale(1.05); }

nav { display: flex; gap: 20px; }
nav a { text-decoration: none; color: #444; font-weight: 600; font-size: 14px; text-transform: uppercase; transition: 0.3s; }
nav a:hover { color: var(--cor-primaria); }

.busca-e-carrinho {
    width: 100%;
    max-width: 500px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.busca-container { flex: 1; display: flex; position: relative; }
.busca-container input { flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 25px 0 0 25px; outline: none; padding-left: 20px; padding-right: 45px; }
.busca-container button { background: var(--cor-primaria); border: none; color: white; padding: 0 20px; border-radius: 0 25px 25px 0; cursor: pointer; }

.btn-limpar-busca {
    position: absolute;
    right: 65px;
    top: 50%;
    transform: translateY(-50%);
    text-decoration: none;
    color: #999;
    font-size: 22px;
    font-weight: bold;
    padding: 5px;
    transition: 0.3s;
    line-height: 1;
    z-index: 5;
}
.btn-limpar-busca:hover { color: var(--cor-primaria); }

/* --- CARROSSEL --- */
.slider-container { 
    width: 100%; 
    position: relative; 
    overflow: hidden; 
    background: #eee;
}
.slides-wrapper { display: flex; transition: transform 0.5s ease-in-out; width: 100%; }
.slide { min-width: 100%; box-sizing: border-box; }
.slide img { width: 100%; display: block; object-fit: cover; }
@media (min-width: 768px) { .slide img { height: 450px; } }
@media (max-width: 767px) { .slide img { height: 250px; } }

/* --- BARRA DE SEPARAÇÃO --- */
.separator-bar {
    width: 100%;
    height: 8px;
    background: linear-gradient(to bottom, #e0e0e0, #f8f9fa);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

/* --- TÍTULO DA SEÇÃO --- */
.section-title {
    text-align: center;
    margin: 40px 0 30px;
    font-size: 24px;
    font-weight: 800;
    color: #222;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--cor-primaria);
    margin: 10px auto;
    border-radius: 2px;
}

/* --- GRID PRODUTOS --- */
.main-container { max-width: 1300px; margin: 0 auto 40px; padding: 0 20px; scroll-margin-top: 100px; }
.produtos-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 20px; 
    align-items: stretch; 
}
@media (min-width: 768px) { .produtos-grid { grid-template-columns: repeat(4, 1fr); } }

.produto-card { 
    background: #ffffff;
    border-radius: var(--radius-md); 
    overflow: hidden; 
    text-align: center; 
    padding-bottom: 20px; 
    cursor: pointer; 
    border: 1px solid #eee; 
    box-shadow: var(--shadow-padrao);
    transition: all 0.4s ease;
    position: relative;
    display: flex;
    flex-direction: column; 
}
.produto-card:hover { 
    border-color: var(--cor-primaria);
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

.img-wrapper { position: relative; overflow: hidden; width: 100%; aspect-ratio: 1/1; background-color: #fff; }
.produto-card .main-img { width: 100%; height: 100%; object-fit: contain; transition: transform 0.5s ease, opacity 0.3s; }
.lupa-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0.2);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: 0.3s; color: #fff; font-size: 30px;
}
.img-wrapper:hover .lupa-overlay { opacity: 1; }
.produto-card:hover .main-img { transform: scale(1.05); }

.home-thumbs { display: flex; justify-content: center; gap: 5px; margin: 10px 0; padding: 0 5px; flex-wrap: wrap; }
.thumb-item {
    width: 35px; height: 35px; border-radius: 4px; object-fit: contain; border: 1px solid #eee; transition: 0.2s; background-color: #fff;
}
.thumb-item:hover { border-color: var(--cor-primaria); transform: scale(1.1); }

.produto-card h3 {
    font-size: 14px; color: #444; font-weight: 700; padding: 0 10px; margin-bottom: 8px; min-height: 34px; display: flex; align-items: center; justify-content: center;
}

.preco-destaque { 
    color: var(--cor-primaria); 
    font-weight: 900; 
    font-size: 20px; 
    margin: 5px 0; 
    display: block;
    flex-grow: 1; 
}

.btn-add-home {
    background: var(--cor-primaria); color: white; border: none; padding: 10px 15px; margin: 10px 15px 0; border-radius: 50px; font-size: 12px; font-weight: 800; text-transform: uppercase; cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; gap: 8px;
    flex-shrink: 0; 
}
.btn-add-home:hover { filter: brightness(1.1); transform: scale(1.05); }

/* --- MODAIS (AJUSTADOS PARA CONTEÚDO LONGO) --- */
.modal { 
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.5); 
    backdrop-filter: blur(8px); 
    overflow: hidden; /* Remove o scroll da tela de fundo */
    padding: 15px; 
    align-items: center; 
    justify-content: center;
}

.modal-content { 
    background-color: #fff; 
    width: 100%; 
    max-width: 850px; 
    max-height: 90vh; /* Limita a altura do popup a 90% da tela */
    border-radius: var(--radius-lg); 
    position: relative; 
    display: flex; 
    flex-direction: column; 
    overflow-y: auto; /* Adiciona barra de rolagem interna se o texto for grande */
    box-shadow: var(--shadow-hover);
}

@media (min-width: 768px) { 
    .modal-content { 
        flex-direction: row; 
        height: auto; 
    } 
}

.close-modal { 
    position: absolute; 
    right: 15px; 
    top: 15px; 
    font-size: 28px; 
    cursor: pointer; 
    color: #333; 
    z-index: 2100; /* Fica acima de tudo no modal */
    transition: 0.3s; 
    background: rgba(255, 255, 255, 0.9); 
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.close-modal:hover { color: var(--cor-primaria); transform: rotate(90deg); }

.modal-galeria { flex: 0 0 50%; background: #fafafa; padding: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px; }
.img-container-principal { width: 100%; max-width: 320px; background-color: #fff; border-radius: var(--radius-md); overflow: hidden; }
.img-principal { width: 100%; border-radius: var(--radius-md); object-fit: contain; aspect-ratio: 1/1; box-shadow: 0 8px 20px rgba(0,0,0,0.08); transition: opacity 0.3s; }
.thumbnails-container { display: flex; gap: 8px; width: 100%; justify-content: center; flex-wrap: wrap; padding: 5px; }

.modal-info { flex: 1; display: flex; flex-direction: column; gap: 15px; padding: 40px 30px; justify-content: center; }
.modal-preco { font-size: 28px; color: var(--cor-primaria); font-weight: 800; }
.modal-desc { font-size: 14px; color: #666; line-height: 1.5; margin: 10px 0; }

.seletor-box label { display: block; font-weight: 700; margin-bottom: 5px; color: #666; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.seletor-box select { width: 100%; padding: 10px; border: 1px solid #eee; border-radius: var(--radius-md); outline: none; background: #fdfdfd; cursor: pointer; transition: 0.3s; font-weight: 600; font-size: 14px; }

#opcoesCompraModal { display: none; margin-top: 15px; border-top: 1px solid #eee; padding-top: 15px; width: 100%; }

.qtd-container { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.btn-qtd { width: 35px; height: 35px; border-radius: 50%; border: 1px solid #ddd; background: white; cursor: pointer; font-weight: bold; }
.btn-qtd:hover { background: #f0f0f0; border-color: var(--cor-primaria); }
#inputQtd { width: 40px; text-align: center; border: none; font-weight: 700; background: transparent; }

.acoes-compra-flex { display: flex; flex-direction: column; gap: 10px; margin-top: 15px; width: 100%; }
@media (min-width: 480px) { .acoes-compra-flex { flex-direction: row; } }

.btn-confirmar-add { flex: 2; background: #1a1a1a; color: white; border: none; padding: 15px; border-radius: 50px; font-weight: 800; cursor: pointer; transition: 0.3s; font-size: 13px; text-transform: uppercase; }
.btn-confirmar-add:hover { background: var(--cor-primaria); transform: translateY(-2px); }

.btn-excluir-selecao { flex: 1; background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; padding: 15px; border-radius: 50px; font-weight: 800; cursor: pointer; transition: 0.3s; font-size: 13px; text-transform: uppercase; display: flex; align-items: center; justify-content: center; gap: 5px; }
.btn-excluir-selecao:hover { background: #f5c6cb; color: #ff4757; }

.btn-add-cart { background: #1a1a1a; color: white; border: none; padding: 15px; border-radius: 50px; font-weight: 800; cursor: pointer; transition: 0.3s; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.btn-add-cart:hover { background: var(--cor-primaria); transform: translateY(-3px); box-shadow: 0 8px 20px rgba(255, 71, 87, 0.3); }

.btn-whatsapp-finalizar { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--cor-whatsapp); color: white; text-decoration: none; padding: 18px; border-radius: 50px; font-weight: 800; font-size: 15px; transition: 0.3s; box-shadow: 0 10px 20px rgba(37, 211, 102, 0.2); }
.btn-whatsapp-finalizar:hover { transform: translateY(-3px); filter: brightness(1.1); box-shadow: 0 15px 25px rgba(37, 211, 102, 0.3); }

/* --- TOAST E CARRINHO --- */
#toastSuccess { 
    display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); 
    background: #fff; color: #333; padding: 30px 50px; border-radius: 20px; 
    font-weight: 700; z-index: 3000; box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    text-align: center; border-bottom: 4px solid #27ae60;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#toastSuccess i { font-size: 50px; color: #27ae60; margin-bottom: 15px; display: block; }
@keyframes popIn { from { opacity: 0; scale: 0.5; } to { opacity: 1; scale: 1; } }

.cart-icon-container { cursor: pointer; display: flex; align-items: center; gap: 5px; background: #fff; padding: 8px 12px; border-radius: 20px; border: 1px solid #ddd; }
.cart-count { background: var(--cor-primaria); color: white; font-size: 12px; font-weight: bold; padding: 2px 7px; border-radius: 50%; }
.modal-cart { max-width: 500px; display: block; padding: 30px; }
.cart-item { display: flex; align-items: center; gap: 15px; padding: 15px 0; border-bottom: 1px solid #eee; }
.cart-item img { width: 50px; height: 50px; object-fit: contain; background-color: #f9f9f9; border-radius: 8px; }
.btn-remove-cart { color: #ff4757; cursor: pointer; font-size: 18px; transition: 0.3s; margin-left: auto; }

footer { background-color: var(--cor-rodape); color: white; padding: 50px 20px; margin-top: 60px; text-align: center; }

@media (min-width: 768px) {
    .header-container { flex-direction: row; justify-content: space-between; }
    .produtos-grid { grid-template-columns: repeat(4, 1fr); }
}