/* Cookie Consent Banner — sublument2022 theme */
/* Centered bottom, no animation, dark theme matching site CSS variables     */

#cookie-banner {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: min(660px, calc(100vw - 2rem));
    background: var(--dark2);
    border: 1px solid var(--dark2);
    border-radius: var(--br-2);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7);
    color: var(--grey5);
    font-family: var(--ff-sans1);
    font-size: var(--fs-small1);
    animation: none;
    transition: none;
}

#cookie-banner[hidden] {
    display: none;
}

.cookie-banner__inner {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.cookie-banner__title {
    font-size: var(--fs-h3);
    color: var(--white1);
    font-weight: var(--fw-bold);
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.cookie-banner__desc {
    font-size: var(--fs-small1);
    color: var(--grey4);
    line-height: 1.6;
    margin: 0;
}

.cookie-banner__desc a {
    color: var(--primary-4);
    text-decoration: underline;
}

.cookie-banner__desc a:hover {
    color: var(--primary-3);
}

/* Categories */

.cookie-banner__categories {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    border-top: 1px solid var(--dark3);
    padding-top: 1rem;
}

.cookie-category {
    padding: 0.75rem;
    background: var(--dark2);
    border-radius: var(--br-1);
}

.cookie-category__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    gap: 0.5rem;
}

.cookie-category__name {
    font-weight: var(--fw-bold);
    color: var(--white1);
    font-size: var(--fs-small1);
    cursor: default;
    line-height: 1.4;
}

label.cookie-category__name {
    cursor: pointer;
}

.cookie-category__always-on {
    font-size: var(--fs-small2);
    color: var(--green1);
    font-weight: var(--fw-bold);
    white-space: nowrap;
    flex-shrink: 0;
}

.cookie-category__desc {
    font-size: var(--fs-small2);
    color: var(--grey3);
    line-height: 1.5;
    margin: 0;
}

/* Toggle switch */

.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 2.6rem;
    height: 1.5rem;
    cursor: pointer;
    flex-shrink: 0;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.cookie-toggle__track {
    position: absolute;
    inset: 0;
    background: var(--dark3);
    border-radius: 999px;
}

.cookie-toggle__track::after {
    content: '';
    position: absolute;
    top: 0.175rem;
    left: 0.175rem;
    width: 1.15rem;
    height: 1.15rem;
    background: var(--grey4);
    border-radius: 50%;
    transition: transform 0.15s, background 0.15s;
}

.cookie-toggle input:checked + .cookie-toggle__track {
    background: var(--primary-6);
}

.cookie-toggle input:checked + .cookie-toggle__track::after {
    transform: translateX(1.1rem);
    background: var(--white1);
}

.cookie-toggle input:focus-visible + .cookie-toggle__track {
    outline: 2px solid var(--primary-4);
    outline-offset: 2px;
}

/* Actions */

.cookie-banner__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
    border-top: 1px solid var(--dark3);
    padding-top: 1rem;
}

.cookie-btn {
    padding: 0.5rem 1.125rem;
    border-radius: 0.375rem;
    font-size: var(--fs-small1);
    font-family: var(--ff-sans1);
    font-weight: var(--fw-bold);
    cursor: pointer;
    border: 1px solid transparent;
    line-height: 1.5;
    white-space: nowrap;
}

.cookie-btn--primary {
    background: var(--primary-6);
    color: var(--white1);
    border-color: var(--primary-6);
}

.cookie-btn--primary:hover {
    background: var(--primary-5);
    border-color: var(--primary-5);
}

.cookie-btn--outline {
    background: transparent;
    color: var(--grey4);
    border-color: var(--dark3);
}

.cookie-btn--outline:hover {
    border-color: var(--grey3);
    color: var(--white1);
}

.cookie-btn--ghost {
    background: transparent;
    color: var(--grey3);
    border-color: transparent;
}

.cookie-btn--ghost:hover {
    color: var(--white1);
}

/* Mobile: full-width bar at bottom */

@media (width < 480px) {
    #cookie-banner {
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
        width: 100%;
        border-radius: var(--br-2) var(--br-2) 0 0;
        border-bottom: none;
    }

    .cookie-banner__actions {
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
        text-align: center;
    }
}
