/*
 * Cookie roziligi: banner va sozlamalar oynasi.
 *
 * Ranglar `style.css` dagi `:root` o'zgaruvchilaridan olinadi — saytning
 * palitrasi o'zgarsa bu ham o'zi ergashadi. Zaxira qiymatlar ataylab
 * qo'yilgan: banner boshqa layoutda ham (masalan `/audit`) chiqadi.
 */

.dora-cookie__banner {
    position: fixed;
    z-index: 2147483000; /* Toastr va modal ustidan */
    left: 16px;
    right: 16px;
    bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    align-items: center;
    justify-content: space-between;
    max-width: 1120px;
    margin: 0 auto;
    padding: 20px 24px;
    background: var(--white, #fff);
    border: 1px solid var(--line, #dfe2e7);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(12, 18, 40, .16);
}

.dora-cookie__banner[hidden],
.dora-cookie__overlay[hidden] {
    display: none !important;
}

.dora-cookie__banner-text {
    flex: 1 1 340px;
    min-width: 0;
}

.dora-cookie__title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: var(--on-surface, #0c1228);
}

.dora-cookie__body {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--on-surface-variant1, #646570);
}

.dora-cookie__body a {
    color: var(--blue, #2d4fe1);
    text-decoration: underline;
}

.dora-cookie__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dora-cookie__btn {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.dora-cookie__btn--primary {
    background: var(--blue, #2d4fe1);
    color: var(--white, #fff);
}

.dora-cookie__btn--primary:hover {
    background: var(--secondary, #1533b4);
}

.dora-cookie__btn--ghost {
    background: transparent;
    border-color: var(--line, #dfe2e7);
    color: var(--on-surface, #0c1228);
}

.dora-cookie__btn--ghost:hover {
    background: var(--surface, #f3f5f9);
}

.dora-cookie__btn:focus-visible,
.dora-cookie__close:focus-visible,
.dora-cookie__switch input:focus-visible + .dora-cookie__slider {
    outline: 2px solid var(--blue, #2d4fe1);
    outline-offset: 2px;
}

/* Sozlamalar oynasi ------------------------------------------------- */

.dora-cookie__overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(12, 18, 40, .5);
}

.dora-cookie__modal {
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 24px;
    background: var(--white, #fff);
    border-radius: 16px;
}

.dora-cookie__modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.dora-cookie__close {
    flex: none;
    width: 32px;
    height: 32px;
    font-size: 24px;
    line-height: 1;
    color: var(--on-surface-variant1, #646570);
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.dora-cookie__close:hover {
    background: var(--surface, #f3f5f9);
}

.dora-cookie__list {
    margin: 20px 0;
    padding: 0;
    list-style: none;
}

.dora-cookie__item {
    padding: 16px 0;
    border-top: 1px solid var(--line, #dfe2e7);
}

.dora-cookie__item:last-child {
    border-bottom: 1px solid var(--line, #dfe2e7);
}

.dora-cookie__item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
}

.dora-cookie__item-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--on-surface, #0c1228);
}

.dora-cookie__item-text {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--on-surface-variant1, #646570);
}

.dora-cookie__item-services {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--on-surface-variant2, #aab1b8);
    word-break: break-word;
}

/* Tugmacha ---------------------------------------------------------- */

.dora-cookie__switch {
    position: relative;
    flex: none;
    width: 44px;
    height: 24px;
}

.dora-cookie__switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.dora-cookie__slider {
    position: absolute;
    inset: 0;
    background: var(--on-surface-variant2, #aab1b8);
    border-radius: 999px;
    transition: background-color .15s ease;
    pointer-events: none;
}

.dora-cookie__slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: var(--white, #fff);
    border-radius: 50%;
    transition: transform .15s ease;
}

.dora-cookie__switch input:checked + .dora-cookie__slider {
    background: var(--blue, #2d4fe1);
}

.dora-cookie__switch input:checked + .dora-cookie__slider::after {
    transform: translateX(20px);
}

/* Majburiy toifa: o'chirib bo'lmasligi ko'rinib tursin. */
.dora-cookie__switch input:disabled {
    cursor: not-allowed;
}

/* Majburiy toifa yoqiq turadi — kulrang emas, faqat xiraroq ko'k. */
.dora-cookie__switch input:disabled:checked + .dora-cookie__slider {
    background: var(--blue, #2d4fe1);
    opacity: .45;
}

@media (max-width: 575.98px) {
    .dora-cookie__banner {
        left: 8px;
        right: 8px;
        bottom: 8px;
        padding: 16px;
    }

    .dora-cookie__actions .dora-cookie__btn {
        flex: 1 1 100%;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dora-cookie__btn,
    .dora-cookie__slider,
    .dora-cookie__slider::after {
        transition: none;
    }
}
