/* SLU Toolkit — Cookie Consent */

/* ── Shared button styles ─────────────────────────────────────────────── */
#slu-cookie-banner button {
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background-color .2s, opacity .2s;
    white-space: nowrap;
    font-family: inherit;
}
#slu-cookie-banner button:hover { opacity: .88; }

#slu-cookie-policy,
#slu-cookie-extra {
    background: transparent !important;
    text-decoration: underline;
    padding: 8px 6px !important;
    font-size: 12px !important;
    opacity: .75;
}

/* ── Bottom Sheet layout (default) ───────────────────────────────────── */
#slu-cookie-banner.slu-layout-sheet,
#slu-cookie-banner.slu-layout-slim {
    bottom: 0px;
    top: auto;
}
#slu-cookie-banner.slu-layout-sheet {
    position: fixed;
    left: 0;
    right: 0;
    padding: 24px 32px 28px;
    border-radius: 0px;
    box-shadow: 0 -4px 32px rgba(0,0,0,.15);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-family: inherit;
}
#slu-cookie-banner.slu-layout-sheet p {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.6;
    max-width: 600px;
}
#slu-cookie-banner.slu-layout-sheet .slu-cookie-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}
#slu-cookie-banner.slu-layout-sheet .slu-cookie-buttons button {
    padding: 9px 22px;
}

/* ── Floating Card layout ─────────────────────────────────────────────── */
#slu-cookie-banner.slu-layout-floating {
    position: fixed;
    right: 20px;
    width: 280px;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
    z-index: 99999;
    font-family: inherit;
}
#slu-cookie-banner.slu-layout-floating p {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.5;
}
#slu-cookie-banner.slu-layout-floating .slu-cookie-buttons {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
#slu-cookie-banner.slu-layout-floating .slu-cookie-buttons button {
    padding: 9px 14px;
    width: 100%;
    text-align: center;
}

/* ── Modal layout ─────────────────────────────────────────────────────── */
#slu-cookie-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99998;
}
#slu-cookie-banner.slu-layout-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 380px;
    max-width: calc(100vw - 40px);
    padding: 28px 24px;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0,0,0,.25);
    z-index: 99999;
    text-align: center;
    font-family: inherit;
}
.slu-cookie-modal-icon {
    font-size: 36px;
    margin-bottom: 10px;
}
#slu-cookie-banner.slu-layout-modal p {
    margin: 0 0 18px;
    font-size: 13.5px;
    line-height: 1.6;
}
#slu-cookie-banner.slu-layout-modal .slu-cookie-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}
#slu-cookie-banner.slu-layout-modal .slu-cookie-buttons button {
    padding: 10px 20px;
    width: 100%;
}

/* ── Slim Bar layout ──────────────────────────────────────────────────── */
#slu-cookie-banner.slu-layout-slim {
    position: fixed;
    left: 0;
    right: 0;
    padding: 8px 20px;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-family: inherit;
}
#slu-cookie-banner.slu-layout-slim p {
    margin: 0;
    font-size: 12.5px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#slu-cookie-banner.slu-layout-slim .slu-cookie-buttons {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: center;
}
#slu-cookie-banner.slu-layout-slim .slu-cookie-buttons button {
    padding: 5px 12px;
    font-size: 12px;
}

/* ── Manage Consent button ────────────────────────────────────────────── */
#slu-cookie-manage {
    position: fixed;
    bottom: 10px;
    right: 10px;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    z-index: 99998;
    font-size: 13px;
    font-weight: 500;
    transition: background-color .2s;
    font-family: inherit;
}

/* ── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    #slu-cookie-banner.slu-layout-sheet { padding: 20px 16px 24px; }
    #slu-cookie-banner.slu-layout-sheet .slu-cookie-buttons { flex-direction: column; width: 100%; }
    #slu-cookie-banner.slu-layout-sheet .slu-cookie-buttons button { width: 100%; }
    #slu-cookie-banner.slu-layout-floating { width: calc(100vw - 20px); right: 10px; }
    #slu-cookie-banner.slu-layout-slim p { display: none; }
}

/* ── Elegant layout (v1.26.0) ─────────────────────────────────────────────
   Dark card in a corner, thin accent border, serif title, square outline /
   filled buttons in small spaced capitals, and a Manage view with per-category
   switches (Essential locked on, Analytics, Marketing). Colours come from the
   module's colour settings through --ck-* variables set inline by PHP:
   banner bg / text, button bg = accent (border, link, filled button, switch),
   button text, button hover. Every rule is anchored on
   #slu-cookie-banner.slu-layout-elegant so Kit / Hello button styles can't win. */
#slu-cookie-banner.slu-layout-elegant {
    --ck-accent-line: color-mix(in srgb, var(--ck-accent) 40%, transparent);
    --ck-hair: color-mix(in srgb, var(--ck-accent) 22%, transparent);
    position: fixed;
    left: 24px; right: auto;
    bottom: 24px; top: auto;
    z-index: 99999;
    box-sizing: border-box;
    width: min(440px, calc(100% - 32px));
    padding: 28px 28px 24px;
    background: var(--ck-bg);
    color: var(--ck-text);
    /* Card border settings (v1.27.0): --ck-border-w / --ck-radius / --ck-border-c
       are set inline by Cookie_Consent; the fallbacks are the original look. */
    border: var(--ck-border-w, 1px) solid var(--ck-border-c, var(--ck-accent-line));
    border-radius: var(--ck-radius, 0);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
    text-align: left;
    font-family: inherit;
    font-weight: 300;
    animation: slu-ck-rise .5s cubic-bezier(.16, 1, .3, 1);
}
#slu-cookie-banner.slu-layout-elegant.slu-ck-right { left: auto; right: 24px; }
#slu-cookie-banner.slu-layout-elegant.slu-ck-top { bottom: auto; top: 24px; }
@keyframes slu-ck-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
#slu-cookie-banner.slu-layout-elegant .slu-ck-title {
    display: block;
    margin: 0 0 10px;
    padding: 0;
    font-family: var(--ck-title-font, inherit);
    font-size: 22px;
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -.005em;
    text-transform: none;
    color: var(--ck-text);
}
#slu-cookie-banner.slu-layout-elegant p {
    margin: 0 0 18px;
    line-height: 1.65;
    color: color-mix(in srgb, var(--ck-text) 82%, transparent);
    font-weight: 300;
}
#slu-cookie-banner.slu-layout-elegant p a {
    color: var(--ck-accent);
    text-decoration: none;
    border-bottom: 1px solid currentColor;
}
#slu-cookie-banner.slu-layout-elegant .slu-cookie-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
#slu-cookie-banner.slu-layout-elegant .slu-cookie-buttons button {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 13px 16px;
    min-height: 0;
    font-family: inherit;
    font-weight: 500;
    line-height: 1;
    letter-spacing: .22em;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: none;
    cursor: pointer;
}
/* Colours, font size, border and corner radius come from the module's button
   settings (the inline rule in Cookie_Consent::enqueue_assets()), the same as
   every other layout. */
#slu-cookie-banner.slu-layout-elegant .slu-cookie-buttons button[hidden] { display: none; }
#slu-cookie-banner.slu-layout-elegant .slu-cookie-buttons button:focus-visible { outline: 2px solid var(--ck-accent); outline-offset: 2px; }

/* Manage view: per-category switches. */
#slu-cookie-banner.slu-layout-elegant .slu-ck-prefs { margin: 4px 0 18px; border-top: 1px solid var(--ck-hair); }
#slu-cookie-banner.slu-layout-elegant .slu-ck-prefs[hidden] { display: none; }
#slu-cookie-banner.slu-layout-elegant .slu-ck-pref {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 16px;
    align-items: center;
    margin: 0;
    padding: 14px 0;
    border-bottom: 1px solid var(--ck-hair);
    cursor: pointer;
}
#slu-cookie-banner.slu-layout-elegant .slu-ck-pref strong { font-size: 14px; font-weight: 500; color: var(--ck-text); }
#slu-cookie-banner.slu-layout-elegant .slu-ck-pref span { grid-column: 1; font-size: 13px; line-height: 1.5; color: color-mix(in srgb, var(--ck-text) 70%, transparent); }
#slu-cookie-banner.slu-layout-elegant .slu-ck-switch {
    grid-area: 1 / 2 / span 2;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    width: 40px; height: 22px;
    margin: 0;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--ck-accent) 60%, transparent);
    border-radius: 22px;
    background: transparent;
    cursor: pointer;
    transition: background .3s ease, border-color .3s ease;
}
#slu-cookie-banner.slu-layout-elegant .slu-ck-switch::after {
    content: "";
    position: absolute;
    top: 3px; left: 3px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--ck-text) 70%, transparent);
    transition: transform .3s cubic-bezier(.22, .61, .36, 1), background .3s ease;
}
#slu-cookie-banner.slu-layout-elegant .slu-ck-switch:checked { background: var(--ck-accent); border-color: var(--ck-accent); }
#slu-cookie-banner.slu-layout-elegant .slu-ck-switch:checked::after { transform: translateX(18px); background: var(--ck-bg); }
#slu-cookie-banner.slu-layout-elegant .slu-ck-switch:disabled { opacity: .7; cursor: default; }
#slu-cookie-banner.slu-layout-elegant .slu-ck-switch:focus-visible { outline: 2px solid var(--ck-accent); outline-offset: 2px; }

/* Title, links in the text and the Manage view only exist in Elegant. */
#slu-cookie-banner:not(.slu-layout-elegant) .slu-ck-title,
#slu-cookie-banner:not(.slu-layout-elegant) .slu-ck-prefs,
#slu-cookie-banner:not(.slu-layout-elegant) .slu-ck-inline-links,
#slu-cookie-banner:not(.slu-layout-elegant) .slu-ck-elegant-only { display: none !important; }
#slu-cookie-banner.slu-layout-elegant #slu-cookie-policy,
#slu-cookie-banner.slu-layout-elegant #slu-cookie-extra { display: none !important; }

@media (max-width: 820px) {
    #slu-cookie-banner.slu-layout-elegant,
    #slu-cookie-banner.slu-layout-elegant.slu-ck-right { left: 16px; right: 16px; width: auto; bottom: 16px; }
    #slu-cookie-banner.slu-layout-elegant.slu-ck-top { top: 16px; bottom: auto; }
    #slu-cookie-banner.slu-layout-elegant { padding: 24px 20px 20px; max-height: calc(100vh - 32px); overflow-y: auto; }
}
@media (prefers-reduced-motion: reduce) {
    #slu-cookie-banner.slu-layout-elegant { animation: none; }
}
