/* Carteira Cashback — layout app */
#cashback-runtime-root {
    --cbx-g: #FF6A00;
    --cbx-g2: #FF6A00;
    --cbx-line: rgba(255, 106, 0, .45);
    --cbx-line-soft: rgba(255, 106, 0, .22);
    --cbx-card: #111111;
    --cbx-card2: #161616;
    position: relative;
    z-index: 5;
    max-width: 560px;
    margin: 0 auto;
    padding: 0 14px 110px;
    font-family: Montserrat, -apple-system, Segoe UI, Roboto, sans-serif;
    color: #fff;
    min-height: 100dvh;
    background: #000000;
}

#cashback-runtime-root,
#cashback-runtime-root *,
#cashback-runtime-root *::before,
#cashback-runtime-root *::after { box-sizing: border-box; }

/* Topo */
.cbx-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 -14px 12px;
    padding: 14px 14px 12px;
    background: linear-gradient(180deg, rgba(0, 0, 0, .97), rgba(0, 0, 0, .85));
    backdrop-filter: blur(10px);
}
.cbx-logo { display: inline-flex; align-items: center; min-width: 0; }
.cbx-logo img { height: 44px; width: auto; max-width: 220px; object-fit: contain; }
.cbx-logo strong { font-size: 18px; font-weight: 900; color: var(--cbx-g); }
.cbx-close {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    border: 1.5px solid var(--cbx-line);
    background: #111111;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: none;
    transition: background .15s ease, transform .15s ease;
}
.cbx-close:hover { background: #1a1a1a; transform: scale(1.04); }

/* Hero */
.cbx-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: 228px;
    border-radius: 20px;
    padding: 20px 18px;
    margin-bottom: 12px;
    background: #111111;
    border: 1.5px solid var(--cbx-line);
    box-shadow: none;
}
.cbx-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: none;
    mask-image: linear-gradient(90deg, transparent 35%, #000 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 35%, #000 100%);
    pointer-events: none;
}
.cbx-hero-copy { position: relative; z-index: 2; width: 62%; }
.cbx-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--cbx-g);
    margin-bottom: 10px;
}
.cbx-kicker i { font-size: 20px; }
.cbx-hero h1 {
    margin: 0 0 12px;
    font-size: 40px;
    line-height: .98;
    font-weight: 900;
    letter-spacing: -.035em;
    color: #fff;
}
.cbx-hero h1 span { color: var(--cbx-g); }
.cbx-hero p {
    margin: 0;
    color: rgba(255, 255, 255, .82);
    font-size: 12px;
    line-height: 1.5;
}
.cbx-hero-art {
    position: absolute;
    right: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 50%;
    max-width: 230px;
    z-index: 1;
    pointer-events: none;
}
.cbx-hero-art img {
    display: block;
    width: 100%;
    height: auto;
    mix-blend-mode: lighten;
    mask-image: radial-gradient(circle at 50% 50%, #000 52%, transparent 72%);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 52%, transparent 72%);
}
@media (max-width: 380px) {
    .cbx-hero h1 { font-size: 33px; }
    .cbx-hero p { font-size: 11px; }
}
@media (min-width: 520px) {
    .cbx-hero h1 { font-size: 46px; }
    .cbx-hero p { font-size: 13px; }
}

/* Faixa de espera */
.cbx-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px;
    margin-bottom: 14px;
    border-radius: 16px;
    background: linear-gradient(180deg, var(--cbx-card2), var(--cbx-card));
    border: 1.5px solid var(--cbx-line-soft);
}
.cbx-strip-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding-right: 12px;
    border-right: 1px solid rgba(255, 255, 255, .14);
    flex-shrink: 0;
}
.cbx-strip-main > i { color: var(--cbx-g); font-size: 22px; margin-top: 2px; }
.cbx-strip-main span { display: block; font-size: 12.5px; color: rgba(255, 255, 255, .85); }
.cbx-strip-main strong { display: block; font-size: 21px; font-weight: 900; color: var(--cbx-g); letter-spacing: -.02em; line-height: 1.2; white-space: nowrap; }
.cbx-strip-mid { flex: 1; min-width: 0; font-size: 11.5px; line-height: 1.4; color: rgba(255, 255, 255, .78); }
.cbx-strip-mid b { color: var(--cbx-g); }
.cbx-strip-date { display: flex; align-items: flex-start; gap: 8px; flex-shrink: 0; }
.cbx-strip-date > i { color: var(--cbx-g); font-size: 20px; margin-top: 2px; }
.cbx-strip-date strong { display: block; font-size: 12.5px; font-weight: 800; color: #fff; }
.cbx-strip-date span { display: block; font-size: 12.5px; font-weight: 800; color: #fff; }
@media (max-width: 370px) {
    .cbx-strip { flex-wrap: wrap; }
    .cbx-strip-mid { flex-basis: 40%; }
}

/* Cards */
.cbx-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.cbx-stat {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    width: 100%;
    padding: 14px 30px 14px 16px;
    min-height: 136px;
    border-radius: 16px;
    background: linear-gradient(180deg, var(--cbx-card2), var(--cbx-card));
    border: 1.5px solid var(--cbx-line-soft);
    color: #fff;
    cursor: pointer;
    transition: border-color .15s ease, transform .15s ease;
}
.cbx-stat:active { transform: scale(.985); }
.cbx-stat.is-filter { border-color: var(--cbx-g); }
.cbx-stat-ico { color: var(--cbx-g); font-size: 27px; line-height: 1; margin-bottom: 12px; }
.cbx-stat .lbl { display: block; font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.cbx-stat .val { display: block; font-size: 23px; font-weight: 900; letter-spacing: -.02em; color: #fff; white-space: nowrap; }
.cbx-stat .hint { display: block; margin-top: 4px; font-size: 11px; line-height: 1.3; color: rgba(255, 255, 255, .72); }
.cbx-stat-arrow { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 15px; color: rgba(255, 255, 255, .8); }
.cbx-stat--main {
    border-color: var(--cbx-g);
    background: #161616;
    box-shadow: none;
}
.cbx-stat--main .val { color: var(--cbx-g); }
@media (max-width: 380px) {
    .cbx-stat .val { font-size: 19px; }
    .cbx-stat { padding-left: 12px; }
}

/* Botões */
.cbx-actions { display: grid; gap: 12px; margin-bottom: 14px; }
.cbx-btn {
    position: relative;
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 16px 44px;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(180deg, #FF8C1A 0%, var(--cbx-g2) 100%);
    color: #111111 !important;
    text-decoration: none;
    box-shadow: none;
}
.cbx-btn > i:first-child { font-size: 21px; }
.cbx-btn-arrow { position: absolute; right: 16px; font-size: 15px; }
.cbx-btn-arrow-l { position: absolute; left: 16px; font-size: 15px; }
.cbx-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.cbx-btn-ghost {
    background: #111111;
    color: #fff !important;
    border: 1.5px solid var(--cbx-line);
    box-shadow: none;
    font-size: 16px;
}
.cbx-btn-ghost i { color: var(--cbx-g); }
.cbx-btn-ghost > i.fa-plus { font-size: 18px; color: #fff; }

/* Histórico */
.cbx-panel {
    background: linear-gradient(180deg, var(--cbx-card2), var(--cbx-card));
    border: 1.5px solid var(--cbx-line-soft);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 12px;
    scroll-margin-top: 80px;
}
.cbx-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.cbx-panel h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    font-weight: 800;
}
.cbx-panel h2 i { color: var(--cbx-g); font-size: 18px; }
.cbx-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 0;
    color: rgba(255, 255, 255, .85);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.cbx-link i { color: var(--cbx-g); font-size: 11px; }
.cbx-muted { font-size: 11px; color: rgba(255, 255, 255, .5); font-weight: 600; }

.cbx-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    background: rgba(0, 0, 0, .25);
    border: 1px solid rgba(255, 106, 0, .16);
    border-radius: 12px;
    padding: 11px 12px;
    margin-bottom: 8px;
}
.cbx-item:last-child { margin-bottom: 0; }
.cbx-item-ico {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(255, 106, 0, .12);
    color: var(--cbx-g);
    font-size: 15px;
}
.cbx-item[data-s="forfeited"] .cbx-item-ico { background: rgba(239, 68, 68, .12); color: #f87171; }
.cbx-item strong { display: block; font-size: 15px; margin-bottom: 2px; }
.cbx-item small { display: block; color: rgba(255, 255, 255, .5); font-size: 11px; line-height: 1.4; }

.cbx-st {
    font-size: 10px;
    font-weight: 800;
    border-radius: 999px;
    padding: 5px 9px;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: #1a2126;
    white-space: nowrap;
}
.cbx-st[data-s="available"] { background: rgba(255, 106, 0, .16); color: var(--cbx-g); }
.cbx-st[data-s="waiting"] { background: rgba(249, 115, 22, .16); color: #fdba74; }
.cbx-st[data-s="redeemed"] { background: rgba(59, 130, 246, .16); color: #60a5fa; }
.cbx-st[data-s="pending"] { background: rgba(234, 179, 8, .16); color: #facc15; }
.cbx-st[data-s="forfeited"] { background: rgba(239, 68, 68, .16); color: #f87171; }

.cbx-empty {
    text-align: center;
    padding: 24px 12px;
    color: rgba(255, 255, 255, .5);
    font-size: 13px;
}
.cbx-empty i { font-size: 22px; display: inline-block; margin-bottom: 8px; opacity: .45; }

.cbx-toast {
    position: sticky;
    top: 78px;
    z-index: 20;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: cbx-in .25s ease;
}
.cbx-toast--ok { background: rgba(255, 106, 0, .16); border: 1px solid rgba(255, 106, 0, .35); color: #FFB07A; }
.cbx-toast--err { background: rgba(239, 68, 68, .16); border: 1px solid rgba(239, 68, 68, .3); color: #fca5a5; }
@keyframes cbx-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

body.cb-rt-active #viperpro > *:not(#cashback-runtime-root) {
    display: none !important;
}

body.cb-rt-active #cashback-fab,
body.sc-chat-open #cashback-fab,
body.pfs-open #cashback-fab {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* FAB flutuante cashback — compacto com % */
#cashback-fab {
    position: fixed !important;
    right: 12px !important;
    bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 2147483000 !important;
    width: auto !important;
    min-width: 0 !important;
    height: 42px !important;
    padding: 0 10px 0 9px !important;
    border-radius: 13px !important;
    border: 1.5px solid rgba(255, 106, 0, 0.5) !important;
    background: #FF6A00 !important;
    background: var(--ci-primary-color, #FF6A00) !important;
    color: #111111 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    box-shadow: 0 8px 18px rgba(255, 106, 0, 0.28) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

#cashback-fab.is-visible {
    display: inline-flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

#cashback-fab:hover {
    transform: translateY(-2px) scale(1.03) !important;
}

#cashback-fab > i {
    font-size: 14px !important;
    line-height: 1 !important;
}

#cashback-fab .cb-fab-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.05;
    gap: 1px;
}

#cashback-fab .cb-fab-label {
    font-family: Montserrat, -apple-system, Segoe UI, Roboto, sans-serif;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.85;
}

#cashback-fab .cb-fab-pct {
    font-family: Montserrat, -apple-system, Segoe UI, Roboto, sans-serif;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1;
}

#cashback-fab .cb-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0a0e12;
}

#cashback-fab .cb-fab-badge[hidden] {
    display: none !important;
}

#cashback-fab .cb-fab-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 16px;
    border: 1.5px solid rgba(255, 106, 0, 0.5);
    animation: cb-fab-pulse 2s ease-out infinite;
    pointer-events: none;
}

@keyframes cb-fab-pulse {
    0% { opacity: 0.65; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.25); }
}

/* CTA menu lateral (inject) */
.sidebar-cta--cashback {
    background: linear-gradient(135deg, #111111 0%, #161616 100%) !important;
    border-color: color-mix(in srgb, var(--ci-primary-color, #FF6A00) 35%, transparent) !important;
    color: #fff !important;
}

.sidebar-cta--cashback .sidebar-cta__eyebrow {
    color: var(--ci-primary-color, #FF6A00) !important;
}

.sidebar-cta--cashback .sidebar-cta__icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--ci-primary-color, #FF6A00) 18%, transparent);
    color: var(--ci-primary-color, #FF6A00);
    font-size: 16px;
}
