/* Cookie consent banner and settings dialog */

html[data-consent-pending] .cookie-banner:not(.is-visible) {
    display: none !important;
}

.cookie-banner {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 9000;
    padding: 1rem;
    pointer-events: none;
}

.cookie-banner.is-visible {
    pointer-events: auto;
}

.cookie-banner__inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    background: #fff;
    color: #111;
    border-radius: 0.75rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cookie-banner__title {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.cookie-banner__text {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: #333;
}

.cookie-banner__actions {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.cookie-banner__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.625rem 1.125rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    text-align: center;
}

.cookie-banner__btn:focus-visible,
.consent-dialog__close:focus-visible,
.consent-dialog__save:focus-visible,
.consent-toggle__input:focus-visible + .consent-toggle__track,
.cookies-content__settings-btn:focus-visible,
.site-footer__link:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

.cookie-banner__btn--primary {
    background: #111;
    color: #fff;
    border-color: #111;
}

.cookie-banner__btn--secondary {
    background: #fff;
    color: #111;
    border-color: #ccc;
}

.consent-dialog {
    width: min(100% - 2rem, 36rem);
    max-height: calc(100vh - 2rem);
    padding: 0;
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.consent-dialog::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.consent-dialog__form {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 2rem);
}

.consent-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.25rem 0.75rem;
    border-bottom: 1px solid #eee;
}

.consent-dialog__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.consent-dialog__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: #111;
    cursor: pointer;
}

.consent-dialog__body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
}

.consent-dialog__intro {
    margin: 0 0 1rem;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: #444;
}

.consent-categories {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.consent-category {
    padding: 0.875rem 1rem;
    border: 1px solid #e5e5e5;
    border-radius: 0.625rem;
    background: #fafafa;
}

.consent-category__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.375rem;
}

.consent-category__name {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.consent-category__status {
    font-size: 0.8125rem;
    color: #666;
    white-space: nowrap;
}

.consent-category__desc {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #555;
}

.consent-category__input[disabled] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.consent-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.consent-toggle__input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}

.consent-toggle__track {
    display: block;
    width: 2.75rem;
    height: 1.5rem;
    border-radius: 999px;
    background: #ccc;
    position: relative;
    transition: background 0.15s ease;
}

.consent-toggle__track::after {
    content: '';
    position: absolute;
    top: 0.125rem;
    left: 0.125rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.15s ease;
}

.consent-toggle__input:checked + .consent-toggle__track {
    background: #111;
}

.consent-toggle__input:checked + .consent-toggle__track::after {
    transform: translateX(1.25rem);
}

.consent-dialog__footer {
    padding: 0.75rem 1.25rem 1.25rem;
    border-top: 1px solid #eee;
}

.consent-dialog__save {
    width: 100%;
    min-height: 2.75rem;
    border: none;
    border-radius: 0.5rem;
    background: #111;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
}

.consent-saved-message {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9100;
    padding: 0.75rem 1rem;
    background: #111;
    color: #fff;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.site-footer__legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-top: 0.75rem;
}

.site-footer__link {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.site-footer__link--button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

.site-footer__link:hover,
.site-footer__link--button:hover {
    color: #fff;
}

.page-cookies {
    background: var(--page-bg, #f5f5f5);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.cookies-page {
    flex: 1;
    padding: 2rem 1rem 3rem;
}

.cookies-content {
    max-width: 42rem;
    margin: 0 auto;
}

.cookies-content__title {
    margin: 0 0 1.5rem;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
}

.cookies-content__meta {
    margin: -0.75rem 0 1.5rem;
    font-size: 0.95rem;
    color: #555;
}

.cookies-section {
    margin-bottom: 1.75rem;
}

.cookies-section__title {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.cookies-section p,
.cookies-list {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
}

.cookies-section p + p,
.cookies-section p + ul,
.cookies-section ul + p {
    margin-top: 0.75rem;
}

.cookies-list {
    padding-left: 1.25rem;
}

.cookies-list li + li {
    margin-top: 0.5rem;
}

.cookies-section a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.12em;
}

.cookies-section code {
    font-size: 0.9em;
    background: #eee;
    padding: 0.1em 0.35em;
    border-radius: 0.25rem;
}

.cookies-content__settings-btn {
    margin-top: 0.75rem;
    min-height: 2.75rem;
    padding: 0.625rem 1.125rem;
    border: 1px solid #111;
    border-radius: 0.5rem;
    background: #111;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
}

@media (min-width: 640px) {
    .cookie-banner__inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1.5rem;
    }

    .cookie-banner__content {
        flex: 1;
    }

    .cookie-banner__actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
        width: auto;
        min-width: min(100%, 22rem);
    }

    .cookie-banner__btn {
        width: auto;
        flex: 1 1 auto;
        min-width: 7.5rem;
    }
}

@media (min-width: 768px) {
    .cookie-banner {
        padding: 1.25rem 1.5rem;
    }
}
