:root {
    --bg-dark: #0a0f1e;
    --bg-card: #111827;
    --primary: #6366f1;
    --primary-h: #4f46e5;
    --accent: #10b981;
    --text: #f1f5f9;
    --muted: #64748b;
    --border: rgba(255, 255, 255, 0.07);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Status bar ── */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.status-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.82rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-green {
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.dot-yellow {
    background: #fbbf24;
    box-shadow: 0 0 6px #fbbf24;
    animation: blink 1s infinite;
}

.dot-gray {
    background: #475569;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.atualizar-btn {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.atualizar-btn:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.3);
}

.atualizar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 60% 60% at 20% 10%, rgba(99, 102, 241, 0.18) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 80% 80%, rgba(16, 185, 129, 0.12) 0%, transparent 60%),
        var(--bg-dark);
}

/* ── Header ── */
header {
    text-align: center;
    padding: 3.5rem 1rem 1rem;
}

header h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #818cf8, #c084fc, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    margin-bottom: 0.7rem;
}

header .subtitle {
    color: var(--muted);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.lojas-label {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    margin-bottom: 2.5rem;
}

.lojas-label span {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.lojas-label span.g {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
}

.lojas-label span.o {
    background: rgba(251, 146, 60, 0.12);
    border-color: rgba(251, 146, 60, 0.25);
    color: #fed7aa;
}

/* ── Search ── */
.search-wrap {
    position: sticky;
    top: 1rem;
    z-index: 50;
    max-width: 640px;
    margin: 0 auto 1.5rem;
    padding: 0 1rem;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    padding: 0.85rem 1.4rem;
    border-radius: 999px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    transition: border-color .25s, box-shadow .25s, transform .25s;
}

.search-box:focus-within {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 8px 32px rgba(0, 0, 0, 0.35);
    transform: translateY(-2px);
}

.search-box svg {
    color: var(--muted);
    flex-shrink: 0;
}

.search-box input {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.05rem;
    font-family: inherit;
    width: 100%;
    outline: none;
}

.search-box input::placeholder {
    color: #334155;
}

.result-count {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 2rem;
    letter-spacing: 0.02em;
}

/* ── Grid ── */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem 6rem;
}

/* ── Card ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    animation: fadeUp .5s ease-out both;
    transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), border-color .3s, box-shadow .3s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-8px) scale(1.01);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.55);
}

.card-img {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease, filter .4s ease;
    filter: brightness(.85);
}

.card:hover .card-img img {
    transform: scale(1.06);
    filter: brightness(1);
}

.badge-store {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    backdrop-filter: blur(8px);
}

/* Content */
.card-body {
    padding: 1.25rem 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-bottom: 0.6rem;
    margin-top: auto;
}

/* ── Preço azul conforme exemplo ── */
.price {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0066cc;
    /* Azul do exemplo */
    margin-top: 0.2rem;
}

/* Botão WhatsApp estilo exemplo */
.ver-btn {
    background: #fff;
    color: #444;
    text-decoration: none;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
    display: block;
}

.ver-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.card-meta {
    display: none;
    /* Esconde meta dados para limpar o visual igual o exemplo */
}

/* ── Empty State ── */
.empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 1rem;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.empty svg {
    opacity: .35;
}

.empty .sub {
    font-size: 0.85rem;
}

/* ── Notice Banner ── */
.notice {
    max-width: 700px;
    margin: 0 auto 2rem;
    padding: 0 1rem;
}

.notice-inner {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 1rem;
    padding: 1rem 1.5rem;
    font-size: 0.85rem;
    color: #6ee7b7;
    line-height: 1.6;
    text-align: center;
}

.notice-inner strong {
    color: #a7f3d0;
}

/* ── Animations ── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(22px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Filtros (Tabs) ── */
.tabs {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    padding: 0 1rem;
}

.tab {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tab:hover {
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--text);
}

.tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ── Badges de tipo ── */
.type-badge {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.post-badge {
    background: rgba(30, 41, 59, 0.8);
    color: #94a3b8;
}

.story-badge {
    background: rgba(236, 72, 153, 0.25);
    color: #f9a8d4;
}

/* ── Story specific ── */
.card-story {
    border-color: rgba(236, 72, 153, 0.25);
}

.card-story:hover {
    border-color: rgba(236, 72, 153, 0.5);
    box-shadow: 0 24px 48px -12px rgba(236, 72, 153, 0.2);
}

.story-timer {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fcd34d;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

/* ── Responsive ── */
@media (max-width: 500px) {
    .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }
}

/* ==== MODAL GERENCIAR LOJAS ==== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal {
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.btn-close {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.2rem;
    cursor: pointer;
}

.btn-close:hover {
    color: #fff;
}

.modal-body {
    padding: 1.5rem;
}

.muted-text {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.add-loja-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.add-loja-form textarea {
    flex: 1;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    padding: 0.8rem 1rem;
    border-radius: 0.75rem;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    resize: vertical;
}

.add-loja-form textarea:focus {
    outline: none;
    border-color: #6366f1;
    background: rgba(15, 23, 42, 0.6);
}

.btn-primary {
    background: #6366f1;
    color: #fff;
    border: none;
    padding: 0 1rem;
    border-radius: 0.5rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-primary:hover {
    background: #4f46e5;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.lojas-lista {
    list-style: none;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.1);
}

.lojas-lista li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.btn-remover {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.btn-remover:hover {
    color: #f87171;
    text-decoration: underline;
}

/* ==== MODO CLIENTE (PREMIUM - VIDRO FOSCO) ==== */
body.modo-cliente .lojas-pill,
body.modo-cliente .status-bar button,
body.modo-cliente #btnGerenciarLojas,
body.modo-cliente #filtro-loja-wrapper {
    display: none !important;
}

/* Borra textos por cima do card de forma moderada */
body.modo-cliente .card-title {
    filter: blur(4px) !important;
    opacity: 0.5 !important;
    user-select: none !important;
    pointer-events: none !important;
}

body.modo-cliente .card-desc,
body.modo-cliente .card-meta {
    filter: blur(1px) !important;
    opacity: 0.6 !important;
    user-select: none !important;
    pointer-events: none !important;
}


/* Efeito sobre a imagem — visível mas embaçada */
body.modo-cliente .card-img::after {
    content: '';
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10;
}

/* Esconde badges na imagem borrada */
body.modo-cliente .card-img .badge,
body.modo-cliente .card-img .type-flag,
body.modo-cliente .card-img .timer-24 {
    display: none !important;
}

/* Botão WhatsApp Premium */
body.modo-cliente .ver-btn {
    background: #10b981 !important;
    color: white !important;
    width: 100% !important;
    text-align: center !important;
    margin-top: 1rem !important;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4) !important;
    border: 1px solid #059669 !important;
    animation: pulseWhatsapp 2s infinite !important;
    position: relative !important;
    z-index: 20 !important;
    font-size: 1rem !important;
    padding: 0.9rem 1rem !important;
    pointer-events: auto !important;
    border-radius: 0.8rem !important;
}

body.modo-cliente .card-footer {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    padding-top: 0 !important;
    border: none !important;
}

body.modo-cliente .price {
    display: none !important;
}

@keyframes pulseWhatsapp {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

body.modo-cliente .ver-btn:hover {
    background: #059669 !important;
    transform: translateY(-2px);
}
