/* ==========================================
   WebOS Mobile Responsive Adaptation CSS
   ========================================== */
@media (max-width: 768px) {
    /* Mobile Desktop Grid */
    #desktop-grid {
        top: 48px;
        left: 12px;
        right: 12px;
        bottom: 80px;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 16px 8px;
        align-content: start;
    }

    .desktop-icon {
        width: 100%;
        height: auto;
        padding: 6px;
    }

    .desktop-icon-img {
        width: 38px;
        height: 38px;
    }

    .desktop-icon-title {
        font-size: 0.72rem;
    }

    /* Floating Dock Adapts to Mobile Bottom Nav */
    #webos-dock-container {
        bottom: 8px;
        width: calc(100% - 24px);
    }

    #webos-dock {
        width: 100%;
        justify-content: space-around;
        padding: 8px 12px;
        border-radius: var(--radius-lg);
    }

    .dock-item {
        width: 42px;
        height: 42px;
    }

    .dock-icon {
        width: 30px;
        height: 30px;
    }

    .dock-item:hover {
        transform: none; /* Disable heavy desktop magnification on touch */
    }

    /* Windows become nearly full-screen Glass Bottom Sheets */
    .webos-window {
        top: 42px !important;
        left: 8px !important;
        right: 8px !important;
        width: calc(100vw - 16px) !important;
        height: calc(100vh - 120px) !important;
        border-radius: var(--radius-xl) var(--radius-xl) var(--radius-md) var(--radius-md);
    }

    .window-header {
        height: 48px;
    }

    /* Disable window border resizing handles on mobile */
    .window-resize-handle {
        display: none !important;
    }

    /* Store & Explorer Layout Collapses to 1 Column */
    .store-layout, .explorer-body, .admin-layout {
        grid-template-columns: 1fr;
    }

    .store-sidebar, .explorer-sidebar, .admin-sidebar {
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }

    /* Mobile Notification Cards */
    #notification-container {
        top: 44px;
        left: 12px;
        right: 12px;
        width: calc(100% - 24px);
    }
}
