/* ============================================================
   MedExpert IA — Banner de consentimiento de cookies
   Coherente con landing.css (variables --brand-*, --bg-*).
   ============================================================ */

.mxh-cc-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 2000;
    max-width: 1080px;
    margin: 0 auto;
    padding: 1rem 1.15rem;
    background: rgba(15, 15, 35, 0.96);
    color: #f1f5f9;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(99, 102, 241, 0.15);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    transform: translateY(120%);
    opacity: 0;
    transition: transform 280ms cubic-bezier(.2,.7,.2,1),
                opacity 220ms ease-out;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.88rem;
    line-height: 1.4;
}

.mxh-cc-banner.is-open {
    transform: translateY(0);
    opacity: 1;
}

.mxh-cc-text {
    flex: 1 1 360px;
    min-width: 0;
}

.mxh-cc-title {
    margin: 0 0 0.25rem;
    font-size: 0.96rem;
    font-weight: 600;
    color: #ffffff;
}

.mxh-cc-desc {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.83rem;
}

.mxh-cc-link {
    color: #a5b4fc;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.mxh-cc-link:hover {
    color: #c7d2fe;
}

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

.mxh-cc-btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0.6rem 1.05rem;
    font: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease,
                color 160ms ease, transform 120ms ease;
    white-space: nowrap;
}

.mxh-cc-btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
}
.mxh-cc-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(139, 92, 246, 0.5);
}

.mxh-cc-btn-outline {
    background: transparent;
    color: #c7d2fe;
    border-color: rgba(165, 180, 252, 0.45);
}
.mxh-cc-btn-outline:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(165, 180, 252, 0.75);
    color: #ffffff;
}

.mxh-cc-btn-ghost {
    background: transparent;
    color: #94a3b8;
    border-color: transparent;
}
.mxh-cc-btn-ghost:hover {
    color: #ffffff;
    background: rgba(148, 163, 184, 0.12);
}

/* Mobile: stack vertical */
@media (max-width: 720px) {
    .mxh-cc-banner {
        left: 0.6rem;
        right: 0.6rem;
        bottom: 0.6rem;
        padding: 0.9rem 0.95rem 1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }
    .mxh-cc-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.45rem;
    }
    .mxh-cc-actions .mxh-cc-btn-primary {
        grid-column: 1 / -1;
    }
    .mxh-cc-btn {
        padding: 0.7rem 0.85rem;
        font-size: 0.82rem;
    }
    .mxh-cc-title { font-size: 0.92rem; }
    .mxh-cc-desc  { font-size: 0.8rem; }
}

/* ============================================================
   Modal de configuración granular
   ============================================================ */

.mxh-cc-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2100;
    background: rgba(15, 15, 35, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 220ms ease-out;
}
.mxh-cc-modal-overlay.is-open { opacity: 1; }

.mxh-cc-modal {
    position: relative;
    background: #ffffff;
    color: #0f172a;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 2rem);
    overflow: auto;
    border-radius: 16px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
    padding: 1.4rem 1.4rem 1.2rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    transform: scale(0.96) translateY(10px);
    transition: transform 240ms cubic-bezier(.2,.7,.2,1);
}
.mxh-cc-modal-overlay.is-open .mxh-cc-modal {
    transform: scale(1) translateY(0);
}

.mxh-cc-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.65rem;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.7rem;
    line-height: 1;
    color: #64748b;
    border-radius: 8px;
    transition: background 120ms ease, color 120ms ease;
}
.mxh-cc-modal-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.mxh-cc-modal-header h2 {
    margin: 0 0 0.35rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}
.mxh-cc-modal-header p {
    margin: 0;
    color: #475569;
    font-size: 0.88rem;
    line-height: 1.5;
}

.mxh-cc-modal-list {
    margin: 1.1rem 0 1.1rem;
    border-top: 1px solid #e2e8f0;
}
.mxh-cc-modal-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid #e2e8f0;
}
.mxh-cc-row-info { flex: 1 1 auto; }
.mxh-cc-row-title {
    margin: 0 0 0.18rem;
    font-weight: 600;
    color: #0f172a;
    font-size: 0.92rem;
}
.mxh-cc-row-desc {
    margin: 0;
    color: #475569;
    font-size: 0.82rem;
    line-height: 1.45;
}

/* Toggle switch */
.mxh-cc-switch {
    flex-shrink: 0;
    position: relative;
    width: 44px;
    height: 24px;
}
.mxh-cc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.mxh-cc-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    cursor: pointer;
    transition: background 180ms ease;
}
.mxh-cc-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
    transition: transform 180ms cubic-bezier(.2,.7,.2,1);
}
.mxh-cc-switch input:checked + .mxh-cc-slider {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}
.mxh-cc-switch input:checked + .mxh-cc-slider::before {
    transform: translateX(20px);
}
.mxh-cc-switch input:disabled + .mxh-cc-slider {
    background: #818cf8;
    opacity: 0.7;
    cursor: not-allowed;
}
.mxh-cc-switch input:focus-visible + .mxh-cc-slider {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

.mxh-cc-modal-foot {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.mxh-cc-modal-foot .mxh-cc-btn { min-width: 160px; justify-content: center; }

@media (max-width: 520px) {
    .mxh-cc-modal { padding: 1.1rem 1rem 1rem; border-radius: 14px; }
    .mxh-cc-modal-foot { flex-direction: column; }
    .mxh-cc-modal-foot .mxh-cc-btn { width: 100%; min-width: 0; }
}

body.mxh-cc-modal-open { overflow: hidden; }
