/**
 * Morocco Passage — consent choices panel.
 *
 * Loaded only where the panel can render (production with a tag container,
 * or an administrator's local QA view). Consumes the theme's design tokens
 * with neutral fallbacks so it never depends on the theme for legibility.
 *
 * The panel is a non-modal region at the foot of the viewport: the page
 * stays fully usable, nothing is blocked behind it, and Accept all, Reject
 * all and Settings have identical visual weight. Being fixed, it never
 * shifts the page layout.
 */

.mp-consent {
    position: fixed;
    inset-inline: var(--gutter, 1.5rem);
    inset-block-end: calc(var(--gutter, 1.5rem) + env(safe-area-inset-bottom, 0px));
    z-index: 150;
    max-width: 34rem;
    margin-inline-start: auto;
    padding: var(--s-6, 1.5rem);
    background-color: var(--c-surface, #fff);
    color: var(--c-ink, #1a1714);
    border: 1px solid var(--c-rule-strong, #c9bfad);
    border-radius: var(--radius-control, 3px);
    box-shadow: 0 24px 48px -32px rgb(26 23 20 / 45%);
    font-family: var(--font-ui, system-ui, sans-serif);
}

.mp-consent[hidden] {
    display: none;
}

.mp-consent:focus-visible {
    outline: 2px solid var(--c-focus, #8f5510);
    outline-offset: 3px;
}

.mp-consent__title {
    margin: 0 0 var(--s-2, 0.5rem);
    font-family: var(--font-display, Georgia, serif);
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.2;
}

.mp-consent__text {
    margin: 0;
    font-size: var(--fs-meta, 0.875rem);
    line-height: 1.6;
    color: var(--c-muted, #6e665d);
}

.mp-consent__text a {
    color: var(--c-ink, #1a1714);
}

.mp-consent__actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s-3, 0.75rem);
    margin-block-start: var(--s-4, 1rem);
}

.mp-consent__actions .mp-btn {
    width: 100%;
    justify-content: center;
}

/* Settings layer: the categories, then "Save choices". */
.mp-consent__settings {
    display: grid;
    gap: var(--s-3, 0.75rem);
    margin-block-start: var(--s-4, 1rem);
    padding-block-start: var(--s-4, 1rem);
    border-block-start: 1px solid var(--c-rule, #e2dbcd);
}

.mp-consent__settings[hidden] {
    display: none;
}

.mp-consent__option {
    margin: 0;
    font-size: var(--fs-meta, 0.875rem);
    line-height: 1.5;
}

.mp-consent__option label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--s-3, 0.75rem);
    align-items: start;
    cursor: pointer;
}

.mp-consent__option input {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0.125rem 0 0;
    accent-color: var(--c-deep, #1c3a52);
}

.mp-consent__option strong {
    display: block;
    color: var(--c-ink, #1a1714);
}

.mp-consent__option span {
    color: var(--c-muted, #6e665d);
}

.mp-consent__save {
    justify-self: start;
    min-height: 2.75rem;
}

/* Footer "Cookie settings" control: reads as a footer link. */
.mp-footer__privacy {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--c-on-deep-muted, #cbd6de);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 0.35em;
}

.mp-footer__privacy:hover {
    color: var(--c-on-deep, #f4f0e7);
    text-decoration-color: var(--c-signal, #c2761b);
}

@media (max-width: 359.98px) {

    .mp-consent__actions {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 479.98px) {

    .mp-consent {
        inset-inline: var(--s-3, 0.75rem);
        inset-block-end: calc(var(--s-3, 0.75rem) + env(safe-area-inset-bottom, 0px));
        padding: var(--s-4, 1rem);
    }

    /* Three short labels on one line each at phone widths (390px: ~100px per button). */
    .mp-consent__actions {
        gap: var(--s-2, 0.5rem);
    }

    .mp-consent__actions .mp-btn {
        padding-inline: var(--s-2, 0.5rem);
    }
}

/* Keep all choices reachable on small screens and at enlarged text sizes. */
.mp-consent {
    max-height: calc(100vh - 3rem);
    max-height: calc(100dvh - 3rem);
    overflow-y: auto;
}

.mp-consent__actions .mp-btn {
    min-height: 2.75rem;
    white-space: normal;
    text-align: center;
    line-height: 1.4;
}
