/* =========================================
   1. RESET E VARIÁVEIS GERAIS
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #121212;       /* Fundo escuro */
    --card-bg: #1e1e1e;        /* Fundo dos cartões */
    --primary: #25D366;        /* Verde WhatsApp */
    --accent: #0070c9;         /* Azul da Marca */
    --text-main: #ffffff;      /* Texto principal */
    --text-sec: #b0b0b0;       /* Texto secundário */
    --font: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font);
    padding-bottom: 0;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

/* TRAVA ROLAGEM NO MODAL */
body.no-scroll {
    overflow: hidden;
}

/* BARRA DE ROLAGEM DARK */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #121212; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 15px;
}

/* =========================================
   2. CABEÇALHO (HEADER)
   ========================================= */
header {
    background-color: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo-img {
    height: 40px;
    width: auto;
    display: block;
}

.whatsapp-btn-header {
    text-decoration: none;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.3s;
}

.whatsapp-btn-header:hover {
    background-color: var(--primary);
    color: white;
}

/* =========================================
   3. BANNER ROTATIVO (CORREÇÃO TOTAL)
   ========================================= */
.banner-area {
    margin-bottom: 20px;
    padding: 0; /* Sem margem lateral no mobile */
}

.banner-slider {
    position: relative;
    width: 100%;
    
    /* Define uma caixa retangular (proporção 2.5 de largura por 1 de altura) */
    aspect-ratio: 2.5 / 1; 
    
    border-radius: 0;
    overflow: hidden;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background-color: #000; /* Fundo preto se a imagem não preencher */
}

.banner-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    
    /* O SEGREDO: 'contain' garante que a imagem apareça 100% inteira, sem cortes */
    object-fit: contain; 
    object-position: center;
    
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
}

.banner-slide.active {
    opacity: 1;
    z-index: 2;
}

/* Setas */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    width: 30px; height: 30px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 15;
    display: flex; align-items: center; justify-content: center;
}
.prev-btn { left: 5px; }
.next-btn { right: 5px; }

/* Bolinhas */
.slider-dots {
    position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 8px; z-index: 15;
}
.dot { width: 8px; height: 8px; background-color: rgba(255,255,255,0.5); border-radius: 50%; transition: 0.3s; cursor: pointer; }
.dot.active { background-color: var(--primary); transform: scale(1.3); }

/* =========================================
   4. FILTROS (CATEGORIAS E TAGS)
   ========================================= */
.categories, .tags-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    white-space: nowrap;
    padding: 5px 15px 15px 15px;
    margin-bottom: 5px;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
}
.categories::-webkit-scrollbar, .tags-container::-webkit-scrollbar { display: none; }

.cat-btn, .tag-btn {
    flex-shrink: 0;
    background: var(--card-bg);
    color: var(--text-sec);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: var(--font);
    transition: 0.2s;
}

.cat-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 112, 201, 0.3);
}

.tag-btn { padding: 6px 14px; font-size: 0.8rem; background: transparent; border: 1px solid #333; }
.tag-btn.active-tag { background: #333; color: white; border-color: #666; }
.tag-label { display: none; }

.section-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 4px solid var(--accent);
    line-height: 1;
    color: #fff;
    margin-top: 20px;
}

/* =========================================
   5. CARROSSEL E GRADE
   ========================================= */
.carousel {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 15px 25px 15px;
    scroll-snap-type: x mandatory;
    margin-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel .product-card { min-width: 220px; max-width: 220px; scroll-snap-align: start; }

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding-bottom: 20px;
}

/* =========================================
   6. CARD PRODUTO
   ========================================= */
.product-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.img-box {
    width: 100%;
    height: 160px;
    background: #2a2a2a;
    position: relative;
    flex-shrink: 0;
}
.img-box img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.discount-tag {
    position: absolute; top: 8px; right: 8px;
    background: #ff4757; color: white;
    padding: 4px 8px; border-radius: 6px; font-size: 0.7rem; font-weight: bold; z-index: 2;
}
.details {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}
.details h3 {
    font-size: 0.9rem; line-height: 1.3; color: #fff; margin-bottom: 8px;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden; height: 2.6em;
}
.price-area { margin-top: 5px; margin-bottom: 10px; }
.old-price { text-decoration: line-through; color: #777; font-size: 0.75rem; margin-right: 5px; }
.new-price { font-size: 1rem; font-weight: 700; color: var(--primary); }
.btn-buy {
    background: var(--primary); color: white; text-decoration: none;
    padding: 10px; border-radius: 8px; font-size: 0.9rem; font-weight: 600;
    text-align: center; width: 100%; display: block; border: none;
    cursor: pointer; transition: 0.2s;
}
.btn-buy:active { transform: scale(0.96); }

/* =========================================
   7. RODAPÉ
   ========================================= */
footer {
    background-color: #0f0f0f;
    border-top: 1px solid #222;
    padding: 40px 0 20px 0;
    margin-top: 40px;
}
.footer-content { display: grid; grid-template-columns: 1fr; gap: 30px; margin-bottom: 30px; }
.footer-logo { width: 150px; display: block; margin-bottom: 15px; }
.footer-col h4 { font-size: 1rem; color: #fff; margin-bottom: 15px; margin-top: 10px; }
.footer-col p { color: #888; font-size: 0.9rem; line-height: 1.6; margin-bottom: 15px; }
.social-links { display: flex; gap: 15px; }
.social-links a {
    color: #fff; background: #222; width: 35px; height: 35px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; text-decoration: none; transition: 0.3s;
}
.social-links a:hover { background: var(--accent); }
.security-badges { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.badge { display: flex; align-items: center; gap: 10px; color: #bbb; font-size: 0.85rem; }
.badge i { color: var(--primary); font-size: 1.1rem; }
.payment-icons { display: flex; gap: 15px; font-size: 1.5rem; color: #888; }
.footer-bottom { border-top: 1px solid #222; text-align: center; padding-top: 20px; color: #555; font-size: 0.8rem; }

/* =========================================
   8. MODAL
   ========================================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); z-index: 2000;
    display: flex; justify-content: center; align-items: flex-end;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-content {
    background: #1a1a1a; width: 100%; max-width: 900px;
    border-radius: 25px 25px 0 0; position: relative; display: flex; flex-direction: column;
    max-height: 85vh; border: 1px solid rgba(255,255,255,0.1); border-bottom: none;
    box-shadow: 0 -5px 30px rgba(0,0,0,0.5);
}
.close-modal {
    position: absolute; top: 15px; right: 15px; background: rgba(0,0,0,0.6);
    color: white; border: none; width: 35px; height: 35px; border-radius: 50%;
    font-size: 1.2rem; cursor: pointer; z-index: 20;
    display: flex; align-items: center; justify-content: center;
}
.modal-body { display: flex; flex-direction: column; overflow-y: auto; padding-bottom: 90px; }
.modal-img-container { width: 100%; height: 280px; background: #000; flex-shrink: 0; }
.modal-img-container img { width: 100%; height: 100%; object-fit: contain; }
.modal-info { padding: 20px 25px; }
.modal-info h2 { font-size: 1.5rem; line-height: 1.2; margin-bottom: 10px; color: white; }
.product-desc { color: #ccc; font-size: 0.95rem; line-height: 1.6; margin: 15px 0; white-space: pre-line; }
.option-group { margin-bottom: 20px; }
.option-label { display: block; font-size: 0.9rem; color: #bbb; margin-bottom: 10px; font-weight: 600; }
.chips-container { display: flex; flex-wrap: wrap; gap: 10px; }
.option-chip {
    background: transparent; border: 1px solid #555; color: white;
    padding: 10px 18px; border-radius: 8px; font-size: 0.95rem; cursor: pointer;
    font-family: var(--font); transition: 0.2s;
}
.option-chip.selected {
    border-color: var(--primary); background: rgba(37, 211, 102, 0.15); color: var(--primary); font-weight: 700;
}
.modal-footer-btn {
    position: absolute; bottom: 0; left: 0; margin: 0; width: 100%;
    padding: 18px; font-size: 1.1rem; border-radius: 0; z-index: 30;
    background: var(--primary); color: white; border: none; font-weight: 700;
}

/* DESKTOP */
@media (min-width: 768px) {
    .banner-area { padding: 0 15px; }
    .banner-slider { border-radius: 15px; aspect-ratio: 3 / 1; max-height: 450px; }
    
    .categories, .tags-container { justify-content: center; }
    .tag-label { display: inline; margin-right: 10px; }
    .footer-content { grid-template-columns: 1fr 1fr; text-align: left; }
    
    .modal-overlay { align-items: center; }
    .modal-content { border-radius: 20px; max-height: 90vh; border-bottom: none; overflow: hidden; }
    .modal-body { flex-direction: row; height: 550px; padding-bottom: 0; }
    .modal-img-container { width: 50%; height: 100%; }
    .modal-info { width: 50%; padding: 40px; overflow-y: auto; }
    .modal-footer-btn { position: static; border-radius: 10px; margin-top: 20px; }

    .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .img-box { height: 180px; }
}