/* Relish Chefs – cookie consent banner and preferences dialog (works on public pages and dashboards). */

.cookie-banner,
.cookie-dialog {
    --cc-bg: #171718;
    --cc-panel: #1f1f21;
    --cc-text: #f2f2f2;
    --cc-muted: rgba(255, 255, 255, 0.72);
    --cc-line: rgba(255, 255, 255, 0.14);
    --cc-red: #e53935;
    --cc-red-dark: #c62828;
    font-family: var(--font-family-primary, "Mulish", system-ui, -apple-system, "Segoe UI", sans-serif);
    color: var(--cc-text);
    line-height: 1.5;
    box-sizing: border-box;
}

.cookie-banner *,
.cookie-dialog * {
    box-sizing: border-box;
}

.cookie-banner[hidden],
.cookie-dialog[hidden] {
    display: none !important;
}

/* ---- Banner -------------------------------------------------------------------------- */

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 2147483000;
    max-width: 1120px;
    margin: 0 auto;
    background: var(--cc-bg);
    border: 1px solid var(--cc-line);
    border-top: 3px solid var(--cc-red);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.cookie-banner__inner {
    display: flex;
    align-items: center;
    gap: 20px 32px;
    padding: 20px 24px;
}

.cookie-banner__text {
    flex: 1 1 auto;
    min-width: 0;
}

.cookie-banner__title,
.cookie-dialog__title {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 6px;
}

.cookie-banner__body {
    color: var(--cc-muted);
    font-size: 14px;
    margin: 0;
}

.cookie-banner a,
.cookie-dialog a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
}

.cookie-banner a:hover,
.cookie-dialog a:hover {
    color: var(--cc-red);
}

.cookie-banner__actions,
.cookie-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cookie-banner__actions {
    flex: 0 0 auto;
    flex-direction: column;
    width: 220px;
}

/* Accept and Reject look exactly the same: neither choice is pushed. */
.cookie-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border: 2px solid var(--cc-red);
    border-radius: 999px;
    background: var(--cc-red);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cookie-btn:hover {
    background: var(--cc-red-dark);
    border-color: var(--cc-red-dark);
}

.cookie-btn--outline {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.7);
}

.cookie-btn--outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

.cookie-btn:focus-visible,
.cookie-dialog__close:focus-visible,
.cookie-switch:focus-visible,
.cookie-banner a:focus-visible,
.cookie-dialog a:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* Leave room so the banner never covers the footer links on short pages. */
body.has-cookie-banner {
    padding-bottom: 200px;
}

/* ---- Preferences dialog -------------------------------------------------------------- */

.cookie-dialog {
    position: fixed;
    inset: 0;
    z-index: 2147483001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.65);
}

body.cookie-dialog-open {
    overflow: hidden;
}

.cookie-dialog__panel {
    width: 100%;
    max-width: 640px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: var(--cc-panel);
    border: 1px solid var(--cc-line);
    border-top: 3px solid var(--cc-red);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

.cookie-dialog__panel:focus {
    outline: none;
}

.cookie-dialog__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.cookie-dialog__title {
    font-size: 20px;
}

.cookie-dialog__close {
    appearance: none;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
}

.cookie-dialog__intro,
.cookie-dialog__note {
    color: var(--cc-muted);
    font-size: 14px;
    margin: 8px 0 16px;
}

.cookie-dialog__note {
    margin: 4px 0 20px;
}

.cookie-dialog__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cookie-dialog__item {
    border: 1px solid var(--cc-line);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.cookie-dialog__item-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cookie-dialog__item-label {
    flex: 1 1 auto;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    cursor: pointer;
}

.cookie-dialog__always {
    color: var(--cc-muted);
    font-size: 13px;
    font-weight: 600;
}

.cookie-dialog__item-desc {
    color: var(--cc-muted);
    font-size: 14px;
    margin: 6px 0 0;
}

/* On/off switch */
.cookie-switch {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 26px;
    margin: 0;
    border-radius: 999px;
    background: #555;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.cookie-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.15s ease;
}

.cookie-switch:checked {
    background: var(--cc-red);
}

.cookie-switch:checked::after {
    transform: translateX(20px);
}

.cookie-switch:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.cookie-dialog__actions .cookie-btn {
    flex: 1 1 160px;
}

/* ---- Small screens --------------------------------------------------------------------- */

@media (max-width: 767.98px) {
    .cookie-banner {
        left: 8px;
        right: 8px;
        bottom: 8px;
    }

    .cookie-banner__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px 16px;
    }

    .cookie-banner__title {
        font-size: 16px;
        margin-bottom: 4px;
    }

    .cookie-banner__body {
        font-size: 13px;
        line-height: 1.45;
    }

    /* Accept and Reject side by side (same size), Manage Preferences underneath */
    .cookie-banner__actions {
        flex-direction: row;
        width: 100%;
        gap: 8px;
    }

    .cookie-banner__actions .cookie-btn {
        flex: 1 1 calc(50% - 4px);
        min-height: 42px;
        padding: 8px 12px;
        font-size: 14px;
    }

    .cookie-banner__actions .cookie-btn--outline {
        flex-basis: 100%;
    }

    body.has-cookie-banner {
        padding-bottom: 290px;
    }

    .cookie-dialog__panel {
        padding: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cookie-btn,
    .cookie-switch,
    .cookie-switch::after {
        transition: none;
    }
}
