/* =========================================
   1. VARIÁVEIS & RESET
   ========================================= */
:root {
    --primary-color: #0f2340;  /* Azul Marinho */
    --primary-hover: #ee4d2d;  /* Laranja Shopee */
    --accent-color: #36400f;   /* Verde Oliva */
    
    /* CORES DE FUNDO */
    --bg-body: #bbbaba; 
    --bg-card: #ffffff; 
    
    --text-main: #1a1a1a;
    --text-light: #555555;
    --border-color: #e5e7eb;
}

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

html, body { overflow-x: hidden; width: 100%; }

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex; flex-direction: column; min-height: 100vh; padding-bottom: 0;
    font-display: swap;
}

a { text-decoration: none; }
ul { list-style: none; }

/* =========================================
   2. TELA DE CARREGAMENTO (SPLASH)
   ========================================= */
#intro-splash {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #0f2340; z-index: 9999;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: opacity 1s ease;
}

.splash-title { color: white; font-size: 2.5rem; margin-bottom: 10px; font-weight: bold; letter-spacing: 2px; }
.splash-text { color: #f59e0b; font-size: 1.2rem; }
.splash-spinner {
    margin-top: 20px; width: 40px; height: 40px;
    border: 4px solid #fff; border-top: 4px solid #f59e0b;
    border-radius: 50%; animation: spin 1s linear infinite;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.hidden-splash { opacity: 0; visibility: hidden; pointer-events: none; }

/* =========================================
   3. HEADER & MENU
   ========================================= */
header {
    background-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    position: sticky; top: 0; z-index: 1000; height: 70px;
    border-bottom: 3px solid var(--primary-hover);
}

.nav-wrapper {
    max-width: 1280px; width: 100%; margin: 0 auto; padding: 0 20px;
    height: 100%; display: flex; align-items: center; position: relative; justify-content: space-between;
}

.logo a { color: white; font-size: 1.6rem; font-weight: 800; text-transform: uppercase; white-space: nowrap; margin-right: 5px; }

.mobile-btn { 
    display: none; background: none; border: none; color: white; 
    font-size: 1.8rem; cursor: pointer; position: absolute; right: 20px; 
    top: 50%; transform: translateY(-50%);
}

/* MENU DESKTOP (> 1025px) */
@media (min-width: 1025px) {
    .menu-container { display: flex; align-items: center; gap: 0; height: 100%; margin-left: 40px; }
    .menu-item { position: static; height: 100%; display: flex; align-items: center; }
    
    .menu-link {
        color: rgba(255,255,255,0.9); font-weight: 600; padding: 0 10px; height: 70px;
        display: flex; align-items: center; justify-content: center; text-align: center;
        cursor: pointer; font-size: 0.9rem; line-height: 1.2;
        border-bottom: 3px solid transparent; transition: background 0.2s;
        white-space: normal; max-width: 140px;
    }
    .menu-link:hover { background-color: rgba(255,255,255,0.15); border-bottom-color: var(--accent-color); }

    .submenu {
        visibility: hidden; opacity: 0; position: absolute; top: 70px; left: 0; width: 100%; 
        background: white; box-shadow: 0 15px 40px rgba(0,0,0,0.15); 
        border-top: 3px solid var(--accent-color); z-index: 1100; padding: 30px; 
        transition: all 0.2s ease-in-out; transform: translateY(10px);
    }
    .menu-item:hover .submenu { visibility: visible; opacity: 1; transform: translateY(0); }
    .departamento-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 10px 20px; }
    .coluna-categoria { display: flex; flex-direction: column; margin-bottom: 0; }
    .titulo-cat { font-weight: 800; margin-bottom: 8px; color: var(--primary-color); border-bottom: 1px solid #eee; padding-bottom: 5px; }
    .link-sub { display: block; padding: 4px 0; color: #555; border-bottom: none; }
    .link-sub:hover { color: var(--primary-hover); transform: translateX(5px); }
    .menu-privacidade .submenu { display: none !important; }
}

/* =========================================
   4. UI GERAL (BUSCA, FILTROS)
   ========================================= */
.control-bar, .filter-bar { max-width: 1200px; margin-left: 5%; margin-top: 10px; padding: 0 20px; display: flex; gap: 10px;}
.filter-bar { flex-wrap: wrap; align-items: center; margin-left: 10%; margin-bottom: 30px; margin-left: 30%; }

#campo-busca { flex: 1; padding: 12px 15px; border: 1px solid #ddd; border-radius: 50px; outline: none;}

.btn-search { 
    background: var(--primary-color); color: white; border: none; padding: 0 25px; 
    border-radius: 50px; cursor: pointer; font-weight: 600; transition: all 0.3s ease; 
}
.btn-search:disabled { background-color: #ccc !important; cursor: not-allowed !important; opacity: 0.7; }

.input-filter { padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; }

/* --- SUBCATEGORIAS --- */
.subcategorias-wrapper {
    display: flex; flex-wrap: wrap; gap: 12px; padding: 15px 0;
    margin-bottom: 20px; align-items: center; justify-content: center;
}
.btn-subcat-pill {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; border-radius: 25px; background-color: #0f2340; 
    color: #ffffff; border: 1px solid #0f2340; font-size: 0.9rem; font-weight: 500;
    text-decoration: none; transition: all 0.3s ease; cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); text-align: center; min-height: 40px; 
}
.btn-subcat-pill:hover, .btn-subcat-pill.active {
    background-color: #ee4d2d; color: #ffffff; border-color: #ee4d2d;
    transform: translateY(-2px); box-shadow: 0 4px 8px rgba(238, 77, 45, 0.4);
}
.extras-wrapper { display: contents; }
.btn-toggle-sub {
    width: 40px; height: 40px; border-radius: 50%; background: #fff;
    border: 1px solid #ddd; color: #333; display: flex; align-items: center;
    justify-content: center; cursor: pointer; transition: all 0.3s; flex-shrink: 0; 
}
.btn-toggle-sub:hover { background: #f0f0f0; color: #ee4d2d; border-color: #ee4d2d; }
.hidden { display: none !important; }

#min-price, #max-price { width: 90px; text-align: center; }
.btn-filter { background: white; border: 1px solid var(--primary-color); color: var(--primary-color); padding: 8px 15px; border-radius: 4px; cursor: pointer; font-weight: 600; }
.btn-filter:hover { background: var(--primary-color); color: white; }

/* =========================================
   5. CARDS & GRID RESPONSIVO
   ========================================= */
#product-cards-container {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px;
    padding: 0 20px; max-width: 1280px; margin: 0 auto; flex: 1;
}

.card-actions { display: flex; gap: 8px; margin-top: 8px; width: 100%; }
.card-actions .btn-buy { flex: 1; margin-top: 0; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; white-space: nowrap; padding: 8px 4px; }
.btn-detalhes {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    background-color: transparent; color: #0f2340; border: 1px solid #0f2340;
    border-radius: 4px; font-weight: 600; font-size: 0.85rem; cursor: pointer;
    transition: all 0.2s ease; white-space: nowrap; text-decoration: none;
}
.btn-detalhes:hover { background-color: #0f2340; color: #fff; }

/* Card Style */
.product-card {
    background: var(--bg-card); border-radius: 8px; overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); transition: transform 0.2s, box-shadow 0.2s;
    display: flex; flex-direction: column; height: auto; position: relative; border: 1px solid transparent; width: 100%;
}
.product-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); border-color: #eee; z-index: 10; }

.img-wrapper { width: 100%; position: relative; background: #fff; border-bottom: 1px solid #f5f5f5; overflow: hidden; padding: 0;aspect-ratio: 1 / 1; }
.img-wrapper img { width: 100% !important; height: 200px !important; object-fit: fill !important; padding: 0 !important; display: block; filter: brightness(0.97) contrast(1.05); transition: transform 0.3s ease, filter 0.3s ease; content-visibility: auto; aspect-ratio: 1 / 1;}
.product-card:hover .img-wrapper img { filter: brightness(1.05) contrast(1); transform: scale(1.02); }

.badge-vendas {
    position: absolute; bottom: 5px; right: 5px; background: rgba(255, 69, 0, 0.9);
    color: white; font-size: 0.7rem; font-weight: bold; padding: 2px 6px;
    border-radius: 4px; z-index: 100 !important; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.selo-oficial {
    position: absolute;bottom: 0;left: 0;
    background-color: #d0011b; /* Vermelho Oficial Shopee Mall */
    color: white;padding: 2px 6px;border-top-right-radius: 4px;
    font-size: 0.7rem;font-weight: bold;z-index: 3;text-transform: uppercase;display: flex;align-items: center;
    gap: 3px;box-shadow: 1px -1px 3px rgba(0,0,0,0.2);letter-spacing: 0.5px;}
.selo-oficial i {font-size: 0.75rem;}

.card-content { padding: 10px 15px; display: flex; flex-direction: column; flex-grow: 1; gap: 5px; justify-content: space-between; }
.card-content h4 { font-size: 0.95rem; line-height: 1.3; margin-bottom: 3px; display: -webkit-box; --webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 2.6em; color: var(--text-main); }
.metrics-row { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-light); margin-bottom: 3px; }
.price { font-size: 1.2rem; font-weight: 700; color: var(--primary-color); }
.btn-buy { display: block; text-align: center; background-color: var(--primary-color); color: white; padding: 10px; border-radius: 4px; font-weight: 600; margin-top: 5px; font-size: 0.9rem; }
.btn-buy:hover { background-color: var(--primary-hover); }

.pagination-container { margin-top: 30px; display: flex; justify-content: center; }
.btn-pag { background: white; border: 1px solid #ddd; padding: 8px 14px; margin: 0 4px; cursor: pointer; border-radius: 4px; }
.btn-pag.active { background: var(--primary-color); color: white; border-color: var(--primary-color); }

.lang-selector { display: flex; gap: 8px; margin-left: 20px; margin-right: 20px; z-index: 1002; }
.btn-lang { background: none; border: 1px solid rgba(255,255,255,0.3); border-radius: 4px; cursor: pointer; font-size: 1.2rem; padding: 2px 5px; transition: all 0.2s; filter: grayscale(100%); opacity: 0.7; }
.btn-lang:hover, .btn-lang.active { filter: grayscale(0%); opacity: 1; background: rgba(255,255,255,0.1); border-color: white; transform: scale(1.1); }

/* =========================================
   7. HERO SLIDER
   ========================================= */
.hero-container {
    position: relative; max-width: 1200px; width: 100%; margin: 20px auto; height: 360px; min-height: 360px;
    border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(15, 35, 64, 0.25);
    background: #e0e0e0; animation: skeleton-loading 1.5s infinite alternate; display: block;
}
@keyframes skeleton-loading { 0% { background-color: #e0e0e0; } 100% { background-color: #f0f0f0; } }
.hero-wrapper { display: flex; height: 100%; transition: transform 0.5s ease-in-out; }
.hero-card {
    min-width: 100%; display: flex; flex-direction: row-reverse; align-items: center;
    justify-content: space-between; padding: 0 0 0 70px; box-sizing: border-box;
    background: linear-gradient(105deg, #0f2340 40%, #1a3a66 70%, #d4af37 100%); color: white;
}
.hero-price { font-size: 2.8rem; font-weight: 800; color: #fff; margin: 5px 0 15px 0; text-shadow: 0 4px 10px rgba(0,0,0,0.3); letter-spacing: -1px; }
.hero-img-box { flex: 0 0 55%; height: 100%; display: flex; align-items: flex-end; margin-right: 70px; margin-bottom: 20px; justify-content: flex-end; position: relative; overflow: hidden;aspect-ratio: 1 / 1; }
.hero-img-box img { height: 90%; width: auto; object-fit: contain; z-index: 1; filter: drop-shadow(-10px 10px 20px rgba(0,0,0,0.3)); border-radius: 12px; transition: transform 0.3s ease; }
.hero-img-box img:hover { transform: scale(1.03); }
.hero-info { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; z-index: 2; padding-right: 20px; }
.hero-tag { background: #d4af37; color: #0f2340; padding: 5px 12px; font-size: 1.0rem; font-weight: 800; text-transform: uppercase; border-radius: 4px; margin-bottom: 15px; }
.hero-title {
    font-size: clamp(1.5rem, 2vw, 2.0rem); color: white;margin: 0 0 15px 0;line-height: 1.2; font-weight: 700;
    display: -webkit-box;-webkit-line-clamp: 4; -webkit-box-orient: vertical;overflow: hidden;text-overflow: ellipsis; 
    word-break: break-word;max-width: 100%;}
.hero-btn-buy { background: #ffc107; color: #000; padding: 15px 40px; border-radius: 50px; text-decoration: none; font-weight: 900; font-size: 1.1rem; box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4); border: 2px solid #ffc107; transition: transform 0.2s; margin-top: 20px;}
.hero-btn-buy:hover { transform: translateY(-3px); background: #fff; }
.hero-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.1); color: white; border: none; font-size: 2rem; cursor: pointer; z-index: 10; width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.prev { left: 15px; } .next { right: 15px; }
.hero-dots { position: absolute; bottom: 20px; left: 50%; display: flex; gap: 8px; z-index: 10; }
.dot { width: 8px; height: 8px; background: rgba(255,255,255,0.3); border-radius: 50%; cursor: pointer; }
.dot.active { background: #ffc107; transform: scale(1.2); }

/* =========================================
   8. PÁGINA DE DETALHES (BASE DESKTOP)
   ========================================= */
.container-detalhes { max-width: 1200px; margin: 30px auto; padding: 0 20px; }

.produto-wrapper {
    display: flex; flex-wrap: wrap; background: white; border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); margin-bottom: 30px; 
    overflow: hidden; border: 1px solid #eee; align-items: stretch;
}

.prod-img-box {
    flex: 1 1 400px; background: #fff; padding: 20px;
    display: flex; align-items: center; justify-content: center; 
    position: relative; overflow: hidden; border-right: 1px solid #f5f5f5; min-height: 400px;
}
.prod-img-box img { width: 100%; height: auto; max-height: 450px; object-fit: contain; aspect-ratio: 1 / 1; transition: transform 0.3s ease; }
.prod-img-box:hover img { transform: scale(1.05); }

.prod-info-box { flex: 1 1 350px; padding: 40px; display: flex; flex-direction: column; justify-content: center; }
.prod-categoria { font-size: 0.9rem; color: #666; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; font-weight: 600; }
.prod-titulo { font-size: 1.8rem; margin-bottom: 20px; line-height: 1.3; color: var(--primary-color); font-weight: 700; }
.prod-preco-box { background: #f8f9fa; padding: 20px; border-radius: 8px; margin-bottom: 25px; border-left: 5px solid var(--primary-hover); }
.prod-atual { font-size: 2.5rem; font-weight: 800; color: var(--primary-hover); }
.aviso-preco { font-size: 0.85rem; color: #666; margin-top: 5px; }

.btn-comprar {
    background: linear-gradient(180deg, #ff5722 0%, #ee4d2d 100%);
    color: white; border: none; padding: 16px 20px; font-size: 1.1rem;
    font-weight: 800; border-radius: 6px; cursor: pointer; text-transform: uppercase;
    width: 100%; max-width: 400px; display: flex; align-items: center; justify-content: center;
    gap: 10px; box-shadow: 0 4px 10px rgba(238, 77, 45, 0.3);
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s; margin-top: 15px;
}
.btn-comprar:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(238, 77, 45, 0.4); filter: brightness(1.1); }
.btn-comprar:active { transform: translateY(1px); box-shadow: 0 2px 5px rgba(238, 77, 45, 0.3); }
.pulsar { animation: btn-pulse 2s infinite; }
@keyframes btn-pulse { 0% { box-shadow: 0 0 0 0 rgba(238, 77, 45, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(238, 77, 45, 0); } 100% { box-shadow: 0 0 0 0 rgba(238, 77, 45, 0); } }

.detalhes-bottom-row { display: grid; grid-template-columns: 1.5fr 1fr; gap: 25px; margin-bottom: 40px; }

.box-descricao { background: white; border-radius: 12px; padding: 25px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); border: 1px solid #eee; height: 400px; overflow-y: auto; }
.box-descricao h3 { margin-bottom: 25px; font-size: 1.3rem; color: #333; display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 2px solid #f5f5f5; }

.texto-conteudo { font-size: 1rem; line-height: 1.7; color: #444; }
.texto-conteudo ul.spec-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; list-style: none; padding: 0; margin: 15px 0; }
.texto-conteudo ul.spec-list li { background: #f8f9fa; padding: 10px; border-radius: 6px; border: 1px solid #eee; font-size: 0.9rem; color: #555; overflow-wrap: break-word; word-wrap: break-word; }
.texto-conteudo ul.spec-list li strong { display: block; font-size: 0.75rem; text-transform: uppercase; color: #333; font-weight: 800; margin-bottom: 3px; border-bottom: 1px solid #e0e0e0; padding-bottom: 2px; }
.more-info { margin-top: 30px; padding-top: 15px; border-top: 1px dashed #ddd; font-size: 0.85rem; color: #888; text-align: center; }

.mkt-logo-hero { position: absolute; top: 12px; left: 12px; height: 32px; width: auto; z-index: 50; filter: drop-shadow(0px 2px 3px rgba(255, 255, 255, 0.95)); pointer-events: none; display: block !important; }

.box-grafico { background: white; border-radius: 12px; padding: 25px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); border: 1px solid #eee; height: 400px; min-height: 400px; display: flex; flex-direction: column; }
.chart-wrapper { flex: 1; position: relative; width: 100%; height: 100%; min-height: 300px; }
.legenda-grafico { text-align: center; font-size: 0.8rem; color: #999; margin-top: 15px; }

/* Scrollbar */
.custom-scroll::-webkit-scrollbar { width: 8px; }
.custom-scroll::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.custom-scroll::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.custom-scroll::-webkit-scrollbar-thumb:hover { background: #ee4d2d; }

#btn-top {
    position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px;
    background-color: var(--primary-color); color: var(--primary-hover); 
    border: 2px solid var(--bg-card); border-radius: 50%; font-size: 1.5rem;
    cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.3); z-index: 2000; 
    opacity: 0; visibility: hidden; transform: translateY(20px); transition: all 0.3s ease-in-out;
    display: flex; align-items: center; justify-content: center;
}
#btn-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
#btn-top:hover { background-color: #ffc107; color: var(--primary-color); transform: translateY(-5px); }

/* EXTRAS */
.modal-zoom { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.9); z-index: 10000; justify-content: center; align-items: center; backdrop-filter: blur(5px); animation: fadeInZoom 0.3s ease; }
.modal-zoom-content img { max-width: 100%; max-height: 90vh; object-fit: contain; }
@keyframes fadeInZoom { from { opacity: 0; } to { opacity: 1; } }
.toolbar-categoria { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.aviso-busca { grid-column: 1 / -1; padding: 10px; border-radius: 5px; margin-bottom: 15px; text-align: center; }
.aviso-busca.warning { background: #fff3cd; color: #856404; } .aviso-busca.success { background: #d4edda; color: #155724; }
.active-cat { color: #ee4d2d !important; font-weight: bold; border-bottom: 2px solid #ee4d2d; }
.active-cat-parent { color: #ee4d2d !important; }
.submenu .active-cat { background-color: #fef6f5; border-bottom: none; border-left: 3px solid #ee4d2d; padding-left: 5px; }
footer { background-color: var(--primary-color); color: rgba(255, 255, 255, 0.9); text-align: center; padding: 30px 20px; margin-top: 40px; border-top: 4px solid var(--accent-color); }
footer a {color:var(--primary-hover); text-decoration: none;font-weight: 600;transition: color 0.2s;}
footer a:hover {color: #fff;text-decoration: underline;text-shadow: 0 0 5px rgba(255, 193, 7, 0.5);}
.floating-coupon-btn { position: fixed; bottom: 90px; right: 30px; width: 50px; height: 50px; background: linear-gradient(135deg, #ff5722, #d0011b); border-radius: 50%; box-shadow: 0 4px 15px rgba(238, 77, 45, 0.4); cursor: pointer; z-index: 1999; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; animation: bounce 2s infinite; }
.coupon-count { position: absolute; top: -5px; right: -5px; background: #fff; color: #d0011b; font-size: 0.8rem; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; border: 1px solid #d0011b; }
.modal-overlay { position: fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.7); z-index:2000; }
.modal-content-cupom { position: fixed; top:50%; left:50%; transform:translate(-50%, -50%); background: white; width: 90%; max-width: 400px; border-radius: 12px; padding: 20px; z-index: 2001; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.cupom-card { border: 1px dashed #ee4d2d; background: #fff5f5; padding: 10px; margin-bottom: 10px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; }
.cupom-val { color: #ee4d2d; font-weight: bold; font-size: 1.1rem; display: block; }
.cupom-code { background: #fff; padding: 5px; border: 1px solid #ddd; font-family: monospace; text-align: center; margin-bottom: 5px; }
.cupom-right button { background: #ee4d2d; color: white; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% {transform: translateY(0);} 40% {transform: translateY(-10px);} 60% {transform: translateY(-5px);} }


/* =========================================
   9. RESPONSIVIDADE UNIFICADA E FINAL
   (Esta parte substitui qualquer conflito anterior)
   ========================================= */

/* --- TABLET E MOBILE (GERAL - Abaixo de 1024px) --- */
@media (max-width: 1024px) {
    .nav-wrapper { padding: 0 20px; justify-content: flex-start; }
    .mobile-btn { display: block; z-index: 1003; }
    
    .menu-container {
        display: none; flex-direction: column; position: fixed; top: 70px; left: 0; 
        width: 100%; height: calc(100vh - 70px); background: white; 
        overflow-y: auto; padding-bottom: 80px; z-index: 2000; 
        border-top: 1px solid var(--accent-color);
    }
    .menu-container.active { display: flex; }
    
    .menu-item { width: 100%; display: block; position: relative; border-bottom: 1px solid #e0e0e0; }
    .menu-link { 
        color: var(--primary-color); font-weight: 700; font-size: 1rem;
        height: auto; padding: 18px 20px; width: 100%; 
        display: flex; justify-content: space-between; align-items: center; background: #fff;
    }
    
    .submenu { 
        position: static; visibility: visible; opacity: 1; transform: none; 
        box-shadow: none; border: none; width: 100%; max-height: 0; overflow: hidden; 
        padding: 0; transition: max-height 0.4s ease-out; background: #f8f9fa;
    }
    .submenu.open { max-height: 3000px; } 
    
    .departamento-grid { display: flex; flex-direction: column; padding: 10px 0; gap: 0; }
    .coluna-categoria { margin-bottom: 0; padding: 0; }
    .titulo-cat { padding: 12px 25px; font-size: 0.95rem; color: #000000; border-bottom: 1px solid #eee; background: #fff; display: block; margin: 0; }
    .lista-subs { display: flex; flex-direction: column; }
    .link-sub { display: block; padding: 12px 35px; color: #555; font-size: 0.9rem; border-bottom: 1px solid #f1f1f1; text-decoration: none; }
    .link-sub:active, .link-sub:hover { background-color: #eef2ff; color: var(--primary-color); font-weight: 600; }
    .menu-privacidade .submenu { display: none !important; }

    /* Ajustes Gerais Mobile */
    .control-bar, .filter-bar { flex-direction: column; align-items: stretch; margin-left: 0; }
    #campo-busca { margin-left: 0; margin-bottom: 10px; }
    .lang-selector { margin-right: 60px; margin-left: 20px; }
    
    /* Hero */
    .hero-container { height: 100% !important; min-height: 500px; width: 95%; margin: 10px auto; }
    .hero-card { flex-direction: column; padding: 0; text-align: center; }
    .hero-img-box { width: 100%; height: 250px; flex: none; background: #fff; align-items: center; justify-content: center; margin: 0; }
    .hero-img-box img { height: 90%; padding: 0; }
    .hero-info { width: 100%;padding: 20px 10px; align-items: center; background: linear-gradient(135deg, #0f2340 0%, #1a3a66 100%); }
    .hero-title { font-size: 1rem; line-height: 1.2; margin-bottom: 15px; -webkit-line-clamp: 3; }
    .hero-btn-buy { max-width: 90%; margin-top: 10px; bottom: 15px;}
    .hero-btn { display: none;}
    .hero-dots { left: 50%; transform: translateX(-50%); bottom: 10px; }
    .hero-tag { margin-bottom: 15px; font-size: 0.9rem; }
    
    /* Home Grid Tablet */
    #product-cards-container { grid-template-columns: repeat(3, 1fr) !important; }
}

@media (min-width: 768px) { .mobile-gap { margin-top: 0; } }

/* --- TABLET MEDIO (Abaixo de 900px) --- */
@media (max-width: 900px) {
    /* Home: 2 colunas */
    #product-cards-container { grid-template-columns: repeat(2, 1fr) !important; }

    /* Detalhes: Tudo 1 Coluna (Empilhado) */
    .container-detalhes { padding: 0 15px; width: 100%; overflow-x: hidden; }
    .produto-wrapper { flex-direction: column; width: 100%; height: auto; max-height: none; }
    .prod-img-box { border-right: none; border-bottom: 1px solid #eee; width: 100%; min-height: auto; padding: 20px; }
    .prod-info-box { width: 100%; padding: 20px; }
    
    /* Layout Vertical para Descrição/Gráfico */
    .detalhes-bottom-row { display: flex; flex-direction: column; width: 100%; gap: 20px; }
    
    /* Blindagem dos Containers */
    .box-descricao, .box-grafico { width: 100% !important; max-width: 100% !important; height: auto !important; margin: 0 !important; box-sizing: border-box; max-height: 500px; }
    .chart-wrapper { width: 100%; overflow: hidden; }
    .box-grafico canvas { max-width: 100% !important; }
    
    /* Mobile Subcat */
    .subcategorias-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .btn-subcat-pill { width: 80%; padding: 8px 5px; font-size: 0.85rem; }
    .btn-toggle-sub { grid-column: span 2; width: 100%; border-radius: 8px; height: 35px; }
}

/* --- MOBILE PEQUENO (Abaixo de 480px) --- */
@media (max-width: 480px) {    
   
    #product-cards-container { 
        display: grid;
        grid-template-columns: 1fr !important; 
        gap: 20px !important;
        padding: 10px 20px !important;
        justify-items: center; 
    } 

    .product-card { width: 100%; max-width: 100%; margin: 0 auto; }
    .img-wrapper { width: 100%; height: auto; aspect-ratio: 1/1; }
    .img-wrapper img { width: 100% !important; height: 100% !important; object-fit: cover !important; }
    
    .filter-bar { margin-left: 0 !important; width: 100%; justify-content: center; } 
    .control-bar { margin-left: 0 !important; padding: 0 10px; }
    #campo-busca { margin-left: 0 !important; width: 100%; }

    /* 2. PÁGINA DE DETALHES (Ajustes Finais Centralizados) */
    .prod-img-box { padding: 10px; min-height: 250px; }
    .prod-img-box img { max-height: 220px; }
    
    .prod-info-box { padding: 15px; text-align: center; }
    .prod-titulo { font-size: 1.3rem; line-height: 1.3; margin-bottom: 15px; }
    .prod-atual { font-size: 1.8rem; }
    
    .btn-comprar { width: 100%; max-width: 100%; padding: 15px; margin: 15px auto 0; }
    
    .mkt-logo-hero { width: 60px; top: 8px; left: 8px; }

    .footer a{
        display: flex;
        flex-direction: row;;
    }
}
/* =========================================
   BOTÕES DE COMPARTILHAMENTO (NOVO)
   ========================================= */

.btn-share-card {
    background: transparent;     
    border: none;                
    width: 35px;
    height: 35px;                
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;     
    cursor: pointer;
    transition: all 0.2s;
    
    /* Cor do ícone (Azul do site) */
    color: var(--primary-color); 
}

/* O SVG herda a cor do texto acima */
.btn-share-card svg {
    width: 18px;
    height: 18px;
}

/* Efeito ao passar o mouse */
.btn-share-card:hover {
    background: #eef2ff;     
    color: var(--primary-hover); 
    transform: scale(1.1);     
}

/* Ajuste Mobile */
@media (max-width: 480px) {
    .btn-share-card { width: 30px; height: 30px; }
    .btn-share-card svg { width: 16px; height: 16px; }
}

/* --- 2. Barra na Página de Detalhes --- */
.share-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.share-title {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.share-buttons-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-social {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-social:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(0,0,0,0.2); }

/* Cores das Redes */
.bg-whatsapp { background: #25D366; }
.bg-twitter  { background: #000000; }
.bg-facebook { background: #1877F2; }
.bg-native   { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); } /* Instagram/Geral */
.bg-copy     { background: #555; }


@media (max-width: 480px) {
    .card-actions { gap: 5px; }
    .btn-share-card { width: 30px; font-size: 0.9rem; }
}

/* =========================================
   FILTROS AVANÇADOS (MARCAS E CAT3)
   ========================================= */
.filtros-avancados-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    padding: 0 20px;
    max-width: 1280px;
    margin: 0 auto 20px auto;
}

.fila-filtros {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
}


.fila-filtros::-webkit-scrollbar { height: 4px; }
.fila-filtros::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.label-filtro {
    font-size: 0.8rem;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    white-space: nowrap;
    margin-right: 5px;
}

.btn-filter-pill {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: #fff;
    color: #555;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-filter-pill:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-filter-pill.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    font-weight: 600;
}

@media (max-width: 480px) {
    .filtros-avancados-wrapper { padding: 0 10px; }
    .label-filtro { display: none;}
    .btn-filter-pill { font-size: 0.75rem; padding: 5px 12px; }
}