/* Mobile + tablet: gọn, không xếp nút full-width, bảng cuộn ngang */
@media (max-width: 1024px) {
  html { -webkit-text-size-adjust: 100%; }
  .container,
  .container.narrow {
    width: min(100% - 1rem, 1180px);
  }

  /* --- Chia sẻ dưới / cạnh bảng giá: một hàng icon, không phình --- */
  .price-top-head {
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: .4rem .6rem !important;
  }
  .price-top-head .btn {
    width: auto !important;
    justify-content: center;
    padding: .32rem .6rem !important;
    font-size: .75rem !important;
    white-space: nowrap;
  }
  .price-share-board {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: .28rem !important;
    width: auto !important;
    max-width: 100%;
  }
  .price-share-board .btn {
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    font-size: 0 !important;
    line-height: 1 !important;
    border-radius: 999px !important;
  }
  .price-share-board .btn i {
    font-size: .85rem !important;
    line-height: 1;
  }
  .price-share {
    margin-top: .15rem !important;
    gap: .2rem !important;
  }
  .price-share-btn,
  .share-cell .price-share-btn {
    width: 28px !important;
    height: 28px !important;
    font-size: .72rem !important;
  }
  td.share-cell {
    white-space: nowrap;
    padding: .3rem .25rem !important;
  }
  .share-btns,
  .cta-strip {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: .35rem !important;
  }
  .share-btns .btn,
  .cta-strip .btn {
    width: auto !important;
    padding: .35rem .65rem !important;
    font-size: .78rem !important;
  }
  .share-box {
    margin-top: .7rem !important;
    padding: .55rem .7rem !important;
    border-radius: 10px !important;
  }
  .share-box strong { margin-bottom: .3rem !important; font-size: .8rem !important; }

  .gns-share-sheet {
    max-height: 52vh !important;
    padding: .7rem .75rem 1rem !important;
    border-radius: 14px 14px 0 0 !important;
  }
}

@media (max-width: 768px) {
  :root { --header: 54px; }
  .header-inner { gap: .35rem !important; }
  .header-actions .btn-sm {
    padding: .3rem .5rem !important;
    font-size: .72rem !important;
  }
  .logo-mark { width: 30px !important; height: 30px !important; }
  .nav-toggle { width: 36px !important; height: 36px !important; }

  body .section { padding-top: .65rem !important; padding-bottom: .75rem !important; }
  .section-head { margin-bottom: .45rem !important; gap: .3rem !important; }
  .section-head h1,
  .section-head h2 { font-size: 1.05rem !important; }
  .section-head p { font-size: .78rem !important; }

  .price-top-title { font-size: 1.1rem !important; }
  .price-top-sub { font-size: .75rem !important; display: none; }
  .price-top-bar { padding-top: .35rem !important; }

  table { font-size: .78rem !important; }
  th, td { padding: .32rem .35rem !important; }
  .table-wrap {
    -webkit-overflow-scrolling: touch;
    margin: 0 -.15rem;
  }

  .search-panel { padding: .5rem .55rem !important; border-radius: 10px !important; margin-bottom: .65rem !important; }
  .search-row {
    grid-template-columns: 1fr !important;
    gap: .35rem !important;
  }
  .search-row input,
  .search-row select,
  .field input,
  .field select,
  .field textarea {
    font-size: 16px !important;
    padding: .45rem .6rem !important;
    border-radius: 10px !important;
  }
  .search-row .btn { width: 100%; padding: .45rem !important; }
  .chip-row { gap: .28rem !important; overflow-x: auto; flex-wrap: nowrap !important; -webkit-overflow-scrolling: touch; }
  .chip { flex: 0 0 auto; }

  .product-all-wrap { padding: .45rem .55rem !important; }
  .product-all-chips,
  .product-all-chips.grouped { max-height: 88px !important; }

  .report-grid { grid-template-columns: 1fr 1fr !important; gap: .4rem !important; }
  .price-policy-box { padding: .45rem .55rem !important; font-size: .76rem !important; }

  .news-grid,
  .home-news-list { grid-template-columns: 1fr !important; gap: .55rem !important; }
  .news-card,
  .article-card { border-radius: 10px !important; }
  .news-card-img img,
  .article-card .thumb img { max-height: 140px; object-fit: cover; }

  .listing-filters {
    grid-template-columns: 1fr 1fr !important;
    padding: .55rem !important;
    gap: .4rem !important;
  }
  .listing-filters select,
  .listing-filters input,
  .listing-filters .btn {
    min-height: 40px !important;
    font-size: 16px !important;
  }
  .listings-grid,
  .dealers-grid { grid-template-columns: 1fr !important; gap: .45rem !important; }
  .listing-card,
  .dealer-card { padding: .5rem .6rem !important; }

  .cta-engage-actions { flex-direction: row !important; flex-wrap: wrap !important; }
  .cta-engage-actions .btn { width: auto !important; flex: 1 1 auto; min-width: 0; }

  .article h1 { font-size: 1.25rem !important; }
  .article-hero img { max-height: 200px; object-fit: cover; width: 100%; }
  .prose, .article-body { font-size: .92rem; line-height: 1.55; }

  .support-banner,
  .cta-engage { padding: .55rem .65rem !important; }

  /* farmer */
  .farmer-main-topic { padding-top: 4.4rem !important; }
  .farmer-side-pin { padding: .3rem .5rem .35rem !important; }
  .farmer-hero-crop { gap: .55rem !important; }
  .farmer-hero-img { max-height: 180px; object-fit: cover; width: 100%; }
}

@media (max-width: 560px) {
  .report-grid { grid-template-columns: 1fr !important; }
  .listing-filters { grid-template-columns: 1fr !important; }
  .price-top-head > div:first-child { flex: 1 1 100%; }
  .hero-actions { flex-direction: row !important; flex-wrap: wrap; }
  .hero-actions .btn { width: auto !important; }
  .bleed-content .btn { width: auto !important; }
  .priority-card { min-height: 0 !important; }
}

@media (min-width: 601px) and (max-width: 1024px) {
  .news-grid,
  .listings-grid,
  .dealers-grid { grid-template-columns: 1fr 1fr !important; }
  .listing-filters { grid-template-columns: 1fr 1fr 1fr !important; }
  .search-row { grid-template-columns: 1fr 140px auto !important; }
}

/* Thanh mục dưới — kiểu app; ẩn trên desktop */
.app-tabbar {
  display: none;
}
@media (max-width: 900px) {
  .app-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding: 0 2px env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    border-top: 1px solid rgba(20, 40, 28, 0.12);
    box-shadow: 0 -6px 20px rgba(15, 40, 28, 0.08);
    justify-content: space-around;
    align-items: stretch;
  }
  body.has-app-tabbar {
    padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  }
  .app-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    text-decoration: none;
    color: #5c6b62;
    font-size: .62rem;
    font-weight: 700;
    line-height: 1.15;
    padding: .28rem .1rem .2rem;
  }
  .app-tab i {
    font-size: 1.15rem;
    line-height: 1;
  }
  .app-tab span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .app-tab.is-on {
    color: #0d7a42;
  }
  .app-tab.is-on i { transform: translateY(-1px); }
  .float-stack,
  .ai-chat-fab,
  .chat-fab,
  .float-btn,
  .gns-ai-fab,
  [class*="zalo"].float {
    bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
  }
}
