/* ═══════════════════════════════════════════
   Bottom Sheet — Map + Intel merge
   Pull-up overlay with three snap positions
   ═══════════════════════════════════════════ */

/* ─── Dim overlay ─── */
.map-dim-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.35s ease;
    pointer-events: none;
    z-index: 5;
}
.map-dim-overlay.active {
    background: rgba(0, 0, 0, 0.35);
    pointer-events: auto;
}

/* ─── Bottom sheet container ─── */
.bottom-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    /* Start offscreen — peek amount controlled by translateY */
    transform: translateY(calc(100% - 130px));
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    background: var(--paper, #F4F1EA);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    /* Full height minus a small peek at the map */
    height: calc(100% - 56px);
    display: flex;
    flex-direction: column;
    touch-action: pan-y;
}

/* Disable CSS transition during active drag */
.bottom-sheet.dragging {
    transition: none !important;
}

/* Paper grain texture */
.bottom-sheet::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.006) 2px,
        rgba(0, 0, 0, 0.006) 4px
    );
    pointer-events: none;
    z-index: 1;
}

/* ─── Snap states via data-state ─── */
.bottom-sheet[data-state="peek"] {
    transform: translateY(calc(100% - 130px));
}
.bottom-sheet[data-state="half"] {
    transform: translateY(50%);
}
.bottom-sheet[data-state="full"] {
    transform: translateY(0);
}

/* ─── Handle bar ─── */
.bottom-sheet-handle {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0 6px;
    cursor: grab;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
    z-index: 2;
}
.bottom-sheet-handle:active {
    cursor: grabbing;
}
.bottom-sheet-handle .handle-pill {
    width: 40px;
    height: 4px;
    border-radius: 100px;
    background: rgba(0, 0, 0, 0.18);
}

/* ─── Peek label (visible at peek state) ─── */
.bottom-sheet-peek-label {
    text-align: center;
    font-family: var(--font-display, 'Archivo Black', sans-serif);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.35);
    padding-bottom: 8px;
    position: relative;
    z-index: 2;
}
.bottom-sheet[data-state="half"] .bottom-sheet-peek-label,
.bottom-sheet[data-state="full"] .bottom-sheet-peek-label {
    display: none;
}

/* ─── Scrollable content area ─── */
.bottom-sheet-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 2;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 var(--space-md, 16px);
    padding-bottom: env(safe-area-inset-bottom, 20px);
    box-sizing: border-box;
    width: 100%;
}

/* Lock scroll when at peek to prevent confusion */
.bottom-sheet[data-state="peek"] .bottom-sheet-content {
    overflow-y: hidden;
}

/* ─── Wallet lane inside bottom sheet ─── */
.bs-wallet-lane {
    margin-bottom: var(--space-md, 16px);
}
.bs-wallet-lane .lane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm, 8px) 0;
}
.bs-wallet-lane .lane-title {
    font-family: var(--font-display, 'Archivo Black', sans-serif);
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--ink, #1a1a1a);
    opacity: 0.5;
}
.bs-wallet-lane .aco-count {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 10px;
    color: var(--ink, #1a1a1a);
    opacity: 0.4;
}

/* ─── Miles Modal ─── */
.miles-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.miles-modal.open {
    display: flex;
}
.miles-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.miles-modal-container {
    position: relative;
    z-index: 1;
    background: var(--paper, #F4F1EA);
    border-radius: var(--radius-xl, 18px);
    padding: var(--space-xl, 32px) var(--space-lg, 24px);
    box-shadow: var(--shadow-lg, 0 8px 32px rgba(0,0,0,0.3));
    max-width: 360px;
    width: 90%;
    animation: milesModalIn 0.25s ease;
    text-align: center;
}
@keyframes milesModalIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.miles-modal-container .hero-label {
    font-family: var(--font-display, 'Archivo Black', sans-serif);
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--ink, #1a1a1a);
    opacity: 0.5;
    margin-bottom: var(--space-md, 16px);
}
