/* ===================================================
   Mobile redesign — apkpuri.site
   =================================================== */

/* Ads off */
.ad-js-anchor, .js-ad-slot, .ad-adsense, ins.adsbygoogle {
  display: none !important;
  min-height: 0 !important;
}
.search-top { display: none !important; }

/* =================================================
   HEADER
   ================================================= */
@media screen and (max-width: 995px) {

  /* Reset the desktop centering trick and make sticky */
  .common-header {
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
    z-index: 999;
  }

  /* Stack rows vertically */
  .common-header .header-content {
    flex-direction: column !important;
    align-items: stretch !important;
    height: auto !important;
    max-width: 100% !important;
    padding: 0 !important;
  }

  /* ── Row 1: Logo + icons ── */
  .common-header .header-content .header-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 16px !important;
    height: 52px !important;
    border-bottom: 1px solid #f0f2f5;
    flex-shrink: 0;
  }

  /* Logo visible and sized */
  .common-header .header-content .header-top .logo {
    height: 26px !important;
    display: flex !important;
    align-items: center;
  }
  .common-header .header-content .header-top .logo img {
    height: 26px !important;
    width: auto !important;
    display: block !important;
  }

  /* Hide JS-controlled close button */
  .common-header .header-content .header-top .menu-close-btn {
    display: none !important;
  }

  /* ── Row 2: Nav tabs ── */
  .common-header .header-content .header-middle {
    display: flex !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    background: #fff;
    border-bottom: 1px solid #eceff1;
    flex-shrink: 0;
    height: 42px !important;
  }
  .common-header .header-content .header-middle::-webkit-scrollbar {
    display: none;
  }

  .common-header .header-content .header-middle ul {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    height: 42px !important;
    gap: 0 !important;
    padding: 0 8px !important;
    width: max-content;
    min-width: 100%;
  }

  .common-header .header-content .header-middle ul li {
    flex-shrink: 0 !important;
    display: flex;
    align-items: stretch;
  }

  .common-header .header-content .header-middle ul li > a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 12px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: rgba(0,0,0,.55) !important;
    white-space: nowrap !important;
    line-height: 1 !important;
    height: 42px !important;
    border-bottom: 2px solid transparent;
    box-sizing: border-box;
  }
  .common-header .header-content .header-middle ul li > a:first-child {
    color: #24cd77 !important;
    border-bottom-color: #24cd77 !important;
  }

  /* ── Row 3: Search bar ── */
  .common-header .header-content .header-bottom {
    display: flex !important;
    align-items: center !important;
    padding: 8px 12px !important;
    gap: 8px !important;
    background: #f9fafb !important;
    justify-content: flex-start !important;
    flex-shrink: 0;
  }

  /* Hide hamburger — nav is always visible */
  .common-header .header-content .header-bottom .menu-btn {
    display: none !important;
  }
  /* Hide language button text */
  .common-header .header-content .header-bottom .language-btn .language-btn-text {
    display: none !important;
  }

  /* Search form full width */
  .common-header .header-content .header-bottom .header-search {
    display: flex !important;
    flex: 1 !important;
    border-radius: 24px !important;
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    height: 36px !important;
    align-items: center !important;
    padding: 0 12px !important;
  }
  .common-header .header-content .header-bottom .header-search input {
    flex: 1;
    border: none !important;
    outline: none !important;
    font-size: 14px;
    background: transparent;
  }
  .search-mask { display: none !important; }

  /* Main content — no extra top gap */
  .main-container,
  body > .main-container {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
}

/* =================================================
   APP INFO
   ================================================= */
@media screen and (max-width: 719px) {

  .app-icon-img {
    width: 80px !important;
    height: 80px !important;
  }

  .head-app-info h1 {
    font-size: 18px !important;
    line-height: 1.3 !important;
  }

  .dt-agg-info {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .dt-agg-info li {
    flex: 1 1 44% !important;
    min-width: 0 !important;
    text-align: center;
  }

  /* Download button */
  .download-box { width: 100%; }
  .download-box .da {
    display: flex !important;
    width: 100% !important;
    justify-content: center !important;
    padding: 14px 20px !important;
    font-size: 16px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }

  .breadcrumbs { font-size: 12px !important; }
}

/* =================================================
   CONTENT
   ================================================= */
@media screen and (max-width: 995px) {
  .screenshots-wrap, .screenshot-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  table {
    display: block !important;
    overflow-x: auto !important;
    width: 100% !important;
  }
  .app-list-wrap, .game-list-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

/* =================================================
   SMALL PHONES (< 380px)
   ================================================= */
@media screen and (max-width: 380px) {
  body { font-size: 13px; }
  .app-icon-img { width: 64px !important; height: 64px !important; }
  .dt-agg-info li { flex: 1 1 100% !important; }
  .common-header .header-content .header-middle ul li > a {
    padding: 0 8px !important;
    font-size: 12px !important;
  }
}
