﻿.cookie-banner,
.cookie-dialog {
    --cookie-primary: #2454a6;
    --cookie-text: #343a40;
    --cookie-border: #e0e5ed;
    --cookie-light: #f3f6fb;
    color: var(--cookie-text);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.6;
}

    .cookie-banner,
    .cookie-dialog,
    .cookie-banner *,
    .cookie-dialog * {
        box-sizing: border-box;
    }

        .cookie-banner[hidden],
        .cookie-dialog [hidden] {
            display: none !important;
        }

.cookie-banner {
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: 1040px;
    max-height: 70vh;
    margin: 0 auto;
    padding: 16px 20px;
    overflow-y: auto;
    border: 1px solid var(--cookie-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .12);
}

.cookie-banner-content {
    flex: 1;
    min-width: 0;
}

    .cookie-banner-content strong {
        display: block;
        margin-bottom: 4px;
        font-size: 14px;
    }

.cookie-banner p,
.cookie-dialog p {
    color: var(--cookie-text);
    font-size: 13px;
    line-height: 1.6;
}

.cookie-banner-content p {
    margin: 0;
}

.cookie-actions {
    display: flex;
    flex-shrink: 0;
    gap: 8px;
}

.cookie-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 14px;
    border: 1px solid var(--cookie-primary);
    border-radius: 6px;
    background: var(--cookie-primary);
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    cursor: pointer;
}

.cookie-button-outline {
    background: #fff;
    color: var(--cookie-primary);
}

.cookie-button:hover {
    filter: brightness(.94);
}

.cookie-button-outline:hover {
    background: var(--cookie-light);
}

.cookie-dialog {
    width: calc(100% - 32px);
    max-width: 640px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 48px rgba(0, 0, 0, .2);
}

    .cookie-dialog[open] {
        display: flex;
        flex-direction: column;
    }

    .cookie-dialog::backdrop {
        background: rgba(0, 0, 0, .4);
    }

.cookie-dialog-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--cookie-border);
}

    .cookie-dialog-header h2 {
        margin: 0;
        color: inherit;
        font-size: 16px;
        font-weight: 600;
    }

.cookie-close {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: var(--cookie-light);
    color: var(--cookie-text);
    font: inherit;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.cookie-dialog-body {
    min-height: 0;
    padding: 16px 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

    .cookie-dialog-body h3 {
        margin: 0 0 10px;
        font-size: 14px;
    }

    .cookie-dialog-body p {
        margin: 0 0 12px;
    }

.cookie-category {
    margin-bottom: 10px;
    overflow: hidden;
    border: 1px solid var(--cookie-border);
    border-radius: 6px;
}

.cookie-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--cookie-light);
}

.cookie-category-toggle {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 3px 0;
    border: 0;
    background: transparent;
    color: var(--cookie-text);
    font: inherit;
    font-weight: 600;
    text-align: start;
    cursor: pointer;
}

.cookie-chevron {
    width: 7px;
    height: 7px;
    flex-shrink: 0;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
}

.cookie-category-toggle[aria-expanded="true"] .cookie-chevron {
    transform: rotate(45deg);
}

.cookie-switch {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    width: 34px;
    height: 20px;
    margin: 0;
}

    .cookie-switch input {
        position: absolute;
        width: 100%;
        height: 100%;
        margin: 0;
        opacity: 0;
        cursor: pointer;
    }

.cookie-switch-track {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: #8994a6;
    pointer-events: none;
}

    .cookie-switch-track::before {
        position: absolute;
        top: 3px;
        left: 3px;
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: #fff;
        content: "";
    }

.cookie-switch input:checked + .cookie-switch-track {
    background: var(--cookie-primary);
}

    .cookie-switch input:checked + .cookie-switch-track::before {
        transform: translateX(14px);
    }

.cookie-switch input:disabled {
    cursor: not-allowed;
}

    .cookie-switch input:disabled + .cookie-switch-track {
        opacity: .65;
    }

.cookie-switch input:focus-visible + .cookie-switch-track,
.cookie-button:focus-visible,
.cookie-close:focus-visible,
.cookie-category-toggle:focus-visible,
.cookie-policy-link:focus-visible,
.cookie-preferences-link:focus-visible {
    outline: 2px solid var(--cookie-primary);
    outline-offset: 3px;
}

.cookie-category-details {
    padding: 12px;
    border-top: 1px solid var(--cookie-border);
}

    .cookie-category-details p {
        font-size: 12px;
    }

.cookie-table-wrapper {
    overflow-x: auto;
}

.cookie-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    line-height: 1.5;
}

    .cookie-table th,
    .cookie-table td {
        padding: 7px 8px;
        border: 1px solid var(--cookie-border);
        text-align: start;
        vertical-align: top;
        overflow-wrap: anywhere;
    }

    .cookie-table th {
        background: var(--cookie-light);
        font-weight: 600;
    }

.cookie-dialog p.cookie-note {
    margin: 14px 0 0;
    color: #6c757d;
    font-size: 11px;
}

.cookie-dialog-footer {
    display: flex;
    flex-shrink: 0;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--cookie-border);
}

.cookie-preferences-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.cookie-policy-link {
    color: var(--cookie-primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

    .cookie-policy-link:hover {
        color: var(--cookie-primary);
        text-decoration: underline;
    }

@media (max-width: 767px) {
    .cookie-banner {
        right: 10px;
        bottom: 10px;
        left: 10px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
    }

    .cookie-actions .cookie-button {
        flex: 1;
    }

    .cookie-dialog-header,
    .cookie-dialog-body,
    .cookie-dialog-footer {
        padding: 12px 14px;
    }

        .cookie-dialog-footer .cookie-button {
            flex: 1;
        }
}

@media (max-width: 380px) {
    .cookie-actions,
    .cookie-dialog-footer {
        flex-direction: column;
    }
}
