/* WBDrawer — reusable slide-out panel component */

.wb-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s, visibility .25s;
}

.wb-drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

.wb-drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 480px;
    z-index: 1045;
    display: flex;
    flex-direction: column;
    background: var(--bs-body-bg, #fff);
    border-left: 1px solid var(--bs-border-color, #dee2e6);
    box-shadow: -4px 0 24px rgba(0, 0, 0, .12);
    transform: translateX(100%);
    transition: transform .25s cubic-bezier(.4, 0, .2, 1);
}

.wb-drawer-panel.open {
    transform: translateX(0);
}

.wb-drawer-panel.resizing {
    transition: none;
    user-select: none;
}

/* Resize handle */
.wb-drawer-resize-handle {
    position: absolute;
    top: 0;
    left: -3px;
    bottom: 0;
    width: 6px;
    cursor: col-resize;
    z-index: 2;
    background: transparent;
    transition: background .15s;
}

.wb-drawer-resize-handle:hover,
.wb-drawer-resize-handle.active {
    background: var(--bs-primary, #0d6efd);
    opacity: .4;
}

/* Header */
.wb-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    flex-shrink: 0;
    min-height: 52px;
}

.wb-drawer-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--bs-body-color, #212529);
}

.wb-drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--bs-secondary-color, #6c757d);
    font-size: 20px;
    flex-shrink: 0;
    transition: background .15s, color .15s;
}

.wb-drawer-close:hover {
    background: var(--bs-tertiary-bg, #f8f9fa);
    color: var(--bs-body-color, #212529);
}

/* Body */
.wb-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Dark theme */
[data-bs-theme="dark"] .wb-drawer-overlay {
    background: rgba(0, 0, 0, .55);
}

[data-bs-theme="dark"] .wb-drawer-close:hover {
    background: var(--bs-tertiary-bg, #2b3035);
}

/* Mobile: full-width, no resize */
@media (max-width: 575.98px) {
    .wb-drawer-panel {
        width: 100vw !important;
    }
    .wb-drawer-resize-handle {
        display: none;
    }
}
