/* ============================================================================
   MOBILE BOTTOM SHEET STYLES
   Only active on screens <= 768px
   ============================================================================ 
   
   TYPOGRAPHY CONTROLS - Edit these values to customize:
   --bs-title-size: Header title font size (default: 1.125rem / 18px)
   --bs-title-weight: Header title font weight (default: 600)
   --bs-option-size: Option text font size (default: 1rem / 16px)
   --bs-option-weight: Option text font weight (default: 400)
   --bs-option-weight-selected: Selected option weight (default: 600)
   --bs-option-padding: Option vertical padding (default: 16px)
   
   DIVIDER CONTROLS:
   --bs-divider-color: Line color between options (default: #e5e7eb)
   
   HOVER/ACTIVE CONTROLS:
   --bs-hover-bg: Background on hover (default: #f9fafb)
   --bs-active-bg: Background on tap/active (default: #f3f4f6)
   ============================================================================ */

/* CSS Custom Properties (Edit these to customize) */
.bottom-sheet {
    --bs-title-size: 1.125rem;
    --bs-title-weight: 600;
    --bs-title-color: #111827;
    --bs-option-size: 1rem;
    --bs-option-weight: 400;
    --bs-option-color: #111827;
    --bs-option-weight-selected: 600;
    --bs-option-padding: 16px;
    --bs-divider-color: #e5e7eb;
    --bs-hover-bg: #f9fafb;
    --bs-active-bg: #f3f4f6;
    --bs-selected-bg: #235383;
    --bs-selected-color: white;
}

/* Bottom Sheet Overlay */
.bottom-sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 9998;
    transition: background 0.3s ease;
    touch-action: none; /* Prevent scroll-through on overlay */
    -webkit-overflow-scrolling: none;
}

.bottom-sheet-overlay.active {
    display: block;
    background: rgba(0, 0, 0, 0.5);
}

/* Bottom Sheet Container */
.bottom-sheet {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 70vh;
    overflow: hidden;
    /* Safe area for iPhone X+ */
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-sheet.active {
    display: block;
    transform: translateY(0);
}

/* Drag Handle */
.bottom-sheet-handle {
    display: flex;
    justify-content: center;
    padding: 12px 0 8px 0;
    cursor: grab;
}

.bottom-sheet-handle::after {
    content: '';
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 4px;
}

/* Bottom Sheet Header */
.bottom-sheet-header {
    padding: 0 20px 16px 20px;
    border-bottom: 1px solid var(--bs-divider-color);
}

.bottom-sheet-title {
    font-size: var(--bs-title-size);
    font-weight: var(--bs-title-weight);
    color: var(--bs-title-color, #111827);
    margin: 0;
}

/* Bottom Sheet Options */
.bottom-sheet-options {
    overflow-y: auto;
    max-height: calc(70vh - 100px);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.bottom-sheet-option {
    padding: var(--bs-option-padding) 20px;
    font-size: var(--bs-option-size);
    font-weight: var(--bs-option-weight);
    color: var(--bs-option-color, #111827);
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--bs-divider-color);
}

.bottom-sheet-option:last-child {
    border-bottom: none;
}

/* Hover state for non-selected options */
.bottom-sheet-option:not(.selected):hover {
    background: var(--bs-hover-bg);
}

/* Active/tap state */
.bottom-sheet-option:not(.selected):active {
    background: var(--bs-active-bg);
}

/* Selected option */
.bottom-sheet-option.selected {
    background: var(--bs-selected-bg);
    color: var(--bs-selected-color);
    font-weight: var(--bs-option-weight-selected);
}

.bottom-sheet-option.selected:active {
    background: #1a3f62;
}

/* Checkmark for selected option */
.bottom-sheet-option.selected::after {
    content: '';
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

/* Safe area padding at bottom */
.bottom-sheet-safe-area {
    height: 20px;
}

/* Animation keyframes */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}

@keyframes fadeIn {
    from {
        background: rgba(0, 0, 0, 0);
    }
    to {
        background: rgba(0, 0, 0, 0.5);
    }
}

@keyframes fadeOut {
    from {
        background: rgba(0, 0, 0, 0.5);
    }
    to {
        background: rgba(0, 0, 0, 0);
    }
}

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

/* Mobile: Hide regular dropdowns when bottom sheet is available */
@media (max-width: 768px) {
    /* Override the centered modal behavior */
    .filter-dropdown {
        display: none !important;
    }
    
    /* Bottom sheet specific mobile styles */
    .bottom-sheet-option {
        padding: 18px 20px;
        font-size: 1.0625rem;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .bottom-sheet,
    .bottom-sheet-overlay {
        transition: none;
    }
}
        