/* ===== Responsive & Mobile ===== */

/* Burger Button - Hidden on Desktop */
.burger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-main);
    padding: 8px;
    border-radius: var(--radius-sm);
}

.burger-btn:hover {
    background-color: var(--color-bg-body);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 15;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive Text in Header Buttons */
@media (max-width: 480px) {
    .btn-text {
        display: none;
    }

    .header-btn {
        padding: 8px;
    }
}


/* Breakpoints */

/* Laptop (max-width: 1024px) */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 280px;
    }

    .sidebar {
        width: var(--sidebar-width);
    }

    .grid-layout {
        gap: 16px;
    }
}

/* Tablet (max-width: 768px) */
@media (max-width: 768px) {
    .app-header {
        padding: 0 16px;
    }

    .burger-btn {
        display: flex;
        margin-right: 8px;
    }

    .logo-area {
        gap: 8px;
    }

    /* Sidebar becomes off-canvas */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 280px;
        transform: translateX(-100%);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
        z-index: 100;
        /* Above header */
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Layout direction change is handled by sidebar being fixed now */

    .grid-layout {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    /* Details Overlay needs to adjust */
    .details-overlay {
        width: 100%;
        max-width: 400px;
        right: 0;
        transform: translateY(-50%) translateX(100%);
    }

    .details-overlay.open {
        transform: translateY(-50%) translateX(0);
        right: 16px;
        /* A bit of margin */
    }

    /* Formats Panel - Opens on top of sidebar instead of to the right */
    .formats-panel {
        left: 0;
        width: 100%;
        border-left: none;
        box-shadow: none;
        background: var(--color-bg-white);
        z-index: 30;
    }
}

/* Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .brand-logo {
        font-size: 18px;
    }

    .sidebar {
        width: 85%;
        /* Mostly full width */
    }

    /* Grid becomes single column usually, but auto-fill with 240px might already do 1 column on <480px. 
       Let's force 1 column for very small screens or let grid handle it.
       If screen is 375px, 240px min means 1 column. */

    .grid-layout {
        grid-template-columns: 1fr;
    }

    /* Details Overlay full screen or bottom sheet style */
    .details-overlay {
        width: 100%;
        max-width: 100%;
        height: 80vh;
        /* Bottom sheet style maybe? Or just full centered */
        top: auto;
        bottom: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
        max-height: 80vh;
    }

    .details-overlay.open {
        transform: translateY(0);
        right: 0;
    }

    /* Map controls position */
    .map-controls {
        top: auto;
        bottom: 24px;
        right: 16px;
    }

    /* Adjust input sizes for touch */


    .btn-book,
    .btn-reset,
    .side-btn {
        min-height: 44px;
    }

    /* Redesigned Mobile View Toggle */
    .view-toggle-wrapper {
        position: absolute;
        top: 24px;
        left: 16px;
        right: auto;
        transform: none;
        background: transparent;
        padding: 0;
        box-shadow: none;
        z-index: 20;
    }

    .view-toggle {
        display: flex;
        flex-direction: column;
        background: white;
        border: 2px solid var(--color-primary);
        /* Blue border as per image */
        border-radius: 8px;
        padding: 2px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        gap: 2px;
    }

    .toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 6px;
        transition: all 0.2s;
        color: var(--color-primary);
        /* Icon color when inactive */
        background: transparent;
        box-shadow: none;
    }

    .toggle-btn.active {
        background: var(--color-primary);
        color: white;
        box-shadow: none;
    }

    .toggle-text {
        display: none;
        /* Hide text */
    }

    .toggle-icon {
        display: block;
        /* Ensure icon is visible */
        width: 24px;
        height: 24px;
    }
}