/* ══════════════════════════════════════════════════════════════════
   mobile-adjust.css — shared mobile-only overrides for REOO templates.
   Scope: only applies below 767px. Desktop (>=768px) is never touched.
   Loaded at the end of <head> so rules can override earlier stylesheets
   and page-specific inline <style> blocks (uses !important where
   collisions with Bootstrap 3 or style.css are expected).
   ══════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {

  /* ── Bootstrap column: clear the inline float:right set on legacy pages ── */
  .row > [class*="col-"][style*="float"] {
    float: none !important;
  }

  /* ── Main Bootstrap container: tighten gutters for phones ── */
  .container {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
  .container .row { margin-left: -8px; margin-right: -8px; }
  .container .row > [class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
  }

  /* ── Legacy list / section headings ── */
  .list_h2 {
    font-size: 18px !important;
    padding: 22px 0 10px 0 !important;
    line-height: 1.35 !important;
  }
  .list_box { margin: 16px 0 24px !important; }

  /* ── Product grid (list/related) ── */
  .product_list {
    padding-top: 20px !important;
    margin-left: -6px !important;
    margin-right: -6px !important;
  }
  .product_list [class*="col-"] {
    padding-left: 6px !important;
    padding-right: 6px !important;
    margin-bottom: 14px !important;
  }
  .product_list2 div.product_img { min-height: 0 !important; }
  .product_title {
    font-size: 13px !important;
    line-height: 1.35 !important;
    padding: 6px 2px !important;
  }
  .product_list .product_img img,
  .product_list .img-thumbnail {
    width: 100% !important;
    height: auto !important;
  }
  .list_related .product_list [class*="col-"] {
    width: 50% !important;
    float: left !important;
  }

  /* ── Left sidebar (left.htm) ── */
  .left_nav, .left_new, .index_contact { margin-top: 24px; }
  .left_h2 {
    font-size: 18px !important;
    padding: 12px 14px !important;
  }
  .left_nav_ul > li > a { padding: 10px 14px !important; }
  .left_news li a, .left_snav_ul li a {
    font-size: 13.5px !important;
    line-height: 1.45 !important;
  }
  .index_contact p {
    font-size: 14px !important;
    line-height: 1.55 !important;
    word-break: break-word;
  }

  /* ── Product detail (view_product.htm) ── */
  .showpic_box, .proinfo_box {
    width: 100% !important;
    float: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .showpic_flash img, .example-image {
    width: 100% !important;
    height: auto !important;
  }
  #pic-page { margin-top: 10px; text-align: center; }
  #pic-page a { margin: 4px !important; }
  #pic-page img {
    width: 58px !important;
    height: 58px !important;
    object-fit: cover;
  }
  .product_h1 {
    font-size: 20px !important;
    line-height: 1.3 !important;
    padding: 14px 0 10px !important;
    margin: 0 !important;
  }
  .product_info {
    padding: 0 !important;
    list-style: none;
  }
  .product_info li {
    font-size: 14px !important;
    padding: 8px 0 !important;
    line-height: 1.5 !important;
    border-bottom: 1px solid #eee;
    word-break: break-word;
  }
  .product_info li:last-child { border-bottom: 0; }
  .page-btn, .btn-info, .btn.btn-info {
    display: block !important;
    width: 100% !important;
    padding: 12px !important;
    font-size: 14px !important;
    text-align: center !important;
  }
  .product_con {
    padding-top: 16px !important;
    overflow-x: auto;
  }
  .product_con img,
  .product_con table,
  .product_con video,
  .product_con iframe {
    max-width: 100% !important;
    height: auto !important;
  }
  .product_con table { display: block; overflow-x: auto; }

  /* ── Prev/Next bar on detail pages ── */
  .point { padding: 12px 0 !important; border: 0 !important; }
  .point .to_prev, .point .to_next {
    display: block !important;
    float: none !important;
    width: 100% !important;
    padding: 6px 0 !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    word-break: break-word;
  }

  /* ── Dead leftover popup from legacy JS — guarantee hidden ── */
  #popWin { display: none !important; }

  /* ── Pagination ── */
  .page {
    text-align: center !important;
    padding: 18px 0 !important;
  }
  .page a, .page span, .page b, .pagelist a, .pagelist span {
    font-size: 13px !important;
    padding: 8px 10px !important;
    min-width: 36px;
    display: inline-block;
  }

  /* ── Guestbook / form inputs ── */
  .guestbook_box input[type="text"],
  .guestbook_box input[type="email"],
  .guestbook_box input[type="tel"],
  .guestbook_box textarea,
  input.form-control,
  textarea.form-control {
    width: 100% !important;
    font-size: 14px !important;
    box-sizing: border-box;
  }
  .guestbook_box .btn,
  .guestbook_box button[type="submit"] {
    width: 100% !important;
    padding: 12px !important;
  }

  /* ── Tighten the page banner on phones (partial already handles 640px) ── */
  .kp-page-banner {
    min-height: 240px !important;
    margin-top: 64px !important;
  }
  .kp-page-banner h1 { font-size: 26px !important; }
  .kp-page-banner-container { width: calc(100% - 24px) !important; }

  /* ── Any freeform content: keep media within the viewport ── */
  .content img,
  .article-content img,
  .list_box img,
  .view_box img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* ── Stop horizontal scroll on body only (avoid breaking sticky header) ── */
  body { overflow-x: hidden; }
}
