/* ============================================================
   Vertex — Cookie Consent + Notification center styles
   Uses the existing theme variables (--bg-card, --accent, ...).
   Layer order:
     .vx-notif-panel  1250   (bell dropdown)
     #vxCookieBanner  1600   (cookie consent banner)
     #vxCookieModal   1700   (cookie preferences modal)
   ============================================================ */

/* ---------------- shared buttons ---------------- */

.vx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    font-family: var(--font, 'Inter', sans-serif);
}
.vx-btn:active { transform: scale(0.97); }

.vx-btn-primary {
    background: var(--accent, #00c8ff);
    color: #000;
    box-shadow: 0 2px 12px var(--accent-glow, rgba(0, 200, 255, 0.25));
}
.vx-btn-primary:hover { background: var(--accent-hover, #00b0e0); }

.vx-btn-outline {
    background: transparent;
    color: var(--text-primary, #eaeaf5);
    border-color: var(--border-color, #262652);
}
.vx-btn-outline:hover { border-color: var(--accent, #00c8ff); color: var(--accent, #00c8ff); }

.vx-btn-ghost {
    background: transparent;
    color: var(--text-secondary, #9494b8);
}
.vx-btn-ghost:hover { color: var(--text-primary, #eaeaf5); background: var(--accent-subtle, rgba(0, 200, 255, 0.08)); }

.vx-btn-link {
    background: transparent;
    color: var(--accent, #00c8ff);
    text-decoration: underline;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* ---------------- cookie consent banner ---------------- */

#vxCookieBanner {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(14px, env(safe-area-inset-bottom, 0px));
    z-index: 1600;
    display: flex;
    justify-content: center;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}
#vxCookieBanner.hide { opacity: 0; transform: translateY(16px); }

.vx-banner-card {
    pointer-events: auto;
    width: 100%;
    max-width: 880px;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card, #16163a);
    border: 1px solid var(--border-color, #262652);
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.vx-banner-copy { flex: 1; min-width: 0; }
.vx-banner-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.95rem;
    color: var(--text-primary, #eaeaf5);
}
.vx-banner-title i { color: var(--accent, #00c8ff); }
.vx-banner-copy p {
    margin: 0.3rem 0 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-secondary, #9494b8);
}

.vx-banner-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ---------------- cookie preferences modal ---------------- */

.vx-modal {
    position: fixed;
    inset: 0;
    z-index: 1700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.vx-modal.open { visibility: visible; opacity: 1; }

.vx-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.vx-modal-card {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: min(92dvh, 92vh);
    display: flex;
    flex-direction: column;
    background: var(--bg-card, #16163a);
    border: 1px solid var(--border-color, #262652);
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    transform: translateY(14px) scale(0.98);
    transition: transform 0.22s ease;
}
.vx-modal.open .vx-modal-card { transform: translateY(0) scale(1); }

.vx-modal-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color, #262652);
    flex-shrink: 0;
}
.vx-modal-head h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.vx-modal-head h3 i { color: var(--accent, #00c8ff); }
.vx-modal-x {
    margin-left: auto;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--bg-input, #12122e);
    color: var(--text-secondary, #9494b8);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.vx-modal-x:hover { color: var(--text-primary, #eaeaf5); }

.vx-modal-body {
    padding: 0.75rem 1.25rem 0.25rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.vx-modal-intro {
    margin: 0 0 0.9rem;
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--text-secondary, #9494b8);
}

.vx-cat {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-light, #1e1e48);
}
.vx-cat:last-child { border-bottom: none; }
.vx-cat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.vx-cat-top strong { font-size: 0.88rem; color: var(--text-primary, #eaeaf5); }
.vx-cat-badge {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    background: var(--accent-subtle, rgba(0, 200, 255, 0.08));
    color: var(--accent, #00c8ff);
    vertical-align: middle;
}
.vx-cat-desc {
    margin: 0.35rem 0 0;
    font-size: 0.76rem;
    line-height: 1.5;
    color: var(--text-muted, #5c5c8a);
}

.vx-modal-foot {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color, #262652);
    background: var(--bg-elevated, #1a1a42);
    flex-shrink: 0;
}
.vx-modal-foot .vx-btn-link { margin-left: auto; }

/* ---------------- toggle switch ---------------- */

.vx-switch {
    appearance: none;
    -webkit-appearance: none;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: var(--border-color, #262652);
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease;
    margin: 0;
}
.vx-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: left 0.2s ease;
}
.vx-switch:checked { background: var(--success, #00e676); }
.vx-switch:checked::after { left: 21px; }
.vx-switch:disabled { opacity: 0.55; cursor: not-allowed; }

@media (max-width: 768px) {
    .vx-banner-card {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
        padding: 0.9rem 1rem;
    }

    .vx-banner-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.55rem;
    }

    .vx-banner-actions .vx-btn {
        width: 100%;
        min-width: 0;
        white-space: normal;
        line-height: 1.3;
        padding: 0.7rem 0.7rem;
    }

    .vx-modal-card {
        max-height: 94dvh;
    }

    .vx-cat-top {
        align-items: flex-start;
        gap: 0.7rem;
    }

    .vx-cat-top > div {
        flex: 1 1 auto;
        min-width: 0;
    }

    .vx-switch {
        width: 46px;
        height: 26px;
    }

    .vx-switch::after {
        width: 20px;
        height: 20px;
        top: 3px;
        left: 3px;
    }

    .vx-switch:checked::after {
        left: 23px;
    }

    .vx-modal-foot {
        flex-direction: column;
        align-items: stretch;
    }

    .vx-modal-foot .vx-btn-link {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }
}

/* ---------------- notification center (bell dropdown) ---------------- */

.vx-notif-panel {
    position: fixed;
    top: 76px;
    right: 16px;
    width: 360px;
    max-width: calc(100vw - 24px);
    z-index: 1250;
    background: var(--bg-card, #16163a);
    border: 1px solid var(--border-color, #262652);
    border-radius: var(--radius, 10px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.vx-notif-panel.open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.vx-notif-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color, #262652);
    background: var(--bg-elevated, #1a1a42);
}
.vx-notif-head strong {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.vx-notif-head strong i { color: var(--accent, #00c8ff); }
.vx-notif-head-btn {
    margin-left: auto;
    border: none;
    background: none;
    color: var(--text-muted, #5c5c8a);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.3rem;
    border-radius: 6px;
}
.vx-notif-head-btn:hover { color: var(--accent, #00c8ff); }

/* Close (X) button — tap friendly, keeps the existing header style. */
.vx-notif-head-btn.vx-notif-close {
    font-size: 0.95rem;
    padding: 0.45rem 0.55rem;
    color: var(--text-muted, #5c5c8a);
}
.vx-notif-head-btn.vx-notif-close:hover,
.vx-notif-head-btn.vx-notif-close:focus-visible {
    color: var(--text-primary, #eaeaf5);
    background: var(--bg-input, #12122e);
}

.vx-notif-list {
    max-height: 340px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.vx-notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2.2rem 1rem;
    color: var(--text-muted, #5c5c8a);
    font-size: 0.8rem;
}
.vx-notif-empty i { font-size: 1.8rem; opacity: 0.35; }

.vx-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-light, #1e1e48);
    color: var(--text-primary, #eaeaf5);
    text-decoration: none;
    transition: background 0.15s ease;
}
.vx-notif-item:last-child { border-bottom: none; }
.vx-notif-item:hover { background: var(--accent-subtle, rgba(0, 200, 255, 0.06)); }
.vx-notif-item.unread { background: var(--accent-subtle, rgba(0, 200, 255, 0.08)); box-shadow: inset 3px 0 0 var(--accent, #00c8ff); }

.vx-notif-ico {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}
.vx-notif-t-order { background: var(--info-bg, rgba(68, 138, 255, 0.14)); color: var(--info, #448aff); }
.vx-notif-t-payment { background: var(--success-bg, rgba(0, 230, 118, 0.12)); color: var(--success, #00e676); }
.vx-notif-t-vendor { background: var(--warning-bg, rgba(255, 214, 0, 0.12)); color: var(--warning, #ffd600); }
.vx-notif-t-promo { background: var(--danger-bg, rgba(255, 23, 68, 0.12)); color: var(--danger, #ff1744); }
.vx-notif-t-success { background: var(--success-bg, rgba(0, 230, 118, 0.12)); color: var(--success, #00e676); }
.vx-notif-t-info { background: var(--info-bg, rgba(68, 138, 255, 0.14)); color: var(--info, #448aff); }

.vx-notif-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.vx-notif-title { font-size: 0.82rem; font-weight: 600; }
.vx-notif-msg {
    font-size: 0.74rem;
    color: var(--text-secondary, #9494b8);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.vx-notif-time { font-size: 0.66rem; color: var(--text-muted, #5c5c8a); }

.vx-notif-foot {
    padding: 0.65rem 1rem;
    border-top: 1px solid var(--border-color, #262652);
    text-align: center;
    background: var(--bg-elevated, #1a1a42);
}
.vx-notif-foot a {
    color: var(--accent, #00c8ff);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
}
.vx-notif-foot a:hover { text-decoration: underline; }

/* ---------------- responsive ---------------- */

@media (max-width: 768px) {
    .vx-banner-card {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.9rem 0.95rem;
    }
    .vx-banner-actions {
        flex-wrap: wrap;
        width: 100%;
    }
    .vx-banner-actions .vx-btn {
        flex: 1 1 auto;
        min-width: calc(50% - 0.25rem);
        padding: 0.5rem 0.6rem;
        font-size: 0.74rem;
    }

    .vx-modal-foot .vx-btn {
        flex: 1 1 auto;
    }
    .vx-modal-foot .vx-btn-link { flex: 0 0 auto; margin-left: 0; }

    .vx-notif-panel {
        top: auto;
        right: 10px;
        left: 10px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 76px);
        width: auto;
        max-width: none;
        max-height: min(65vh, 480px);
        transform: translateY(14px);
        display: flex;
        flex-direction: column;
    }
    .vx-notif-panel.open { transform: translateY(0); }
    .vx-notif-list { max-height: none; flex: 1; }
}

@media (max-width: 480px) {
    .vx-banner-actions .vx-btn {
        flex: 1 1 100%;
        min-width: 100%;
    }
}
