/* ============================================================
   Tokmart - Responsive breakpoints + utility classes
   ============================================================ */

@media(max-width:480px) {
    .topbar {
        padding: 6px 12px;
        min-height: 48px;
    }
    .logo .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    .icon-btn {
        width: 34px;
        height: 34px;
        font-size: 12px;
    }
    /* Match the shrunk .topbar above so every sub-page's own header
       (notifications, login/register/forgot-password, favorites, orders,
       recharge, account settings, chat) is the same size as the main
       header instead of visibly taller. */
    .detail-header,
    .settings-page .detail-header,
    .product-detail-page .detail-header,
    .all-products-page .detail-header,
    .category-products-page .detail-header,
    .favorites-page .detail-header,
    .orders-page .detail-header,
    .order-detail-page .detail-header,
    .recharge-page .detail-header,
    .auth-page .detail-header,
    .chat-app-user .chat-header {
        padding: 6px 12px;
        padding-top: calc(6px + var(--safe-area-top));
        min-height: 52px;
    }
    .detail-header h2,
    .settings-page .detail-header h2,
    .product-detail-page .detail-header h2,
    .all-products-page .detail-header h2,
    .category-products-page .detail-header h2,
    .favorites-page .detail-header h2,
    .orders-page .detail-header h2,
    .order-detail-page .detail-header h2,
    .recharge-page .detail-header h2,
    .auth-page .detail-header h2,
    .chat-app-user .chat-header .chat-info .name {
        font-size: 16px;
    }
    .back-btn {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
        font-size: 15px;
    }
    .notification-item {
        padding: 12px;
        flex-wrap: wrap;
    }
    .notification-item .notif-actions {
        width: 100%;
        justify-content: flex-end;
        flex-direction: row;
    }
}

@media(min-width:1024px) {
    .scroll-area {
        max-width: 1200px;
        margin: 0 auto;
        padding-left: 20px;
        padding-right: 20px;
    }
    .bottom-nav-wrapper {
        max-width: 1200px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: 100%;
        padding-left: 20px;
        padding-right: 20px;
    }
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .categories-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    /* Full-screen overlay pages (login, notifications, product detail,
       checkout, chat, ...) previously stayed edge-to-edge at any width,
       so on a laptop they stretched full-bleed while the home/category
       content next to them was already capped at 1200px above - matching
       them to the same centered column keeps the whole site consistent. */
    .settings-page,
    .product-detail-page,
    .all-products-page,
    .category-products-page,
    .favorites-page,
    .orders-page,
    .order-detail-page,
    .recharge-page,
    .auth-page,
    .chat-app-user {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: 100%;
        max-width: 1200px;
    }

    /* Narrow, single-column bodies (forms, a single order/product) read
       better capped and centered instead of stretched to the full 1200px
       frame; grids/messages lists are excluded since they already reflow
       via their own grid-template-columns / list layout. */
    .settings-page .settings-page-body,
    .order-detail-page .order-detail-body,
    .recharge-page .recharge-body,
    .auth-page .auth-body {
        max-width: 520px;
        margin: 0 auto;
        width: 100%;
    }
}

/* ===== UTILITIES ===== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }

/* ===== Per-page product grid overrides ===== */
#app { display: flex; flex-direction: column; }

.scroll-area {
    flex: 1 1 auto !important;
    height: 0 !important;
    min-height: 0;
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
}

#page-home .products-grid {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 12px;
    padding: 12px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

#page-home .product-card {
    flex: 0 0 130px;
    width: 130px;
    min-width: 130px;
    max-width: none;
    height: 160px;
}

.all-products-page .products-grid,
.category-products-page .products-grid,
.favorites-page .favorites-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 12px;
    overflow: visible !important;
}

.all-products-page .product-card,
.category-products-page .product-card,
.favorites-page .product-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 185px !important;
}
