/**
 * Bottom Sheet — mobile account menu & overlays
 */

.bottom-sheet {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    visibility: hidden;
}

.bottom-sheet.is-open {
    pointer-events: auto;
    visibility: visible;
}

.bottom-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity;
}

.bottom-sheet.is-open .bottom-sheet-backdrop {
    opacity: 1;
}

.bottom-sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(85vh, 560px);

    background: #FFFFFF;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.12);

    display: flex;
    flex-direction: column;

    transform: translate3d(0, 100%, 0);
    transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
}

.bottom-sheet.is-open .bottom-sheet-panel {
    transform: translate3d(0, 0, 0);
}

body.dark-mode .bottom-sheet-panel {
    background: #1E293B;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.4);
}

.bottom-sheet-handle {
    width: 36px;
    height: 4px;
    background: #CBD5E1;
    border-radius: 999px;
    margin: 10px auto 0;
    flex-shrink: 0;
}

body.dark-mode .bottom-sheet-handle {
    background: #475569;
}

.bottom-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 8px;
    border-bottom: 1px solid #F1F5F9;
    flex-shrink: 0;
}

body.dark-mode .bottom-sheet-header {
    border-bottom-color: #334155;
}

.bottom-sheet-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #1E293B;
    letter-spacing: -0.01em;
}

body.dark-mode .bottom-sheet-title {
    color: #F1F5F9;
}

.bottom-sheet-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: #F1F5F9;
    border-radius: 50%;
    color: #64748B;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.bottom-sheet-close:hover {
    background: #E2E8F0;
    color: #1E293B;
}

body.dark-mode .bottom-sheet-close {
    background: #334155;
    color: #94A3B8;
}

.bottom-sheet-body {
    overflow-y: auto;
    padding: 8px 12px calc(env(safe-area-inset-bottom) + 16px);
    -webkit-overflow-scrolling: touch;
}

.bottom-sheet-body .account-menu-item {
    padding: 14px 16px;
    font-size: 15px;
    border-radius: 14px;
}

/* Only show bottom sheet mechanism on mobile */
@media (min-width: 768px) {
    .bottom-sheet {
        display: none !important;
    }
}

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

body.bottom-sheet-open {
    overflow: hidden;
}
