/* STIVO — banner consentimiento cookies (RGPD / ePrivacy) */

#stivo-cookie-banner {
    position: fixed;
    /* Por debajo del modal de auth (.auth-overlay z-index 2000) para que registro desde el banner sea usable */
    z-index: 1800;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1rem;
    pointer-events: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

#stivo-cookie-banner * {
    box-sizing: border-box;
}

.stivo-cc-inner {
    max-width: 960px;
    margin: 0 auto;
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--stivo-cc-border, #dee2e6);
    border-radius: 16px;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.12), 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 1.25rem 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

html.dark .stivo-cc-inner {
    background: rgba(26, 26, 26, 0.98);
    border-color: var(--stivo-cc-border, #2e2e2e);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45), 0 4px 24px rgba(0, 0, 0, 0.35);
}

.stivo-cc-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--stivo-cc-text, #111827);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stivo-cc-title svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--stivo-cc-accent, #059669);
}

html.dark .stivo-cc-title {
    color: var(--stivo-cc-text, #f3f4f6);
}

html.dark .stivo-cc-title svg {
    color: var(--stivo-cc-accent, #34d399);
}

.stivo-cc-text {
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--stivo-cc-muted, #4b5563);
    margin: 0;
}

html.dark .stivo-cc-text {
    color: var(--stivo-cc-muted, #a1a1aa);
}

.stivo-cc-text a {
    color: var(--stivo-cc-accent, #059669);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

html.dark .stivo-cc-text a {
    color: var(--stivo-cc-accent, #34d399);
}

.stivo-cc-prefs {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--stivo-cc-border, #e5e7eb);
}

html.dark .stivo-cc-prefs {
    border-top-color: #2e2e2e;
}

.stivo-cc-prefs.is-open {
    display: flex;
}

.stivo-cc-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.8125rem;
}

.stivo-cc-row-info strong {
    display: block;
    color: var(--stivo-cc-text, #111827);
    margin-bottom: 0.2rem;
}

html.dark .stivo-cc-row-info strong {
    color: #f3f4f6;
}

.stivo-cc-row-info span {
    color: var(--stivo-cc-muted, #6b7280);
    line-height: 1.45;
}

.stivo-cc-switch {
    position: relative;
    width: 44px;
    height: 26px;
    flex-shrink: 0;
}

.stivo-cc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.stivo-cc-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d1d5db;
    border-radius: 26px;
    transition: background 0.2s;
}

.stivo-cc-slider::before {
    position: absolute;
    content: '';
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.stivo-cc-switch input:checked + .stivo-cc-slider {
    background: var(--stivo-cc-accent, #059669);
}

html.dark .stivo-cc-switch input:checked + .stivo-cc-slider {
    background: #34d399;
}

.stivo-cc-switch input:checked + .stivo-cc-slider::before {
    transform: translateX(18px);
}

.stivo-cc-switch input:disabled + .stivo-cc-slider {
    opacity: 0.55;
    cursor: not-allowed;
}

.stivo-cc-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.65rem;
}

.stivo-cc-btn {
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.stivo-cc-btn-primary {
    background: var(--stivo-cc-accent, #059669);
    color: #fff;
}

.stivo-cc-btn-primary:hover {
    background: var(--stivo-cc-accent-dark, #047857);
}

html.dark .stivo-cc-btn-primary {
    background: #10b981;
    color: #052e26;
}

html.dark .stivo-cc-btn-primary:hover {
    background: #34d399;
}

.stivo-cc-btn-secondary {
    background: transparent;
    color: var(--stivo-cc-text, #111827);
    border-color: var(--stivo-cc-border, #d1d5db);
}

.stivo-cc-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.04);
}

html.dark .stivo-cc-btn-secondary {
    color: #e5e7eb;
    border-color: #3f3f46;
}

html.dark .stivo-cc-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
}

.stivo-cc-btn-ghost {
    background: transparent;
    color: var(--stivo-cc-muted, #4b5563);
    border: none;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 0.55rem 0.5rem;
}

.stivo-cc-btn-ghost:hover {
    color: var(--stivo-cc-text, #111827);
}

html.dark .stivo-cc-btn-ghost:hover {
    color: #f3f4f6;
}

.stivo-cc-spacer {
    flex: 1;
    min-width: 0.5rem;
}

@media (max-width: 640px) {
    .stivo-cc-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .stivo-cc-spacer {
        display: none;
    }

    .stivo-cc-btn {
        width: 100%;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stivo-cc-slider,
    .stivo-cc-slider::before,
    .stivo-cc-btn {
        transition: none;
    }
}
