/* ============================================================
   BookinTrade — Consent Banner
   Self-hosted, vanilla, dark theme + turquesa #00D4AA.
   Mobile-first (responsive a 360px), accesible (aria, focus trap, ESC).
   ============================================================ */

/* Variables locales — no dependemos del resto del CSS para que
   también funcione en delete-account.html que tiene su propio
   <style> inline sin variables globales. */
.bt-consent-root {
    --bt-cc-bg:        #13131f;
    --bt-cc-bg-alt:    #1c1c2b;
    --bt-cc-border:    #2a2a3a;
    --bt-cc-fg:        #e8e8ec;
    --bt-cc-fg-mute:   #9a9aa4;
    --bt-cc-accent:    #00D4AA;
    --bt-cc-accent-fg: #0a0a14;
    --bt-cc-danger:    #f87171;
    --bt-cc-radius:    12px;
    --bt-cc-shadow:    0 8px 32px rgba(0, 0, 0, 0.6);
    --bt-cc-z-banner:  2147483640;
    --bt-cc-z-modal:   2147483646;
    --bt-cc-z-fab:     2147483630;
}

/* ---------- Banner inferior ------------------------------- */
.bt-consent-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    background: var(--bt-cc-bg);
    color: var(--bt-cc-fg);
    border: 1px solid var(--bt-cc-border);
    border-radius: var(--bt-cc-radius);
    box-shadow: var(--bt-cc-shadow);
    padding: 16px 20px;
    z-index: var(--bt-cc-z-banner);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 720px;
    margin: 0 auto;
}

.bt-consent-banner__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--bt-cc-fg);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bt-consent-banner__body {
    color: var(--bt-cc-fg-mute);
    font-size: 13px;
    margin: 0;
}

.bt-consent-banner__body a {
    color: var(--bt-cc-accent);
    text-decoration: underline;
}

.bt-consent-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

/* ---------- Botones ---------------------------------------- */
.bt-consent-btn {
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
    transition: opacity 120ms ease, transform 120ms ease;
}
.bt-consent-btn:hover  { opacity: 0.92; }
.bt-consent-btn:active { transform: translateY(1px); }
.bt-consent-btn:focus-visible {
    outline: 2px solid var(--bt-cc-accent);
    outline-offset: 2px;
}

.bt-consent-btn--primary {
    background: var(--bt-cc-accent);
    color: var(--bt-cc-accent-fg);
    border-color: var(--bt-cc-accent);
}
.bt-consent-btn--secondary {
    background: var(--bt-cc-bg-alt);
    color: var(--bt-cc-fg);
    border-color: var(--bt-cc-border);
}
.bt-consent-btn--ghost {
    background: transparent;
    color: var(--bt-cc-fg-mute);
    border-color: transparent;
    text-decoration: underline;
    padding: 10px 8px;
}

/* ---------- Modal de configuración ------------------------- */
.bt-consent-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: var(--bt-cc-z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.bt-consent-modal {
    background: var(--bt-cc-bg);
    color: var(--bt-cc-fg);
    border: 1px solid var(--bt-cc-border);
    border-radius: var(--bt-cc-radius);
    box-shadow: var(--bt-cc-shadow);
    padding: 24px;
    max-width: 520px;
    width: 100%;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.55;
}

.bt-consent-modal__title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--bt-cc-fg);
}

.bt-consent-modal__subtitle {
    color: var(--bt-cc-fg-mute);
    font-size: 13px;
    margin: 0 0 20px;
}

.bt-consent-cat {
    background: var(--bt-cc-bg-alt);
    border: 1px solid var(--bt-cc-border);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.bt-consent-cat__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.bt-consent-cat__name {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--bt-cc-fg);
}

.bt-consent-cat__desc {
    color: var(--bt-cc-fg-mute);
    font-size: 12.5px;
    margin: 4px 0 0;
}

/* Switch toggle accesible (vanilla, no librerías) */
.bt-consent-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}
.bt-consent-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.bt-consent-switch__slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #4a4a5a;
    border-radius: 24px;
    transition: background 180ms ease;
}
.bt-consent-switch__slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 180ms ease;
}
.bt-consent-switch input:checked + .bt-consent-switch__slider {
    background: var(--bt-cc-accent);
}
.bt-consent-switch input:checked + .bt-consent-switch__slider::before {
    transform: translateX(18px);
}
.bt-consent-switch input:disabled + .bt-consent-switch__slider {
    opacity: 0.5;
    cursor: not-allowed;
}
.bt-consent-switch input:focus-visible + .bt-consent-switch__slider {
    outline: 2px solid var(--bt-cc-accent);
    outline-offset: 2px;
}

.bt-consent-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    justify-content: flex-end;
}

/* ---------- Botón flotante "🍪 Privacidad" ----------------- */
.bt-consent-fab {
    position: fixed;
    left: 16px;
    bottom: 16px;
    background: var(--bt-cc-bg);
    color: var(--bt-cc-fg);
    border: 1px solid var(--bt-cc-border);
    border-radius: 999px;
    padding: 10px 14px;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    z-index: var(--bt-cc-z-fab);
    min-height: 36px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: transform 150ms ease, opacity 150ms ease;
    opacity: 0.85;
}
.bt-consent-fab:hover { opacity: 1; transform: translateY(-1px); }
.bt-consent-fab:focus-visible {
    outline: 2px solid var(--bt-cc-accent);
    outline-offset: 2px;
    opacity: 1;
}

/* ---------- Mobile (≤480px) -------------------------------- */
@media (max-width: 480px) {
    .bt-consent-banner {
        left: 8px;
        right: 8px;
        bottom: 8px;
        padding: 14px 16px;
        font-size: 13px;
    }
    .bt-consent-banner__title { font-size: 14px; }
    .bt-consent-banner__actions { justify-content: stretch; }
    .bt-consent-btn--primary,
    .bt-consent-btn--secondary { flex: 1 1 auto; }
    .bt-consent-modal { padding: 18px; }
    .bt-consent-fab { left: 8px; bottom: 8px; padding: 8px 12px; font-size: 12px; }
}

/* Respeta prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .bt-consent-btn,
    .bt-consent-switch__slider,
    .bt-consent-switch__slider::before,
    .bt-consent-fab { transition: none; }
}
