/* ===== MOBILE: max-width 600px ===== */

@media (max-width: 600px) {
    /* Sidebar: fixed overlay on mobile */
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 280px;
        transition: transform 0.28s ease;
        z-index: 100;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    }

    /* Main content takes full width */
    .main-content {
        margin-left: 0;
    }

    .top-header {
        padding: 0 12px;
    }

    .content-scroll {
        height: calc(100vh - var(--header-height));
    }

    /* Section */
    .section {
        padding: 20px 12px;
    }

    /* Hero */
    .hero-section {
        padding: 20px 12px;
    }

    /* Grid */
    .apps-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0;
    }

    /* Cards */
    .app-card-category {
        padding: 12px;
        border-radius: 14px;
    }

    .app-icon-category {
        width: 100px;
        height: 100px;
    }

    .category-name {
        font-size: 16px;
    }

    .category-description {
        font-size: 13px;
    }

    .category-visit-btn {
        padding: 8px;
        font-size: 12px;
    }

    /* Compact card */
    .app-card-compact {
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        border-radius: 14px;
        max-width: 100%;
    }

    .app-icon-compact {
        width: 76px;
        height: 76px;
        margin: 0 auto 10px;
        border-radius: 12px;
    }

    .app-info-compact {
        padding: 0 4px;
    }

    .get-button-compact {
        width: 100%;
        justify-content: center;
        padding: 12px;
        border-radius: 12px;
        font-size: 15px;
    }

    /* List items */
    .category-card {
        padding: 12px;
        border-radius: 14px;
    }

    .list-item {
        padding: 12px;
        gap: 10px;
    }

    .list-item .list-item-icon {
        width: 56px;
        height: 56px;
    }

    .list-item .list-item-title {
        font-size: 15px;
    }

    .list-item .visit-button {
        padding: 10px 12px;
        font-size: 14px;
    }

    /* Mini cards */
    .app-card-mini {
        padding: 10px;
        gap: 10px;
    }

    .app-card-mini .app-icon-compact {
        width: 60px;
        height: 60px;
        border-radius: 10px;
    }

    .app-name-compact {
        font-size: 15px;
    }

    .visit-link {
        padding: 8px 12px;
        font-size: 14px;
    }

    /* Hide scrollbar */
    .app-row::-webkit-scrollbar {
        display: none;
    }

    /* Small devices adjustments */
    @media (max-width: 420px) {
        .app-card-compact {
            min-width: 200px;
            max-width: 88%;
            padding: 12px;
        }

        .app-icon-compact {
            width: 72px;
            height: 72px;
        }

        .get-button-compact {
            padding: 10px;
            font-size: 14px;
        }

        .app-card-mini {
            min-width: 150px;
            max-width: 74%;
            padding: 12px;
        }

        .app-card-mini .app-icon-compact {
            width: 64px;
            height: 64px;
        }

        .app-card-mini .app-name-compact {
            font-size: 14px;
        }
    }
}

/* ===== TABLET: 601px - 1024px ===== */

@media (min-width: 601px) and (max-width: 1024px) {
    .apps-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 14px;
    }

    .app-card-compact {
        max-width: 560px;
    }
}

/* ===== LARGE SCREENS: 1400px+ ===== */

@media (min-width: 1400px) {
    .app-card-compact {
        max-width: 820px;
        padding: 18px;
    }

    .app-icon-compact {
        width: 80px;
        height: 80px;
    }
}

/* ===== HOVER EFFECTS (Desktop) ===== */

@media (hover: hover) {
    .app-card-compact:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.28);
        border-color: rgba(10, 132, 255, 0.12);
    }

    .list-item:hover {
        background: rgba(255, 255, 255, 0.02);
        transform: translateY(-2px);
    }

    .sidebar-item:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
        transform: translateX(4px);
    }
}

/* ===== TOUCH SCROLL ===== */

.app-row {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

.app-card-compact {
    scroll-snap-align: center;
}
