:root {
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-blue: #0284c7;
    --accent-shopee: #ee4d2d;
    --accent-meli: #ffe600;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Outfit', sans-serif; }

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
    color: var(--text-light);
    min-height: 100vh;
    padding: 2rem;
}

.container { max-width: 1400px; margin: 0 auto; }

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.logo { font-size: 2.1rem; font-weight: 800; display: flex; align-items: center; gap: 0.5rem; letter-spacing: -0.03em; }
.logo-text { background: linear-gradient(135deg, #ffffff 40%, #c7d2fe 70%, #6366f1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.header-status { font-size: 0.82rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.5rem; margin-top: 0.3rem; }
.status-dot { width: 8px; height: 8px; background: #10b981; border-radius: 50%; display: inline-block; box-shadow: 0 0 10px #10b981; animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(0.95); opacity: 0.7; } 50% { transform: scale(1.25); opacity: 1; } 100% { transform: scale(0.95); opacity: 0.7; } }

.search-box {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.search-input-group { display: flex; gap: 1rem; margin-bottom: 1rem; }

input[type="text"], select {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.8rem 1.2rem;
    color: var(--text-light);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 20px rgba(99, 102, 241, 0.25); }

.btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4); }

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
}

.filter-select {
    background: rgba(30, 41, 59, 0.65);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    padding: 0.65rem 1rem;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    flex: 1 1 auto;
    min-width: 140px;
    transition: all 0.2s ease;
}

.filter-select:focus, .filter-select:hover {
    border-color: var(--primary);
    outline: none;
    background: rgba(30, 41, 59, 0.95);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: 0 8px 30px rgba(99, 102, 241, 0.15); }

.card-img-container {
    width: 100%;
    height: 170px;
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
    padding: 0.8rem;
}

.card-img-container img {
    max-width: 90%;
    max-height: 150px;
    object-fit: contain;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}

.card:hover .card-img-container img { transform: scale(1.06); }

.card-img-placeholder {
    color: var(--text-muted);
    font-size: 3rem;
    opacity: 0.3;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.2rem 1.2rem 0.4rem;
    gap: 0.5rem;
}

.card-badges {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.card-body { padding: 0 1.2rem 1.2rem; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }

.store-badge {
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-kabum { background: #ff6500; color: white; }
.badge-terabyte { background: #0088cc; color: white; }
.badge-pichau { background: #e31837; color: white; }
.badge-mercadolivre { background: #ffe600; color: #111; }
.badge-shopee { background: #ee4d2d; color: white; }
.badge-amazon { background: #ff9900; color: #111; font-weight: 700; }

.best-price-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
}

/* Tier badges — definição única e consolidada */
.tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.tier-S { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; box-shadow: 0 0 12px rgba(245,158,11,0.5); }
.tier-A { background: linear-gradient(135deg, #10b981, #059669); color: #fff; box-shadow: 0 0 10px rgba(16,185,129,0.4); }
.tier-B { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; box-shadow: 0 0 8px rgba(59,130,246,0.3); }
.tier-C { background: rgba(148,163,184,0.2); color: var(--text-muted); border: 1px solid rgba(148,163,184,0.3); }

.product-title { 
    font-size: 0.98rem; 
    font-weight: 600; 
    margin-bottom: 0.4rem; 
    line-height: 1.4; 
    color: var(--text-light); 
    display: -webkit-box; 
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
}
.product-meta { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.6rem; }
.price-container { margin-top: auto; padding-top: 0.8rem; border-top: 1px solid var(--border-color); }
.price-pix { font-size: 1.5rem; font-weight: 700; color: var(--accent-green); }
.price-old { text-decoration: line-through; color: var(--text-muted); font-size: 0.9rem; }
.discount-tag { background: rgba(16, 185, 129, 0.2); color: var(--accent-green); padding: 0.2rem 0.5rem; border-radius: 6px; font-weight: 600; font-size: 0.8rem; float: right; }

.affiliate-link-btn {
    display: block;
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    text-decoration: none;
    padding: 0.7rem;
    border-radius: 10px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    flex: 2;
}

.card-actions { display: flex; gap: 0.5rem; margin-top: 0.8rem; }
.btn-history {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 0.7rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    flex: 1;
    font-size: 0.82rem;
}
.btn-history:hover { background: rgba(99, 102, 241, 0.25); border-color: var(--primary); }

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}
.modal.active { display: flex; }
.modal-content {
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 720px;
    padding: 1.8rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.2rem; }
.modal-title { font-size: 1.05rem; font-weight: 700; color: var(--text-light); }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }
.modal-close:hover { color: #ef4444; }

.telegram-banner {
    background: linear-gradient(135deg, #0088cc, #229ed9);
    border-radius: 16px;
    padding: 1.2rem 1.8rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 25px rgba(0, 136, 204, 0.3);
    flex-wrap: wrap;
    gap: 1rem;
}
.telegram-info h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.2rem; color: white; }
.telegram-info p { font-size: 0.9rem; color: rgba(255, 255, 255, 0.9); }
.btn-telegram {
    background: white;
    color: #0088cc;
    font-weight: 700;
    padding: 0.7rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-telegram:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(255, 255, 255, 0.4); }

footer {
    margin-top: 3.5rem;
    padding: 1.8rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-muted);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
footer strong {
    background: linear-gradient(135deg, #a5b4fc, #6366f1, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

/* Abas Principais e Cupons */
.main-tabs { display: flex; gap: 0.8rem; margin-bottom: 1.5rem; }
.tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.8rem 1.6rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.tab-btn:hover { color: var(--text-light); border-color: var(--primary); }
.tab-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(16, 185, 129, 0.15));
    border-color: var(--primary);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}
.tab-badge {
    background: var(--accent-green);
    color: #0f172a;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    text-transform: uppercase;
}

.coupons-header { margin-bottom: 1.5rem; }
.coupons-header h2 { font-size: 1.4rem; font-weight: 700; color: var(--text-light); margin-bottom: 0.3rem; }
.coupons-header p { font-size: 0.9rem; color: var(--text-muted); }
.coupon-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}
.coupon-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
.coupon-top { display: flex; justify-content: space-between; align-items: flex-start; }
.coupon-discount { font-size: 1.5rem; font-weight: 800; color: var(--accent-green); }
.coupon-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.4; margin-top: 0.4rem; }
.coupon-meta { display: flex; gap: 0.5rem; font-size: 0.78rem; color: var(--text-muted); margin-top: 0.4rem; }
.coupon-box {
    background: rgba(15, 23, 42, 0.7);
    border: 1px dashed var(--primary);
    padding: 0.7rem 1rem;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.8rem;
}
.coupon-code-text { font-family: monospace; font-size: 1.2rem; font-weight: 800; color: var(--text-light); letter-spacing: 0.08em; }
.btn-copy-redeem {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-copy-redeem:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(99,102,241,0.4); }

/* Toast notification — corrigido */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
    z-index: 200;
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Barra de busca */
.search-input-wrapper {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1rem;
}
.search-input-wrapper input[type="text"] {
    flex: 1;
    font-size: 1rem;
}
.search-input-wrapper .btn {
    white-space: nowrap;
}

/* Responsividade para Celulares e Telas Pequenas */
@media (max-width: 768px) {
    body {
        padding: 0.5rem 0.4rem;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 0.8rem;
        padding-bottom: 0.6rem;
    }

    .logo {
        font-size: 1.4rem;
    }

    .header-status {
        font-size: 0.72rem;
    }

    .telegram-banner {
        padding: 0.6rem 0.8rem;
        margin-bottom: 0.8rem;
        gap: 0.4rem;
        border-radius: 10px;
    }

    .telegram-info h3 {
        font-size: 0.88rem;
        margin-bottom: 0.1rem;
    }

    .telegram-info p {
        font-size: 0.72rem;
        line-height: 1.2;
        opacity: 0.95;
    }

    .btn-telegram {
        padding: 0.4rem 0.8rem;
        font-size: 0.76rem;
        width: 100%;
        justify-content: center;
    }

    .search-box {
        padding: 0.8rem 0.6rem;
        margin-bottom: 0.8rem;
        border-radius: 10px;
    }

    .search-input-wrapper {
        flex-direction: column;
        gap: 0.5rem;
    }

    .filters {
        gap: 0.4rem;
    }

    .filter-select {
        min-width: 100%;
        flex: 1 1 100%;
        padding: 0.5rem 0.7rem;
        font-size: 0.8rem;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 0.8rem;
        justify-items: center;
    }

    .card {
        width: 100%;
        max-width: 340px;
        margin: 0 auto;
        border-radius: 12px;
    }

    .card-img-container {
        height: 120px;
        padding: 0.4rem;
    }

    .card-img-container img {
        max-height: 105px;
    }

    .card-header {
        padding: 0.6rem 0.8rem 0.2rem;
    }

    .card-body {
        padding: 0 0.8rem 0.8rem;
    }

    .product-title {
        font-size: 0.84rem;
        line-height: 1.3;
        -webkit-line-clamp: 2;
        margin-bottom: 0.2rem;
    }

    .price-pix {
        font-size: 1.25rem;
    }

    .price-old {
        font-size: 0.78rem;
    }

    .affiliate-link-btn {
        padding: 0.5rem;
        font-size: 0.78rem;
    }

    .btn-history {
        padding: 0.5rem;
        font-size: 0.75rem;
    }

    .main-tabs {
        gap: 0.4rem;
        margin-bottom: 0.8rem;
    }

    .tab-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        flex: 1;
        justify-content: center;
    }

    .modal-content {
        padding: 1.2rem;
        border-radius: 14px;
    }
}
