/* ========== BOTTOM SHEET COMPONENT ========== */

.bottom-sheet[hidden] { display: none; }
.bottom-sheet {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    animation: bsBackdropIn 200ms ease-out;
}

.bottom-sheet-panel {
    position: relative;
    background: #fff;
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: bsPanelInDesktop 180ms cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden;
}

.bottom-sheet-handle {
    display: none;
}

.bottom-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.bottom-sheet-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    margin: 0;
}

.bottom-sheet-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #888;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}
.bottom-sheet-close:hover { color: #222; background: #f3f4f6; }

.bottom-sheet-body {
    padding: 18px 20px;
    overflow-y: auto;
    flex: 1;
}

.bottom-sheet-footer {
    padding: 14px 20px 20px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
    background: #fff;
}
.bottom-sheet-footer .btn {
    width: 100%;
}

/* Mobile: vira bottom-sheet de verdade */
@media (max-width: 768px) {
    .bottom-sheet {
        align-items: flex-end;
    }
    .bottom-sheet-panel {
        max-width: 100%;
        max-height: 85vh;
        border-radius: 16px 16px 0 0;
        animation: bsPanelInMobile 220ms cubic-bezier(0.32, 0.72, 0, 1);
    }
    .bottom-sheet-handle {
        display: block;
        width: 44px;
        height: 4px;
        background: #cbd5e1;
        border-radius: 2px;
        margin: 8px auto 0;
        flex-shrink: 0;
        cursor: grab;
    }
    .bottom-sheet-handle:active { cursor: grabbing; }
}

@keyframes bsBackdropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes bsPanelInDesktop {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes bsPanelInMobile {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .bottom-sheet-backdrop,
    .bottom-sheet-panel {
        animation: none !important;
    }
}

body.bs-open {
    overflow: hidden;
    touch-action: none;
}
