:root {
    --primary: #00c853;
    --primary-dark: #00a443;
    --primary-light: #69f0ae;
    --primary-glow: rgba(0, 200, 83, 0.2);
    --secondary: #1e293b;
    --accent: #ffab00;
    --accent-dark: #ff8f00;
    --background: #f8fafc;
    --card: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
    --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --cta-gradient: linear-gradient(135deg, #ffab00 0%, #ea580c 100%);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ========== ANIMAÇÕES ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ========== HEADER ========== */
.header {
    background: #0f172a;
    border-bottom: 2px solid rgba(0, 200, 83, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 12px 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: nowrap;
}

/* Logo */
.logo {
    font-size: 1.3rem;
    font-weight: 900;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Barra de busca */
.search-bar {
    flex: 1;
    min-width: 0;
    max-width: 500px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    font-size: 14px;
    color: white;
    transition: all 0.3s ease;
}

.search-bar input::placeholder { color: rgba(255,255,255,0.5); }

.search-bar input:focus {
    background: rgba(255,255,255,0.15);
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-bar::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    opacity: 0.6;
    z-index: 1;
}

/* Botão hamburguer */
.menu-toggle {
    display: none;
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.menu-toggle:hover { background: rgba(255,255,255,0.1); }

/* Navegação */
.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.nav-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s;
    white-space: nowrap;
}

.nav-links a:hover { color: var(--primary); }

.btn-primary {
    background: var(--primary);
    color: white !important;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700 !important;
    transition: background 0.2s, transform 0.2s !important;
}

.btn-primary:hover {
    background: var(--primary-dark) !important;
    transform: scale(1.05);
}

/* ========== HERO PREMIUM ========== */
.hero-premium {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
    border-bottom: 5px solid var(--primary);
}

.hero-premium h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 20px;
    letter-spacing: -1px;
    line-height: 1.1;
}

.hero-premium p {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 650px;
    margin: 0 auto 35px;
    line-height: 1.6;
}

.stats-badge {
    display: inline-flex;
    gap: 24px;
    background: rgba(255,255,255,0.1);
    padding: 14px 28px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    flex-wrap: wrap;
    justify-content: center;
}

.stat-val {
    font-weight: 800;
    color: var(--primary);
    margin-right: 4px;
}

/* ========== SECTION TITLE ========== */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 50px 0 24px;
    border-left: 5px solid var(--primary);
    padding-left: 18px;
    gap: 16px;
}

.section-title h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
}

/* ========== CATEGORY GRID ========== */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    margin-top: -40px;
}

.cat-item {
    background: var(--card);
    padding: 20px 14px;
    border-radius: 16px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, border-color 0.2s;
    border: 1px solid var(--border);
}

.cat-item:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(0, 200, 83, 0.15);
}

/* ========== CATEGORY NAV (tabs) ========== */
.cat-nav {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.cat-nav::-webkit-scrollbar { display: none; }

.cat-tabs {
    display: flex;
    gap: 10px;
}

.cat-tab {
    padding: 7px 16px;
    border-radius: 20px;
    background: #f1f5f9;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.cat-tab:hover {
    background: var(--primary-glow);
    color: var(--primary);
}

.cat-tab.active {
    background: var(--primary);
    color: white;
}

/* ========== BREADCRUMB ========== */
.breadcrumb {
    padding: 16px 0;
    font-size: 13px;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

/* ========== PRODUCTS GRID ========== */
.products-grid,
#featuredGrid,
#offersGrid,
#comparativesGrid,
#guidesGrid,
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

/* ========== PRODUCT CARD ========== */
.product-card {
    background: var(--card);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 14px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

/* ========== SELOS / BADGES DOS PRODUTOS ========== */

/* Selo de desconto — canto superior esquerdo */
.badge-discount {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--danger);
    color: white;
    padding: 4px 9px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 12px;
    z-index: 3;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    line-height: 1.4;
}

/* Selo HOT — canto superior direito */
.badge-hot {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ff6b00, #ff0000);
    color: white;
    padding: 4px 9px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 11px;
    z-index: 3;
    animation: pulse 2s infinite;
    box-shadow: 0 2px 10px rgba(255, 0, 0, 0.35);
    line-height: 1.4;
}

/* Selos genéricos (menor preço, baixou, promo) */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 6px;
}

.badge-menor-preco { background: #dcfce7; color: #166534; }
.badge-baixou      { background: #fef9c3; color: #854d0e; }
.badge-promo-dia   { background: #dbeafe; color: #1e40af; }

/* Selo "Melhor Preço" — destaque verde */
.badge-best-price {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #00c853, #00a443);
    color: white;
    padding: 4px 9px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 11px;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0, 200, 83, 0.4);
    line-height: 1.4;
}

/* Selo "Oferta Relâmpago" — destaque amarelo */
.badge-flash {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ffab00, #ff8f00);
    color: white;
    padding: 4px 9px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 11px;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(255, 171, 0, 0.4);
    line-height: 1.4;
}

/* ========== IMAGEM DO PRODUTO ========== */
.card-img,
.product-img-wrap {
    width: 100%;
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    margin-top: 8px;
}

.card-img img,
.product-img {
    max-width: 100%;
    max-height: 160px;
    width: 100%;
    height: 160px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 10px;
    margin-top: 6px;
}

/* ========== TÍTULO DO PRODUTO ========== */
.product-card h3,
.product-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    min-height: 40px;
}

/* ========== PREÇOS ========== */
.price-tag,
.price-box {
    margin-top: auto;
    margin-bottom: 12px;
}

.current-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.old-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 2px;
}

.savings {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--success);
    background: #dcfce7;
    padding: 2px 8px;
    border-radius: 6px;
    margin-top: 4px;
}

/* ========== BOTÃO COMPRAR ========== */
.btn,
.btn-buy,
.btn-ninja {
    background: var(--cta-gradient);
    color: white;
    padding: 11px 14px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 171, 0, 0.25);
    display: block;
    font-size: 14px;
    border: none;
    cursor: pointer;
}

.btn:hover,
.btn-buy:hover,
.btn-ninja:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(255, 171, 0, 0.4);
    color: white;
}

/* ========== FEATURED CARD ========== */
.featured-card {
    background: var(--card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.featured-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    transform: scale(1.02);
}

/* ========== SKELETON LOADING ========== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-image { height: 160px; margin-bottom: 12px; }
.skeleton-text { height: 16px; margin-bottom: 8px; }
.skeleton-text.short { width: 60%; }

/* ========== FOOTER ========== */
.footer,
.footer-premium {
    background: #0f172a;
    color: white;
    padding: 60px 0 30px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: var(--primary);
    font-size: 1rem;
    margin-bottom: 18px;
    font-weight: 700;
}

.footer-col p {
    opacity: 0.7;
    line-height: 1.6;
    font-size: 0.9rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 10px;
    opacity: 0.7;
    transition: opacity 0.2s;
    font-size: 0.9rem;
}

.footer-col ul li:hover { opacity: 1; }

.footer-col ul li a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-col ul li a:hover { color: var(--primary); }

.footer-bottom {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    opacity: 0.5;
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
}

.footer-links a:hover { color: white; }

/* ========== RESPONSIVIDADE — TABLET (≤ 900px) ========== */
@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

/* ========== RESPONSIVIDADE — MOBILE (≤ 768px) ========== */
@media (max-width: 768px) {
    /* Header mobile */
    .header .container {
        flex-wrap: wrap;
        gap: 10px;
    }

    .logo {
        font-size: 1.1rem;
        order: 1;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        order: 3;
    }

    .search-bar {
        order: 4;
        width: 100%;
        max-width: 100%;
        flex: none;
    }

    .nav-links {
        order: 5;
        width: 100%;
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 8px 0 4px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        width: 100%;
        padding: 10px 4px;
        font-size: 15px;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }

    .btn-primary {
        margin-top: 4px;
        text-align: center;
        width: 100%;
        padding: 12px !important;
    }

    /* Hero */
    .hero-premium { padding: 40px 0; }
    .hero-premium h1 { font-size: 2rem; }
    .hero-premium p { font-size: 1rem; padding: 0 8px; }

    .stats-badge {
        gap: 14px;
        padding: 12px 18px;
        border-radius: 16px;
        width: 90%;
    }

    /* Section title */
    .section-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin: 36px 0 18px;
    }

    .section-title h2 { font-size: 1.4rem; }

    /* Categorias */
    .cat-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-top: -24px;
    }

    .cat-item {
        padding: 14px 8px;
        font-size: 0.82rem;
    }

    /* Grid de produtos */
    .products-grid,
    #featuredGrid,
    #offersGrid,
    #comparativesGrid,
    #guidesGrid,
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Card de produto */
    .product-card { padding: 10px; }

    .card-img,
    .product-img-wrap { height: 130px; }

    .card-img img,
    .product-img {
        max-height: 120px;
        height: 120px;
    }

    .product-card h3,
    .product-title {
        font-size: 12px;
        min-height: 34px;
    }

    .current-price { font-size: 1.15rem; }

    .badge-discount {
        font-size: 11px;
        padding: 3px 7px;
        top: 8px;
        left: 8px;
    }

    .badge-hot {
        font-size: 10px;
        padding: 3px 6px;
        top: 8px;
        right: 8px;
    }

    .btn,
    .btn-buy,
    .btn-ninja {
        padding: 10px 10px;
        font-size: 13px;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        text-align: center;
    }

    .footer-col ul li { text-align: center; }
}

/* ========== RESPONSIVIDADE — MOBILE PEQUENO (≤ 480px) ========== */
@media (max-width: 480px) {
    .hero-premium h1 { font-size: 1.7rem; }

    .cat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .cat-item { padding: 12px 6px; font-size: 0.78rem; }

    .products-grid,
    #featuredGrid,
    #offersGrid,
    #comparativesGrid,
    #guidesGrid,
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-card { padding: 8px; }

    .card-img,
    .product-img-wrap { height: 110px; }

    .card-img img,
    .product-img {
        max-height: 100px;
        height: 100px;
    }

    .product-card h3,
    .product-title { font-size: 11px; }

    .current-price { font-size: 1rem; }

    .savings { font-size: 10px; }
}

/* ========== RESPONSIVIDADE — TELAS MUITO PEQUENAS (≤ 360px) ========== */
@media (max-width: 360px) {
    .products-grid,
    #featuredGrid,
    #offersGrid,
    #comparativesGrid,
    #guidesGrid,
    .grid {
        grid-template-columns: 1fr;
    }

    .cat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* CORREÇÕES FINAIS DE ROLAGEM HORIZONTAL */
html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    position: relative;
    margin: 0;
    padding: 0;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
}

/* Garantir que nada vaze para fora da tela no mobile */
* {
    max-width: 100vw !important;
    box-sizing: border-box !important;
}

img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    .header .container {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
    }
    
    .search-bar {
        width: 100%;
        margin-top: 10px;
        order: 3;
    }
    
    .nav-links {
        width: 100%;
        order: 4;
    }

    .stats-badge {
        flex-direction: column;
        width: calc(100% - 30px);
        margin-left: 15px;
        margin-right: 15px;
        border-radius: 15px;
    }

    .cat-grid {
        padding: 0 10px;
    }
}
