/* ==========================================================================
   Kaissen cookie consent — banner + preference centre
   Loaded on every page, so every rule is scoped under #kcc- roots and resets
   the site's global element rules (span, p, a, h2, input) inside them.
   ========================================================================== */

#kcc-banner,
#kcc-modal {
    --kcc-teal: #146973;
    --kcc-teal-dark: #0e4a51;
    --kcc-teal-tint: #e8f2f3;
    --kcc-accent: #c24e00;
    --kcc-ink: #1f2933;
    --kcc-body: #3d4a52;
    --kcc-muted: #5a6b73;
    --kcc-border: #dde5e8;
    --kcc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    font-family: var(--kcc-font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--kcc-body);
    box-sizing: border-box;
}

#kcc-banner *,
#kcc-modal * {
    box-sizing: border-box;
}

#kcc-banner span,
#kcc-modal span {
    font-size: inherit;
    color: inherit;
}

#kcc-banner p,
#kcc-modal p {
    margin: 0 0 12px;
    padding: 0;
}

#kcc-banner h2,
#kcc-modal h2,
#kcc-modal h3 {
    font-family: var(--kcc-font);
    color: var(--kcc-ink);
    margin: 0 0 8px;
}

/* --- Buttons ------------------------------------------------------------ */
.kcc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 20px;
    border-radius: 6px;
    border: 1px solid var(--kcc-border);
    background: #fff;
    color: var(--kcc-ink);
    font-family: var(--kcc-font);
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s, border-color .2s, color .2s;
}

.kcc-btn:hover {
    background: var(--kcc-teal-tint);
    border-color: #bcd4d7;
    color: var(--kcc-teal-dark);
}

.kcc-btn--primary {
    background: var(--kcc-accent);
    border-color: var(--kcc-accent);
    color: #fff;
}

.kcc-btn--primary:hover {
    background: #a94200;
    border-color: #a94200;
    color: #fff;
}

.kcc-btn--ghost {
    background: transparent;
    border-color: transparent;
    color: var(--kcc-teal-dark);
    text-decoration: underline;
    padding-left: 8px;
    padding-right: 8px;
}

.kcc-btn--ghost:hover {
    background: var(--kcc-teal-tint);
    border-color: transparent;
}

.kcc-btn:focus-visible,
#kcc-banner a:focus-visible,
#kcc-modal a:focus-visible,
#kcc-modal input:focus-visible {
    outline: 3px solid var(--kcc-teal);
    outline-offset: 2px;
}

/* --- Banner ------------------------------------------------------------- */
#kcc-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    background: #fff;
    border-top: 3px solid var(--kcc-accent);
    box-shadow: 0 -6px 30px rgba(31, 41, 51, .14);
    padding: 22px 24px;
}

.kcc-banner__inner {
    max-width: 1160px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px 28px;
}

.kcc-banner__text {
    flex: 1 1 420px;
    min-width: 0;
}

#kcc-banner h2 {
    font-size: 17px;
    font-weight: 700;
}

#kcc-banner p {
    font-size: 14.5px;
    color: var(--kcc-muted);
    margin: 0;
}

#kcc-banner a {
    color: var(--kcc-teal);
    font-weight: 600;
    text-decoration: underline;
}

.kcc-banner__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex: 0 1 auto;
}

@media (prefers-reduced-motion: no-preference) {
    #kcc-banner {
        animation: kcc-slide-up .35s ease both;
    }
}

@keyframes kcc-slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

/* --- Preference modal ---------------------------------------------------- */
#kcc-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(20, 32, 38, .55);
}

.kcc-modal__panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(15, 25, 30, .3);
    width: 100%;
    max-width: 620px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
    .kcc-modal__panel {
        animation: kcc-pop .25s ease both;
    }
}

@keyframes kcc-pop {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.kcc-modal__head {
    padding: 24px 28px 16px;
    border-bottom: 1px solid var(--kcc-border);
}

#kcc-modal h2 {
    font-size: 21px;
    font-weight: 700;
    margin: 0 0 6px;
}

.kcc-modal__head p {
    font-size: 14.5px;
    color: var(--kcc-muted);
    margin: 0;
}

.kcc-modal__body {
    padding: 8px 28px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.kcc-modal__foot {
    padding: 18px 28px 24px;
    border-top: 1px solid var(--kcc-border);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

/* --- Category rows -------------------------------------------------------- */
.kcc-cat {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid #eef2f4;
}

.kcc-cat:last-child {
    border-bottom: 0;
}

.kcc-cat__text {
    flex: 1 1 auto;
    min-width: 0;
}

#kcc-modal h3 {
    font-size: 15.5px;
    font-weight: 700;
    margin: 0 0 4px;
}

.kcc-cat p {
    font-size: 14px;
    color: var(--kcc-muted);
    margin: 0;
}

.kcc-cat__locked {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--kcc-teal-dark);
    background: var(--kcc-teal-tint);
    border-radius: 100px;
    padding: 3px 10px;
    margin-top: 8px;
}

/* Switch: a real checkbox, visually restyled, so it keeps native
   keyboard behaviour and screen-reader semantics. */
.kcc-switch {
    position: relative;
    flex: none;
    width: 50px;
    height: 28px;
    margin-top: 2px;
}

.kcc-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.kcc-switch__track {
    position: absolute;
    inset: 0;
    background: #c6d0d4;
    border-radius: 100px;
    transition: background .2s;
    pointer-events: none;
}

.kcc-switch__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .2s;
}

.kcc-switch input:checked + .kcc-switch__track {
    background: var(--kcc-teal);
}

.kcc-switch input:checked + .kcc-switch__track::after {
    transform: translateX(22px);
}

.kcc-switch input:disabled {
    cursor: not-allowed;
}

.kcc-switch input:disabled + .kcc-switch__track {
    background: #9fb9bd;
}

.kcc-switch input:focus-visible + .kcc-switch__track {
    outline: 3px solid var(--kcc-teal);
    outline-offset: 3px;
}

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 640px) {
    #kcc-banner {
        padding: 18px 16px;
        max-height: 80vh;
        overflow-y: auto;
    }

    .kcc-banner__actions {
        width: 100%;
    }

    .kcc-banner__actions .kcc-btn {
        flex: 1 1 auto;
    }

    .kcc-modal__head,
    .kcc-modal__body,
    .kcc-modal__foot {
        padding-left: 18px;
        padding-right: 18px;
    }

    .kcc-modal__foot .kcc-btn {
        flex: 1 1 auto;
    }
}

@media print {
    #kcc-banner,
    #kcc-modal {
        display: none !important;
    }
}
