/* Cookie consent */

.cookie-consent[hidden],
.cookie-modal[hidden] {
    display: none !important;
}

.cookie-consent {
    position: fixed;
    right: 24px;
    bottom: 24px;
    left: 24px;
    z-index: 1000;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.cookie-consent__content {
    width: min(1040px, 100%);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(17, 24, 39, 0.18);
    pointer-events: auto;
}

.cookie-consent__mark {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: var(--primary, #c8102e);
    font-size: 1.05rem;
}

.cookie-consent__text {
    min-width: 0;
}

.cookie-consent__text span,
.cookie-modal__header span {
    display: block;
    margin-bottom: 3px;
    color: #6b7280;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: uppercase;
}

.cookie-consent__text strong {
    display: block;
    margin-bottom: 4px;
    color: #111827;
    font-size: 1rem;
    line-height: 1.25;
}

.cookie-consent__text p {
    max-width: 650px;
    margin: 0;
    color: #4b5563;
    font-size: 0.9rem;
    line-height: 1.5;
}

.cookie-consent__actions,
.cookie-modal__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.cookie-consent__btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.cookie-consent__btn:focus-visible,
.cookie-modal__close:focus-visible,
.footer-cookie-preferences:focus-visible {
    outline: 3px solid rgba(200, 16, 46, 0.22);
    outline-offset: 2px;
}

.cookie-consent__btn--primary {
    background: var(--primary, #c8102e);
    border-color: var(--primary, #c8102e);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(200, 16, 46, 0.22);
}

.cookie-consent__btn--primary:hover,
.cookie-consent__btn--primary:focus {
    background: var(--primary-dark, #a00d25);
    border-color: var(--primary-dark, #a00d25);
    color: #ffffff;
}

.cookie-consent__btn--secondary {
    background: #111827;
    border-color: #111827;
    color: #ffffff;
}

.cookie-consent__btn--secondary:hover,
.cookie-consent__btn--secondary:focus {
    background: #374151;
    border-color: #374151;
    color: #ffffff;
}

.cookie-consent__btn--ghost {
    background: #ffffff;
    border-color: #d1d5db;
    color: #374151;
}

.cookie-consent__btn--ghost:hover,
.cookie-consent__btn--ghost:focus {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
}

.cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 1010;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cookie-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.58);
}

.cookie-modal__dialog {
    position: relative;
    width: min(640px, 100%);
    max-height: min(760px, 90vh);
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: 8px;
    box-shadow: 0 26px 70px rgba(17, 24, 39, 0.3);
}

.cookie-modal__header,
.cookie-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
}

.cookie-modal__header {
    border-bottom: 1px solid #e5e7eb;
}

.cookie-modal__header h2 {
    margin: 0;
    color: #111827;
    font-size: 1.2rem;
    line-height: 1.25;
}

.cookie-modal__close {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #4b5563;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.cookie-modal__close:hover,
.cookie-modal__close:focus {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
}

.cookie-modal__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 22px;
}

.cookie-modal__intro {
    margin: 0 0 4px;
    color: #4b5563;
    font-size: 0.92rem;
    line-height: 1.55;
}

.cookie-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
}

.cookie-option strong {
    display: block;
    margin-bottom: 4px;
    color: #111827;
    font-size: 0.96rem;
}

.cookie-option p {
    margin: 0;
    color: #4b5563;
    font-size: 0.875rem;
    line-height: 1.45;
}

.cookie-option__status {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    color: #047857;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.cookie-option--toggle {
    cursor: pointer;
}

.cookie-option input[type="checkbox"] {
    width: 44px;
    height: 24px;
    margin: 0;
    flex-shrink: 0;
    appearance: none;
    background: #d1d5db;
    border-radius: 999px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.18s ease;
}

.cookie-option input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(17, 24, 39, 0.22);
    transition: transform 0.18s ease;
}

.cookie-option input[type="checkbox"]:checked {
    background: var(--primary, #c8102e);
}

.cookie-option input[type="checkbox"]:checked::after {
    transform: translateX(20px);
}

.cookie-option input[type="checkbox"]:focus-visible {
    outline: 3px solid rgba(200, 16, 46, 0.22);
    outline-offset: 2px;
}

.cookie-modal__footer {
    border-top: 1px solid #e5e7eb;
}

.cookie-modal__link,
.footer-cookie-preferences {
    color: var(--primary, #c8102e);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer-cookie-preferences {
    padding: 0;
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
}

@media (max-width: 900px) {
    .cookie-consent__content {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .cookie-consent__actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

@media (max-width: 640px) {
    .cookie-consent {
        right: 12px;
        bottom: 12px;
        left: 12px;
    }

    .cookie-consent__content {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 16px;
    }

    .cookie-consent__mark {
        display: none;
    }

    .cookie-consent__actions,
    .cookie-modal__actions {
        width: 100%;
        flex-direction: column;
    }

    .cookie-consent__btn {
        width: 100%;
    }

    .cookie-modal {
        align-items: flex-end;
        padding: 12px;
    }

    .cookie-modal__dialog {
        max-height: 92vh;
    }

    .cookie-modal__header,
    .cookie-modal__footer,
    .cookie-option {
        align-items: stretch;
        flex-direction: column;
    }

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

    .cookie-option {
        display: flex;
    }

    .cookie-option input[type="checkbox"],
    .cookie-option__status {
        align-self: flex-start;
    }
}
