.cookie-consent {
    position: fixed;
    bottom: var(--space-5);
    left: 50%;
    transform: translateX(-50%);
    width: min(calc(100% - var(--space-8)), 600px);
    background: rgb(var(--color-white));
    color: rgb(var(--color-black));
    border: 1px solid rgb(var(--color-gray-3));
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-light);
    padding: var(--space-5) var(--space-6);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    z-index: 9999;
    font-family: var(--font-main), sans-serif;
    font-size: var(--font-size-xs);
}

.cookie-consent[hidden] {
    display: none;
}

.cookie-consent-text {
    flex: 1 1 0;
    color: rgb(var(--color-gray-1));
    line-height: 1.4;
    margin: 0;
}

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

.cookie-consent-buttons {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.cookie-consent-button {
    cursor: pointer;
    padding: var(--space-2) var(--space-5);
    border-radius: var(--border-radius-sm);
    font-family: var(--font-main), sans-serif;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    border: 1px solid transparent;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.cookie-consent-button-primary {
    background: rgb(var(--color-primary));
    color: rgb(var(--color-white));
}

.cookie-consent-button-primary:hover {
    background: rgb(var(--color-gray-1));
}

.cookie-consent-button-secondary {
    background: transparent;
    color: rgb(var(--color-gray-1));
    border-color: rgb(var(--color-gray-3));
}

.cookie-consent-button-secondary:hover {
    border-color: rgb(var(--color-gray-1));
    color: rgb(var(--color-gray-1));
}

@media (max-width: 520px) {
    .cookie-consent {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-consent-buttons {
        justify-content: flex-end;
    }
}

.cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.cookie-modal[hidden] {
    display: none;
}

.cookie-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.cookie-modal-content {
    position: relative;
    background: rgb(var(--color-white));
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-light);
    width: min(100%, 520px);
    max-height: 90vh;
    overflow-y: auto;
    padding: var(--space-6);
    font-family: var(--font-main), sans-serif;
    font-size: var(--font-size-xs);
    color: rgb(var(--color-gray-1));
}

.cookie-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.cookie-modal-title {
    font-size: var(--font-size-s);
    font-weight: var(--font-weight-bold);
    color: rgb(var(--color-primary));
    margin: 0;
}

.cookie-modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: rgb(var(--color-gray-2));
    font-size: var(--font-size-m);
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.cookie-modal-close:hover {
    color: rgb(var(--color-gray-1));
}

.cookie-modal-description {
    margin: 0 0 var(--space-5);
    line-height: 1.5;
}

.cookie-category {
    border-top: 1px solid rgb(var(--color-gray-3));
    padding: var(--space-4) 0;
}

.cookie-category:last-of-type {
    border-bottom: 1px solid rgb(var(--color-gray-3));
    margin-bottom: var(--space-5);
}

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-2);
}

.cookie-category-title {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    color: rgb(var(--color-gray-1));
    margin: 0;
}

.cookie-category p {
    margin: 0;
    color: rgb(var(--color-gray-2));
    line-height: 1.4;
}

.cookie-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgb(var(--color-gray-3));
    border-radius: 20px;
    transition: background-color .15s ease;
}

.cookie-switch-slider::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    left: 3px;
    top: 3px;
    background: rgb(var(--color-white));
    border-radius: 50%;
    transition: transform .15s ease;
}

.cookie-switch input:checked + .cookie-switch-slider {
    background-color: rgb(var(--color-primary));
}

.cookie-switch input:checked + .cookie-switch-slider::before {
    transform: translateX(16px);
}

.cookie-switch input:disabled + .cookie-switch-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    flex-wrap: wrap;
}
