/* Cookie-consent modal (first-party CMP) — Vape Big.
   Loaded from template/consent_init.php on every page that can run a tag.

   Ported from vapeandgo/core/css/cookie-consent.css and re-skinned to Vape
   Big's own language: monochrome ink rather than VapeAndGo's teal/green,
   square buttons, Inter inherited from the page. Falls back to literal hex
   values so the dialog is still legible if critical.css has not applied.

   VapeAndGo's age-gate "embedded mode" blocks are deliberately NOT ported —
   Vape Big only triggers its age modal on the homepage, so the consent
   dialog stands alone here. See core/cookie-consent.js.

   z-index note: the overlay sits BELOW bootstrap modals/backdrops
   (1040/1050) so the 18+ age-verification modal keeps priority; the consent
   dialog is revealed when the age gate closes. */

.fv-cc-overlay {
    position: fixed;
    inset: 0;
    z-index: 1039;
    background: rgba(10, 10, 10, .58);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fv-cc-fade .18s ease-out;
}

@keyframes fv-cc-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fv-cc-modal {
    background: #fff;
    border-radius: 2px;
    max-width: 600px;
    width: 100%;
    max-height: 88vh;
    overflow: auto;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .32);
    font-family: var(--vb-font-body, 'Inter', system-ui, sans-serif);
    animation: fv-cc-rise .22s ease-out;
    position: relative;
}

@keyframes fv-cc-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

.fv-cc-brandbar {
    height: 4px;
    background: var(--vb-ink, #0a0a0a);
}

.fv-cc-body {
    padding: 22px 24px 20px;
}

.fv-cc-modal h3 {
    margin: 0 0 8px;
    font-family: var(--vb-font-display, 'Inter Tight', 'Inter', system-ui, sans-serif);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--vb-ink, #0a0a0a);
}

.fv-cc-text {
    margin: 0 0 16px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--vb-text-muted, #52525b);
}

.fv-cc-modal a {
    color: var(--vb-ink, #0a0a0a);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Action buttons ──────────────────────────────────────────────────────
   "Accept all" and "Reject non-essential" keep EQUAL prominence (ICO
   guidance) — same size and weight, different fill only. Square corners
   match the site's button language. */
.fv-cc-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.fv-cc-actions-spacer {
    flex: 1;
}

.fv-cc-btn {
    border: 1px solid var(--vb-ink, #0a0a0a);
    border-radius: 0;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
    font-family: inherit;
}

.fv-cc-accept-btn {
    background: var(--vb-ink, #0a0a0a);
    color: #fff;
}

.fv-cc-reject-btn {
    background: #fff;
    color: var(--vb-ink, #0a0a0a);
}

.fv-cc-save-btn {
    background: var(--vb-surface, #f4f4f5);
    color: var(--vb-ink, #0a0a0a);
}

.fv-cc-btn:hover {
    filter: brightness(.93);
}

.fv-cc-btn:focus-visible,
.fv-cc-linkbtn:focus-visible,
.fv-cc-showcookies:focus-visible,
.fv-cc-close:focus-visible,
.fv-cc-switch input:focus-visible + span {
    outline: 2px solid var(--vb-ink, #0a0a0a);
    outline-offset: 2px;
}

.fv-cc-linkbtn {
    background: none;
    border: 0;
    color: var(--vb-ink, #0a0a0a);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-size: 13px;
    cursor: pointer;
    padding: 6px 2px;
    font-family: inherit;
}

.fv-cc-back {
    position: absolute;
    top: 14px;
    left: 18px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.fv-cc-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: 0;
    font-size: 26px;
    line-height: 1;
    color: var(--vb-text-faint, #6b7280);
    cursor: pointer;
    padding: 4px 8px;
}

.fv-cc-close:hover {
    color: var(--vb-ink, #0a0a0a);
}

.fv-cc-back + h3,
.fv-cc-close + h3 {
    margin-top: 14px;
}

/* ── Category cards (settings view) ─────────────────────────────────── */
.fv-cc-cats {
    margin-bottom: 16px;
}

.fv-cc-cat {
    border: 1px solid var(--vb-border, #ededed);
    border-radius: 2px;
    padding: 13px 14px 10px;
    margin-bottom: 10px;
    background: var(--vb-surface, #f4f4f5);
}

.fv-cc-cat-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.fv-cc-cat-titles h4 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 700;
    color: var(--vb-ink, #0a0a0a);
}

.fv-cc-cat-titles p {
    margin: 0;
    font-size: 12.5px;
    color: var(--vb-text-muted, #52525b);
    line-height: 1.45;
}

.fv-cc-always {
    font-size: 12px;
    font-weight: 700;
    color: var(--vb-text-faint, #6b7280);
    white-space: nowrap;
    padding-top: 3px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* "Show cookies" expander + per-cookie table */
.fv-cc-showcookies {
    background: none;
    border: 0;
    padding: 6px 0 2px;
    font-size: 12px;
    font-weight: 600;
    color: var(--vb-ink, #0a0a0a);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-family: inherit;
}

.fv-cc-showcookies::after {
    content: " \25BE";
}

.fv-cc-showcookies.fv-cc-open::after {
    content: " \25B4";
}

.fv-cc-cookielist {
    overflow-x: auto;
    margin-top: 6px;
}

.fv-cc-cookielist table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.fv-cc-cookielist th {
    text-align: left;
    color: var(--vb-label, #9ca3af);
    font-weight: 600;
    padding: 4px 8px 4px 0;
    border-bottom: 1px solid var(--vb-border, #ededed);
    white-space: nowrap;
}

.fv-cc-cookielist td {
    padding: 5px 8px 5px 0;
    color: var(--vb-text-muted, #52525b);
    border-bottom: 1px solid var(--vb-border, #ededed);
    vertical-align: top;
}

.fv-cc-cookielist td:first-child {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    white-space: nowrap;
}

/* ── Toggle switch ──────────────────────────────────────────────────── */
.fv-cc-switch {
    position: relative;
    flex: none;
    width: 44px;
    height: 24px;
    margin-top: 2px;
}

.fv-cc-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.fv-cc-switch span {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: #c9c9ce;
    transition: background .15s;
    pointer-events: none;
}

.fv-cc-switch span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform .15s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}

.fv-cc-switch input:checked + span {
    background: var(--vb-ink, #0a0a0a);
}

.fv-cc-switch input:checked + span::after {
    transform: translateX(20px);
}

/* ── Age-gate embedded mode ─────────────────────────────────────────
   The consent question rides inside the age-verification modal
   (#fv-cc-agegate row in footer.php, revealed by core/cookie-consent.js).
   One dialog, one click: checkbox state + "Yes, I'm over 18". */
.fv-cc-agegate {
    margin: 18px auto 4px;
    max-width: 360px;
    text-align: left;
    background: var(--vb-surface, #f4f4f5);
    border: 1px solid var(--vb-border, #ededed);
    border-radius: 2px;
    padding: 11px 13px;
}

.fv-cc-agegate-check {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    cursor: pointer;
    font-size: 12.5px;
    color: var(--vb-text-muted, #52525b);
    line-height: 1.45;
    margin: 0;
    font-weight: 400;
}

.fv-cc-agegate-check input {
    width: 16px;
    height: 16px;
    flex: none;
    margin: 1px 0 0;
    cursor: pointer;
    accent-color: var(--vb-ink, #0a0a0a);
}

.fv-cc-agegate-check em {
    font-style: normal;
    color: var(--vb-label, #9ca3af);
}

.fv-cc-agegate-links {
    margin: 7px 0 0 25px;
    display: flex;
    gap: 16px;
}

.fv-cc-agegate-links a {
    font-size: 12px;
    color: var(--vb-ink, #0a0a0a);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.fv-cc-agegate-done {
    margin: 0;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--vb-ink, #0a0a0a);
    line-height: 1.4;
}

/* Settings overlay opened from inside the age modal must sit ABOVE it.
   #age_verification_modal carries z-index 2147483647 (critical.css), which is
   the int32 maximum — so match it: with equal z-index the LATER element in the
   DOM paints on top, and this overlay is appended to <body> after the modal,
   so it wins. */
.fv-cc-overlay.fv-cc-ontop {
    z-index: 2147483647;
}

@media (prefers-reduced-motion: reduce) {
    .fv-cc-overlay,
    .fv-cc-modal {
        animation: none;
    }

    .fv-cc-switch span,
    .fv-cc-switch span::after {
        transition: none;
    }
}

/* ── Mobile ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .fv-cc-overlay {
        padding: 10px;
        align-items: flex-end;
    }

    .fv-cc-body {
        padding: 18px 16px 16px;
    }

    .fv-cc-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .fv-cc-actions-spacer {
        display: none;
    }

    .fv-cc-btn {
        width: 100%;
    }

    .fv-cc-linkbtn.fv-cc-goto-prefs {
        order: 5;
        text-align: center;
    }
}
