/**
 * Bổ sung responsive — nạp SAU style.css và modern.css.
 *
 * Template gốc chỉ xử lý ở 991 / 767 / 500px và còn thiếu vài chỗ:
 *   - Cột 8/4 (Vị trí + 3 khối sản phẩm) không xếp dọc ở tablet.
 *   - Khối chữ giữ height:100vh khi đã xếp dọc -> khoảng trắng lớn.
 *   - Ô thông số vẫn 4 cột ở tablet (quá chật).
 *   - Form đăng ký bị .sm-hidden ẩn hẳn trên mobile nên nút "Đăng ký" không mở được.
 */

/* ------------------------------------------------------------------
   Tablet lớn (≤1199px)
   ------------------------------------------------------------------ */
@media (max-width: 1199px) {
  .row-banner-form {
    margin-right: 20px;
    padding: 30px 18px;
  }

  .row-banner-text {
    left: 40px;
  }

  .text-box {
    padding: 44px 34px;
  }
}

/* ------------------------------------------------------------------
   Tablet (≤991px)
   ------------------------------------------------------------------ */
@media (max-width: 991px) {
  /* Vị trí + 3 khối sản phẩm: xếp dọc thay vì 2 cột chật */
  .row-location .tcol-8,
  .row-location .tcol-4,
  .row-shophouse .tcol-8,
  .row-shophouse .tcol-4,
  .row-townhouse .tcol-8,
  .row-townhouse .tcol-4,
  .row-villas .tcol-8,
  .row-villas .tcol-4 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Khối chữ không còn ép cao 100vh khi đã nằm dưới slider */
  .row-location .text-box,
  .row-shophouse .text-box,
  .row-townhouse .text-box,
  .row-villas .text-box {
    height: auto !important;
    min-height: 0;
    padding: 34px 28px;
  }

  .row-location .text-box .inner,
  .row-shophouse .text-box .inner,
  .row-townhouse .text-box .inner,
  .row-villas .text-box .inner {
    overflow: visible;
  }

  /* Banner: thu form lại, chừa chỗ cho tiêu đề */
  .row-banner-form {
    width: 340px;
    margin-right: 16px;
    padding: 26px 16px;
    top: 100px;
    bottom: auto;
    max-height: none;
  }

  .row-banner-text {
    left: 30px;
    bottom: 40px;
    max-width: calc(100% - 380px);
  }

  .row-banner-text h2 {
    font-size: 38px;
  }

  .row-banner-text p {
    font-size: 24px;
  }

  /* Ô thông số: 2 cột thay vì 4 */
  .row-overview-acreage .tcol-md-3 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  /* Tiện ích: chồng dọc */
  .utilitie-list .tcol-4,
  .utilitie-list .tcol-8 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .utilitie-list .tcol-8 {
    margin-top: 26px;
  }

  /* Tab: cho phép xuống dòng */
  .ttabs .tab-nav {
    flex-wrap: wrap;
  }

  .children-tab-nav li {
    margin-bottom: 8px;
  }
}

/* ------------------------------------------------------------------
   Mobile (≤767px)
   ------------------------------------------------------------------ */
@media (max-width: 767px) {
  .row-banner-text {
    left: 0;
    right: 0;
    bottom: 110px;
    max-width: 100%;
    padding: 0 20px;
  }

  .row-banner-text h2 {
    font-size: 30px;
    text-shadow: 2px 2px #333;
  }

  .row-banner-text p {
    font-size: 19px;
  }

  .text-box,
  .row-location .text-box,
  .row-shophouse .text-box,
  .row-townhouse .text-box,
  .row-villas .text-box {
    padding: 28px 20px;
  }

  .row-overview-acreage .tcol-md-3 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  /* Ảnh không tràn ngang */
  .utilitie-map img,
  .image-zoom img,
  .location-img img,
  .children-img img,
  .single-item-slider .image img,
  .angent-list-slider img {
    max-width: 100%;
    height: auto;
  }

  .ttabs .tab-nav li {
    margin: 0 4px 10px;
  }

  .children-tab-nav {
    display: flex;
    flex-wrap: wrap;
  }

  .children-tab-nav li {
    margin: 0 6px 8px 0;
  }

  #footer .information .tcol-3,
  #footer .information .tcol-9 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Form đăng ký trên mobile.
     Template ẩn form bằng .sm-hidden nên bấm nút không mở được gì.
     -> Luôn mount form, biến thành tấm trượt từ dưới lên, mở bằng class
     .is-show (do main.js thêm khi bấm .form-btn-fixed). */
  .row-banner-form.sm-hidden {
    display: block !important;
  }

  .row-banner-form {
    position: fixed !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-height: 88vh;
    margin: 0 !important;
    padding: 24px 18px 28px !important;
    overflow-y: auto;
    border: 0;
    border-top: 2px solid rgba(201, 162, 39, .55);
    border-radius: 18px 18px 0 0;
    background: #0f1c2e !important;
    box-shadow: 0 -18px 50px rgba(0, 0, 0, .45);
    transform: translateY(105%) !important;
    -webkit-transform: translateY(105%) !important;
    opacity: 0;
    pointer-events: none;
    visibility: visible !important;
    z-index: 10050;
    transition: transform .28s ease, opacity .28s ease;
  }

  .row-banner-form.is-show {
    transform: translateY(0) !important;
    -webkit-transform: translateY(0) !important;
    opacity: 1;
    pointer-events: auto !important;
  }

  /* Nền mờ phía sau tấm trượt */
  body:has(.row-banner-form.is-show)::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(15, 28, 46, .58);
    z-index: 10040;
  }

  /* Nút đóng: góc phải trên */
  #fixed-form-cls {
    display: block;
    position: absolute !important;
    top: 12px !important;
    right: 14px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 3;
    padding: 6px;
    cursor: pointer;
  }

  #fixed-form-cls img {
    display: block;
    width: 22px;
    height: 22px;
    opacity: .9;
  }

  /* Bỏ mảng trang trí hình tam giác trên nút Đăng ký ở mobile */
  .row-banner-form .btn:after,
  .row-banner-form .btn:before {
    display: none !important;
  }
}

/* ------------------------------------------------------------------
   Mobile nhỏ (≤500px)
   ------------------------------------------------------------------ */
@media (max-width: 500px) {
  .row-overview-acreage .tcol-md-3 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .acreage-item {
    margin-bottom: 28px;
  }

  .acreage-item-numb {
    font-size: 38px;
  }

  .row-banner-text h2 {
    font-size: 26px;
  }

  .row-banner-text p {
    font-size: 17px;
  }

  .title-wrap .title {
    font-size: 22px !important;
  }

  .form-btn-fixed {
    font-size: 13px;
    padding: 10px 14px;
  }

  .row-banner-form.fixed-form {
    padding: 20px 14px 24px;
  }
}
