/* ══════════════════════════════════════════════════════════════
   NhaBex Ad Banner — 2 tipos: Fixo (zona 2) e Popup (zona 1)
   ══════════════════════════════════════════════════════════════ */

/* ── Base (shared) ── */
.nb-ad-label {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: .55rem;
    padding: .2rem .5rem;
    border-radius: 1rem;
    background: rgba(0,0,0,.45);
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    backdrop-filter: blur(4px);
    z-index: 2;
}

/* ══════════════════════════════════════════════════════════════
   ZONA 2 — Banner Fixo (sidebar, feed, grid card)
   ══════════════════════════════════════════════════════════════ */
.nb-ad-banner {
    display: block;
    position: relative;
    text-decoration: none;
    overflow: hidden;
    border-radius: .75rem;
    background: #fff;
    transition: box-shadow .2s;
}
.nb-ad-banner:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.nb-ad-banner img,
.nb-ad-banner video {
    width: 100%;
    display: block;
    border-radius: .75rem;
    object-fit: cover;
    transition: opacity .3s ease;
}
/* Fixed variant (sidebar on webapp) */
.nb-ad-fixed { margin: 1rem 0 0; }
.nb-ad-fixed img { max-height: 500px; }

/* Grid card variant (mobile home — replaces a category card) */
.nb-ad-card {
    border-radius: .75rem;
    overflow: hidden;
    background: #fff;
    height: 100%;
}
.nb-ad-card img { height: 100%; min-height: 140px; object-fit: cover; }

/* Feed variant (between items) */
.nb-ad-feed { margin: .75rem 0; }

/* ══════════════════════════════════════════════════════════════
   ZONA 1 — Banner Popup (bottom overlay, auto-hide 5s)
   ══════════════════════════════════════════════════════════════ */
.nb-ad-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    padding: 12px 16px;
    animation: nb-ad-slide-up .4s ease-out;
    pointer-events: auto;
}
.nb-ad-popup-inner {
    display: block;
    position: relative;
    text-decoration: none;
    overflow: hidden;
    border-radius: .75rem;
    background: #fff;
    box-shadow: 0 -4px 24px rgba(0,0,0,.2);
    max-width: 900px;
    margin: 0 auto;
}
.nb-ad-popup-inner img,
.nb-ad-popup-inner video {
    width: 100%;
    display: block;
    border-radius: .75rem;
    object-fit: cover;
    max-height: 200px;
}
.nb-ad-popup-close {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,.5);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    backdrop-filter: blur(4px);
    transition: background .15s;
}
.nb-ad-popup-close:hover { background: rgba(0,0,0,.7); }
.nb-ad-popup .nb-ad-label { top: auto; bottom: 12px; left: 12px; right: auto; }

@keyframes nb-ad-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ── Webapp Desktop Adjustments ── */
@media (min-width: 1024px) {
    .nb-ad-popup { left: 240px; /* sidebar width */ padding: 16px 24px; }
    .nb-ad-popup-inner { max-width: 700px; }
    .nb-ad-popup-inner img,
    .nb-ad-popup-inner video { max-height: 160px; }
}

/* ── Mobile Adjustments ── */
@media (max-width: 768px) {
    .nb-ad-popup { bottom: 72px; /* above bottom nav */ padding: 8px 12px; }
    .nb-ad-popup-inner img,
    .nb-ad-popup-inner video { max-height: 140px; }
    .nb-ad-fixed img { max-height: 300px; }
}

/* ── Dark mode support ── */
[data-theme="dark"] .nb-ad-banner,
[data-theme="dark"] .nb-ad-popup-inner,
.app-dark .nb-ad-banner,
.app-dark .nb-ad-popup-inner {
    background: var(--d-bg-2, #1a2332);
}
[data-theme="dark"] .nb-ad-label,
.app-dark .nb-ad-label {
    background: rgba(255,255,255,.15);
}
