.wb-cc {
    --wb-cc-float-offset: 20px;
}

.wb-cc-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px 24px;
    padding: 20px 28px calc(20px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
    transform: translateY(110%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.wb-cc-banner.is-open { transform: translateY(0); }
.wb-cc-banner[hidden] { display: none; }

.wb-cc-banner__body {
    flex: 1 1 420px;
    min-width: 0;
}
.wb-cc-banner__title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    color: #1F2937;
}
.wb-cc-banner__text {
    font-size: 13px;
    line-height: 1.6;
    color: #4B5563;
}
.wb-cc-banner__text p { margin: 0; }
.wb-cc-banner__policy {
    color: #2D3691;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
}

.wb-cc-banner__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.wb-cc-btn {
    padding: 10px 22px;
    border: 1px solid transparent;
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.12s;
    white-space: nowrap;
}
.wb-cc-btn:hover { transform: translateY(-1px); }
.wb-cc-btn:active { transform: translateY(0); }
.wb-cc-btn:focus-visible {
    outline: 3px solid rgba(45, 54, 145, 0.4);
    outline-offset: 2px;
}
.wb-cc-btn--accept { background: #2D3691; color: #fff; }
.wb-cc-btn--reject { background: #fff; color: #2D3691; border-color: #2D3691; }
.wb-cc-btn--settings {
    background: transparent;
    color: #2D3691;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding-left: 8px;
    padding-right: 8px;
}

.wb-cc-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.wb-cc-modal[hidden] { display: none; }

.wb-cc-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    animation: wb-cc-fade 0.2s ease;
}
.wb-cc-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(680px, 100%);
    max-height: min(82vh, 760px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.32);
    animation: wb-cc-pop 0.24s ease;
    overflow: hidden;
}

.wb-cc-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px 14px;
    border-bottom: 1px solid #E5E7EB;
}
.wb-cc-modal__title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}
.wb-cc-modal__close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #E5E7EB;
    border-radius: 50%;
    background: #F9FAFB;
    font-family: inherit;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
    color: #4B5563;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.12s;
}
.wb-cc-modal__close:hover {
    background: #EF4444;
    border-color: #EF4444;
    color: #fff;
    transform: scale(1.06);
}
.wb-cc-modal__close:focus-visible {
    outline: 3px solid rgba(45, 54, 145, 0.4);
    outline-offset: 2px;
}

.wb-cc-modal__intro {
    margin: 0;
    padding: 14px 24px 0;
    font-size: 13px;
    line-height: 1.6;
    color: #6B7280;
}

.wb-cc-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    scrollbar-width: thin;
}

.wb-cc-cat {
    padding: 14px 0;
    border-bottom: 1px solid #F3F4F6;
}
.wb-cc-cat:last-child { border-bottom: 0; }
.wb-cc-cat__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.wb-cc-cat__label {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
}
.wb-cc-cat__always {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: #059669;
    white-space: nowrap;
    padding-top: 2px;
}
.wb-cc-cat__desc {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: #6B7280;
}
.wb-cc-cat__cookies {
    margin: 6px 0 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    color: #9CA3AF;
    word-break: break-all;
}

.wb-cc-switch {
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 24px;
    cursor: pointer;
}
.wb-cc-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.wb-cc-switch__track {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: #D1D5DB;
    transition: background-color 0.2s;
}
.wb-cc-switch__track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s;
}
.wb-cc-switch input:checked + .wb-cc-switch__track { background: #2D3691; }
.wb-cc-switch input:checked + .wb-cc-switch__track::after { transform: translateX(20px); }
.wb-cc-switch input:focus-visible + .wb-cc-switch__track {
    outline: 3px solid rgba(45, 54, 145, 0.4);
    outline-offset: 2px;
}

.wb-cc-modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #E5E7EB;
    background: #FAFAFB;
}

.wb-cc-float {
    position: fixed;
    bottom: var(--wb-cc-float-offset, 20px);
    z-index: 999997;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: #2D3691;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    transition: transform 0.18s, box-shadow 0.18s;
}
.wb-cc-float[hidden] { display: none; }
.wb-cc-float:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.32);
}
.wb-cc-float:focus-visible {
    outline: 3px solid rgba(45, 54, 145, 0.45);
    outline-offset: 3px;
}
.wb-cc-float--left  { left: var(--wb-cc-float-offset, 20px); }
.wb-cc-float--right { right: var(--wb-cc-float-offset, 20px); }
.wb-cc-float i { font-size: 20px; }

body.wb-cc-locked { overflow: hidden; }

@keyframes wb-cc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wb-cc-pop {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .wb-cc-banner,
    .wb-cc-modal__backdrop,
    .wb-cc-modal__dialog,
    .wb-cc-float { transition: none; animation: none; }
}

@media (max-width: 900px) {
    .wb-cc-banner {
        flex-direction: column;
        align-items: stretch;
        padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
        gap: 14px;
    }
    .wb-cc-banner__actions { justify-content: stretch; }
    .wb-cc-banner__actions .wb-cc-btn { flex: 1 1 auto; text-align: center; }
    .wb-cc-banner__actions .wb-cc-btn--settings { flex-basis: 100%; order: 3; }
}

@media (max-width: 480px) {
    .wb-cc-banner__title { font-size: 14px; }
    .wb-cc-banner__text { font-size: 12.5px; }
    .wb-cc-modal__dialog { max-height: 88vh; }
    .wb-cc-modal__head,
    .wb-cc-modal__body,
    .wb-cc-modal__foot { padding-left: 16px; padding-right: 16px; }
    .wb-cc-modal__foot { flex-direction: column-reverse; }
    .wb-cc-modal__foot .wb-cc-btn { width: 100%; }
    .wb-cc-cat__head { flex-direction: column; gap: 10px; }
}
