/* Importação de fonte moderna */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
    --primary: #3483fa; /* Azul Mercado Livre */
    --whatsapp: #25d366;
    --whatsapp-dark: #128c7e;
    --shopee: #ee4d2d;
    --bg: #f8f9fa;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --white: #ffffff;
    --shadow: 0 10px 20px rgba(0,0,0,0.05);
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
}

/* --- HEADER E NAVEGAÇÃO --- */
header {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 1.5rem 0 0 0;
    text-align: center;
    /* Alterado de sticky para relative */
    position: relative; 
    top: auto;
    z-index: 1000;
    margin-bottom: 1rem; /* Adicionado um espaço entre o header e os cards */
}

.header-top {
    margin-bottom: 15px;
}

.main-logo {
    max-width: 180px;
    height: auto;
    transition: transform 0.3s;
}

.main-logo:hover {
    transform: scale(1.05);
}

.header-search {
    padding: 0 1rem;
    margin-bottom: 20px;
}

.busca-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    gap: 10px;
}

.busca-form input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #dfe6e9;
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

.busca-form input:focus {
    border-color: var(--primary);
}

.busca-form button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
}

.marcas-menu {
    background: #fdfdfd;
    border-top: 1px solid #eee;
    overflow-x: auto;
    white-space: nowrap;
}

.marcas-menu ul {
    list-style: none;
    display: flex;
    justify-content: center;
    padding: 12px 0;
    max-width: 1200px;
    margin: 0 auto;
}

.marcas-menu li { margin: 0 15px; }

.marcas-menu a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.marcas-menu a:hover { color: var(--primary); }
.marcas-menu .ver-todos { color: #e67e22; }

/* --- GRID E CARDS --- */
.container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    padding: 2rem;
    max-width: 1300px;
    margin: 0 auto;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    transition: 0.3s;
    border: 1px solid rgba(0,0,0,0.03);
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.card img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    background: #fdfdfd;
    margin-bottom: 1rem;
}

.card h3 {
    font-size: 1rem;
    height: 45px;
    overflow: hidden;
    margin-bottom: 10px;
}

.price {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stock {
    font-size: 0.75rem;
    background: #f1f2f6;
    padding: 3px 10px;
    border-radius: 4px;
    width: fit-content;
    margin-bottom: 15px;
}

/* --- ÁREA DE BOTÕES --- */
.botoes-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

.btn {
    display: block;
    text-align: center;
    text-decoration: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s;
    border: none;
}

.btn-whats { background-color: var(--whatsapp-dark); color: white; }
.btn-add-cesta { background-color: transparent; color: var(--whatsapp); border: 2px solid var(--whatsapp); }
.btn-shopee { background-color: var(--shopee); color: white; }
.btn-mercadolivre { background-color: var(--primary); color: white; }
.btn-indisponivel { background-color: #bdc3c7; color: white; cursor: not-allowed; }

.btn:hover:not(:disabled) { filter: brightness(0.9); transform: scale(1.02); }

.prod_msg { font-size: 10px; color: var(--text-muted); text-align: center; margin-top: 8px; }

/* --- ITENS ESGOTADOS --- */
.card-esgotado {
    opacity: 0.4;
    filter: grayscale(1);
    pointer-events: none;
}
.card-esgotado .stock { background: #ff7675; color: white; }

/* --- CESTA FLUTUANTE --- */
#cesta-flutuante {
    position: fixed; bottom: 20px; right: 20px;
    background: var(--whatsapp); color: white;
    width: 60px; height: 60px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.3); z-index: 2000;
}

#cesta-contador {
    position: absolute; top: -5px; right: -5px;
    background: #ff4757; color: white; border-radius: 50%;
    padding: 4px 8px; font-size: 12px; font-weight: bold;
}

#modal-cesta {
    position: fixed; bottom: 90px; right: 20px;
    width: 320px; max-height: 450px; background: white;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2); border-radius: 12px;
    padding: 20px; overflow-y: auto; z-index: 2000;
}

.cesta-header { display: flex; justify-content: space-between; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.item-cesta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 0.85rem; }
.item-cesta button { color: #ff4757; background: none; border: none; cursor: pointer; font-weight: bold; }
.cesta-footer { border-top: 1px solid #eee; padding-top: 15px; margin-top: 10px; }

/* Notificação Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--whatsapp);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 3000;
    font-weight: 600;
    display: none; /* Escondido por padrão */
    animation: slideIn 0.5s forwards, slideOut 0.5s 2.5s forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Botão Fechar do Modal da Cesta */
.btn-fechar-cesta {
    background: #f1f2f6;
    color: var(--text-muted);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding-bottom: 4px; /* Ajuste fino para centralizar o caractere × */
}

.btn-fechar-cesta:hover {
    background-color: #ff7675; /* Vermelho suave ao passar o mouse */
    color: white;
    transform: rotate(90deg); /* Efeito de rotação moderno */
}

.cesta-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 10px;
}

.cesta-header h3 {
    font-size: 1.2rem;
    color: var(--text-main);
    font-weight: 700;
}

/* --- FOOTER --- */
footer {
    background-color: var(--white);
    border-top: 1px solid #eee;
    padding: 3rem 0 1rem 0;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-logo img {
    max-width: 150px;
    margin-bottom: 10px;
}

.footer-logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

.footer-social h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-main);
}

.instagram-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1rem;
    padding: 10px 20px;
    border-radius: 50px;
    background: #fdfdfd;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

.instagram-link img {
    width: 24px;
    height: 24px;
}

.instagram-link:hover {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%,#d6249f 60%,#285AEB 90%);
    color: white;
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(214, 36, 159, 0.3);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #f1f1f1;
    margin-top: 3rem;
    padding-top: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}
/* Área do Total e Limpar */
.cesta-total-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.btn-limpar-cesta {
    background: none;
    border: 1px solid #ff7675;
    color: #ff7675;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-limpar-cesta:hover {
    background-color: #ff7675;
    color: white;
}

/* Ajuste no botão de finalizar para ocupar a largura toda */
.cesta-footer .btn-whats {
    width: 100%;
    display: block;
} 

/* --- RESPONSIVIDADE --- */
@media (max-width: 768px) {
    .container { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); padding: 1rem; gap: 15px; }
    .card img { height: 130px; }
    .main-logo { max-width: 150px; }
    .marcas-menu ul { justify-content: flex-start; padding-left: 15px; }
    #modal-cesta { width: 90%; right: 5%; left: 5%; }
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}