.mg-cookie {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 10050;
    padding: clamp(0.75rem, 2vw, 1.25rem);
    pointer-events: none;
}

.mg-cookie:not([hidden]) {
    pointer-events: auto;
}

.mg-cookie__panel {
    width: min(100%, 920px);
    margin: 0 auto;
    padding: clamp(1rem, 2.2vw, 1.35rem) clamp(1rem, 2.5vw, 1.5rem);
    border-radius: 20px;
    border: 1px solid rgba(199, 169, 67, 0.35);
    background: rgba(23, 23, 23, 0.98);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.mg-cookie__title {
    margin: 0 0 0.5rem;
    font-size: clamp(1rem, 1.8vw, 1.125rem);
    font-weight: 700;
    color: #fff;
}

.mg-cookie__text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.86);
}

.mg-cookie__link {
    color: var(--mg-accent);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.mg-cookie__link:hover {
    color: var(--mg-accent-hover);
}

.mg-cookie__banner {
    display: grid;
    gap: 1rem;
}

.mg-cookie__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.mg-cookie__actions--settings {
    margin-top: 1rem;
}

.mg-cookie__btn {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 0.7rem 1.15rem;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

.mg-cookie__btn--primary {
    background: var(--mg-accent);
    color: #171717;
}

.mg-cookie__btn--primary:hover {
    background: var(--mg-accent-hover);
}

.mg-cookie__btn--ghost {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.mg-cookie__btn--ghost:hover {
    background: rgba(255, 255, 255, 0.14);
}

.mg-cookie__categories {
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.875rem;
}

.mg-cookie__category {
    padding: 0.875rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.mg-cookie__category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.mg-cookie__category-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
}

.mg-cookie__category-text {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.72);
}

.mg-cookie__badge {
    flex-shrink: 0;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(199, 169, 67, 0.18);
    color: var(--mg-accent);
}

.mg-cookie__toggle {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    user-select: none;
}

.mg-cookie__toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mg-cookie__toggle-ui {
    position: relative;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    transition: background-color 0.2s ease;
}

.mg-cookie__toggle-ui::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s ease;
}

.mg-cookie__toggle input:checked + .mg-cookie__toggle-ui {
    background: var(--mg-accent);
}

.mg-cookie__toggle input:checked + .mg-cookie__toggle-ui::after {
    transform: translateX(18px);
}

.mg-cookie__toggle input:focus-visible + .mg-cookie__toggle-ui {
    outline: 2px solid var(--mg-accent);
    outline-offset: 2px;
}

.mg-footer__cookie-btn {
    appearance: none;
    margin: 0.35rem 0 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: underline;
    text-underline-offset: 0.15em;
    cursor: pointer;
}

.mg-footer__cookie-btn:hover {
    color: var(--mg-accent);
}

@media (min-width: 768px) {
    .mg-cookie__banner {
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 1.25rem;
    }

    .mg-cookie__actions {
        justify-content: flex-end;
    }
}

@media (max-width: 479px) {
    .mg-cookie__btn {
        flex: 1 1 calc(50% - 0.3125rem);
        min-width: 0;
    }

    .mg-cookie__actions .mg-cookie__btn:last-child {
        flex-basis: 100%;
    }
}
