/*
 * FeedStorm Pro — CCPA "Do Not Sell or Share" opt-out control.
 *
 * Brand colors are runtime-bound: --fsp-dns-primary / --fsp-dns-accent /
 * --fsp-dns-highlight / --fsp-dns-on-primary are emitted by PHP from the
 * merchant's selected palette (PaletteResolver) via wp_add_inline_style. This
 * file contains NO color literal — neutral chrome uses rgb()/keyword notation,
 * brand roles use the variables, and the AA text/CTA shade is derived with
 * color-mix. WCAG AA: text-bearing brand roles use --fsp-dns-primary-ink
 * (primary darkened ~12%); decorative roles use the raw primary.
 */

:root {
    /* Neutral control chrome (light) — not from palette, so dark mode can adapt. */
    --fsp-dns-surface: white;
    --fsp-dns-surface-2: rgb(251 252 253);
    --fsp-dns-text: rgb(29 35 39);
    --fsp-dns-muted: rgb(91 99 107);
    --fsp-dns-border: rgb(226 230 234);
    --fsp-dns-border-strong: rgb(198 205 211);
    --fsp-dns-scrim: rgba(8 14 18 / 0.55);
    --fsp-dns-shadow: 0 10px 40px rgba(20 30 40 / 0.18);

    /* AA text/CTA shade derived from the runtime primary (no literal). */
    --fsp-dns-primary-ink: color-mix(in srgb, var(--fsp-dns-primary) 88%, black);

    --fsp-dns-tap: 44px;
    --fsp-dns-radius: 12px;
    --fsp-dns-t: 240ms cubic-bezier(0.4, 0, 0.2, 1);
    --fsp-dns-t-fast: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --fsp-dns-surface: rgb(23 30 34);
        --fsp-dns-surface-2: rgb(29 38 43);
        --fsp-dns-text: rgb(231 237 240);
        --fsp-dns-muted: rgb(163 173 180);
        --fsp-dns-border: rgb(42 53 59);
        --fsp-dns-border-strong: rgb(58 71 78);
        --fsp-dns-shadow: 0 14px 50px rgba(0 0 0 / 0.55);
        /* On dark surfaces, brand text uses the lighter palette accent. */
        --fsp-dns-primary-ink: var(--fsp-dns-accent);
    }
}

/* ── Footer entry-point link ──────────────────────────────────────────── */
.fsp-dns-entry {
    display: inline-flex;
}
.fsp-dns-entry__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: var(--fsp-dns-tap);
    padding: 0 6px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    color: var(--fsp-dns-text);
    border-bottom: 2px solid transparent;
    transition: color var(--fsp-dns-t-fast), border-color var(--fsp-dns-t-fast);
}
.fsp-dns-entry__link:hover,
.fsp-dns-entry__link:focus-visible {
    color: var(--fsp-dns-primary-ink);
    border-bottom-color: var(--fsp-dns-primary);
}
.fsp-dns-entry__shield {
    width: 16px;
    height: 18px;
    flex: 0 0 auto;
    background-color: currentColor;
    -webkit-mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3l7 3v5c0 4.4-3 8.4-7 9.8C8 18.4 5 14.4 5 11V6z'/%3E%3C/svg%3E");
    mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3l7 3v5c0 4.4-3 8.4-7 9.8C8 18.4 5 14.4 5 11V6z'/%3E%3C/svg%3E");
}

/* ── Overlay + dialog ─────────────────────────────────────────────────── */
.fsp-dns-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: var(--fsp-dns-scrim);
    animation: fsp-dns-fade var(--fsp-dns-t) both;
}
.fsp-dns-overlay[hidden] {
    display: none;
}
@media (min-width: 640px) {
    .fsp-dns-overlay {
        align-items: center;
        padding: 24px;
    }
}
.fsp-dns-dialog {
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow: auto;
    background: var(--fsp-dns-surface);
    color: var(--fsp-dns-text);
    border-radius: 18px 18px 0 0;
    box-shadow: var(--fsp-dns-shadow);
    animation: fsp-dns-rise var(--fsp-dns-t) both;
}
@media (min-width: 640px) {
    .fsp-dns-dialog {
        border-radius: 18px;
    }
}
.fsp-dns-dialog__head {
    position: relative;
    padding: 20px 52px 6px 20px;
}
.fsp-dns-dialog__title {
    margin: 0;
    font-size: 19px;
    line-height: 1.3;
}
.fsp-dns-dialog__desc {
    margin: 6px 0 0;
    font-size: 14px;
    color: var(--fsp-dns-muted);
}
.fsp-dns-dialog__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: var(--fsp-dns-tap);
    height: var(--fsp-dns-tap);
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--fsp-dns-muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background var(--fsp-dns-t-fast), color var(--fsp-dns-t-fast);
}
.fsp-dns-dialog__close:hover {
    background: var(--fsp-dns-surface-2);
    color: var(--fsp-dns-text);
}
.fsp-dns-dialog__body {
    padding: 8px 20px 4px;
}

/* ── Choice row + accessible switch ───────────────────────────────────── */
.fsp-dns-choice {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin: 14px 0;
    padding: 14px;
    background: var(--fsp-dns-surface-2);
    border: 1px solid var(--fsp-dns-border);
    border-radius: var(--fsp-dns-radius);
}
.fsp-dns-choice__meta {
    flex: 1 1 auto;
}
.fsp-dns-choice__title {
    margin: 0 0 3px;
    font-size: 15px;
}
.fsp-dns-choice__text {
    margin: 0;
    font-size: 13.5px;
    color: var(--fsp-dns-muted);
}
.fsp-dns-switch {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--fsp-dns-tap);
    min-height: var(--fsp-dns-tap);
}
.fsp-dns-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.fsp-dns-switch input:disabled {
    cursor: not-allowed;
}
.fsp-dns-switch__track {
    position: relative;
    width: 52px;
    height: 30px;
    border-radius: 999px;
    background: var(--fsp-dns-border-strong);
    transition: background var(--fsp-dns-t);
}
.fsp-dns-switch__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--fsp-dns-surface);
    border: 1px solid rgba(0 0 0 / 0.28);
    box-shadow: 0 1px 3px rgba(0 0 0 / 0.4);
    transition: transform var(--fsp-dns-t);
}
/* Scoped under .fsp-dns-overlay so the brand fill beats theme (e.g. WoodMart)
   button/control background rules without !important. */
.fsp-dns-overlay .fsp-dns-switch input:checked + .fsp-dns-switch__track {
    background: var(--fsp-dns-primary);
}
.fsp-dns-switch input:checked + .fsp-dns-switch__track .fsp-dns-switch__thumb {
    transform: translateX(22px);
}
.fsp-dns-switch input:focus-visible + .fsp-dns-switch__track {
    outline: 3px solid var(--fsp-dns-primary);
    outline-offset: 2px;
}
.fsp-dns-switch input:disabled + .fsp-dns-switch__track {
    opacity: 0.75;
}

/* ── GPC note, status, policy ─────────────────────────────────────────── */
.fsp-dns-gpc-note {
    margin: 14px 0;
    padding: 12px 14px;
    font-size: 13.5px;
    border-radius: var(--fsp-dns-radius);
    border: 1px solid color-mix(in srgb, var(--fsp-dns-primary) 45%, var(--fsp-dns-border));
    background: color-mix(in srgb, var(--fsp-dns-primary) 12%, transparent);
}
.fsp-dns-gpc-note[hidden] {
    display: none;
}
.fsp-dns-status {
    margin: 16px 0 6px;
    font-size: 14px;
    font-weight: 700;
}
.fsp-dns-policy {
    margin: 10px 0 4px;
    font-size: 13px;
    color: var(--fsp-dns-muted);
}
.fsp-dns-policy a {
    font-weight: 700;
    color: var(--fsp-dns-primary-ink);
}

/* ── Footer buttons ───────────────────────────────────────────────────── */
.fsp-dns-dialog__foot {
    position: sticky;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 20px 22px;
    background: linear-gradient(180deg, transparent, var(--fsp-dns-surface) 22%);
}
@media (min-width: 480px) {
    .fsp-dns-dialog__foot {
        flex-direction: row;
        justify-content: flex-end;
    }
}
.fsp-dns-btn {
    min-height: var(--fsp-dns-tap);
    padding: 0 20px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--fsp-dns-t-fast), border-color var(--fsp-dns-t-fast), color var(--fsp-dns-t-fast);
}
.fsp-dns-overlay .fsp-dns-btn--primary {
    background: var(--fsp-dns-primary-ink);
    color: var(--fsp-dns-on-primary);
}
.fsp-dns-overlay .fsp-dns-btn--primary:hover {
    background: color-mix(in srgb, var(--fsp-dns-primary-ink) 88%, black);
}
.fsp-dns-btn--ghost {
    background: transparent;
    color: var(--fsp-dns-text);
    border-color: var(--fsp-dns-border-strong);
}
.fsp-dns-btn--ghost:hover {
    background: var(--fsp-dns-surface-2);
}
.fsp-dns-btn:focus-visible,
.fsp-dns-dialog__close:focus-visible,
.fsp-dns-entry__link:focus-visible {
    outline: 3px solid var(--fsp-dns-primary);
    outline-offset: 2px;
}

@keyframes fsp-dns-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fsp-dns-rise {
    from { transform: translateY(24px); opacity: 0.6; }
    to { transform: translateY(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .fsp-dns-overlay,
    .fsp-dns-dialog,
    .fsp-dns-switch__track,
    .fsp-dns-switch__thumb,
    .fsp-dns-btn,
    .fsp-dns-entry__link {
        animation-duration: 0.001ms;
        transition-duration: 0.001ms;
    }
}
