/* =====================================================
   GiaoViệc 24h – Tối ưu giao diện điện thoại (≤ 640px)
   File này nạp SAU file CSS chính nên sẽ ghi đè trên mobile.
   Máy tính / tablet không bị ảnh hưởng.
   ===================================================== */

/* Nhảy tới #dat-lich, #dich-vu không bị header che */
#dat-lich, #dich-vu, #cach-dat, #tai-app, #tuyen-dung { scroll-margin-top: 72px; }

/* Thẻ tải app chỉ dùng trên điện thoại */
.m-app, .m-hours { display: none; }

/* ===== Fix input ngày/giờ trên iPhone (Safari iOS) – áp dụng mọi màn hình ===== */
.form input[type="date"],
.form input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  min-width: 0;             /* bỏ độ rộng tối thiểu của iOS → không tràn khung */
  max-width: 100%;
  box-sizing: border-box;
  text-align: left;
  background-color: #fff;
  color: inherit;
  line-height: normal;
}
/* Căn trái chữ ngày/giờ trên iOS */
.form input[type="date"]::-webkit-date-and-time-value,
.form input[type="time"]::-webkit-date-and-time-value {
  text-align: left;
  margin: 0;
}

@media (max-width: 640px) {

  /* ---------- Màn hình đầu (thiết kế lại) ----------
     Thứ tự trên điện thoại: Menu → Thẻ tải app → Tiêu đề → Giờ mở cửa → Bảng giá
     (thẻ tải app & giờ được đoạn script đưa vào trong khối nền xanh .intro) */
  .first { padding-bottom: 0 !important; min-height: 0 !important; }
  .first .intro {
    padding: 12px 16px 22px !important; margin: 0 !important;
    height: auto !important; min-height: 0 !important;
    position: relative; z-index: 1;
    /* Nền xanh riêng cho khối này → tự cao theo nội dung, không bị hụt nền */
    background: #1E5BB0 !important;
    /* Kéo nền xanh tràn ra hết 2 bên màn hình mà không làm lệch bố cục */
    box-shadow: 0 0 0 100vmax #1E5BB0;
    clip-path: inset(0 -100vmax);
  }
  .first .intro h1 { font-size: 21px; line-height: 1.35; margin: 18px 0 12px !important; }

  /* Cụm nút Gọi / Zalo / Tải app cũ: ẩn (Gọi & Zalo đã có ở thanh dưới cùng) */
  .first .intro-contact { display: none !important; }

  /* Thẻ tải app ngay dưới menu: kiểu kính mờ trên nền xanh */
  .m-app {
    display: flex !important; align-items: center; gap: 12px;
    width: 100%; box-sizing: border-box; margin: 0 !important; padding: 10px 12px;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 14px; text-decoration: none; color: #fff; box-shadow: none;
  }
  .m-app:active { background: rgba(255, 255, 255, .2); }
  .m-app-ico {
    flex: 0 0 40px; width: 40px; height: 40px; border-radius: 11px;
    display: grid; place-items: center; background: #f6c343; color: #1d2433;
  }
  .m-app-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .m-app-txt strong { font-size: 14.5px; line-height: 1.25; color: #fff; }
  .m-app-txt small {
    font-size: 12.5px; line-height: 1.3; color: rgba(255, 255, 255, .78);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .m-app-btn {
    flex: 0 0 auto; padding: 8px 16px; border-radius: 999px;
    background: #f6c343; color: #1d2433; font-size: 14px; font-weight: 700;
  }

  /* Giờ mở cửa: viên tròn nhỏ ngay dưới tiêu đề, trong nền xanh */
  .m-hours {
    display: inline-block !important; margin: 0 !important; padding: 6px 12px !important;
    border-radius: 999px; background: rgba(255, 255, 255, .14);
    font-size: 13px; font-weight: 600; color: #fff; text-align: left;
  }
  .m-hours::before { content: "🕘 "; }

  /* Bảng giá sát ngay dưới phần xanh */
  .first .board { margin-top: 16px !important; padding-top: 0 !important; gap: 12px; }

  /* ---------- Bảng giá: mỗi dịch vụ 1 hàng, giá căn phải, có mũi tên ---------- */
  .prices .panel-head { padding: 12px 14px; }
  .prices .panel-sub { font-size: 13px; }
  .plist { margin: 0; padding: 0; }
  .plist li { border-bottom: 1px solid #eef1f6; }
  .plist li:last-child { border-bottom: 0; }

  .prow {
    display: grid !important; grid-template-columns: 36px 1fr auto 10px !important;
    grid-template-areas: none !important; grid-template-rows: auto !important;
    align-items: center; gap: 10px;
    width: 100%; min-height: 56px; margin: 0; padding: 8px 14px;
    background: none; border: 0; border-radius: 0; box-shadow: none; text-align: left;
    -webkit-tap-highlight-color: transparent;
  }
  /* Bỏ vị trí ô lưới của CSS chính → icon, tên, giá, mũi tên nằm trên CÙNG một hàng */
  .prow > * { grid-area: auto !important; grid-row: 1 !important; align-self: center !important; }
  .prow-ico { grid-column: 1 !important; }
  .prow-main { grid-column: 2 !important; }
  .prow-price { grid-column: 3 !important; }
  .prow::after { grid-column: 4; grid-row: 1; }
  .prow:active { background: #f2f5fa; }
  .prow.is-on { background: #eef4ff; box-shadow: inset 3px 0 0 #1E5BB0; }

  .prow-ico { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; }
  .prow-ico svg { width: 20px; height: 20px; }

  .prow-main { min-width: 0; display: block; width: auto !important; flex: none !important; }
  .prow-price { width: auto !important; flex: none !important; margin: 0 !important; }
  .prow-name { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; }
  .prow-desc { display: none; }

  .prow-price { display: block; margin: 0; text-align: right; white-space: nowrap; font-size: 12px; line-height: 1.2; }
  .prow-price strong { font-size: 15px; }
  .prow-price em { display: block; max-width: 92px; white-space: normal; font-size: 12px; }

  .prow::after {
    content: ""; width: 7px; height: 7px; justify-self: end;
    border-top: 2px solid #9aa7bd; border-right: 2px solid #9aa7bd; transform: rotate(45deg);
  }

  .prices-note { padding: 12px 14px; font-size: 13px; }

  /* ---------- Form: 1 cột, ô to dễ bấm, không bị iPhone tự phóng to ---------- */
  .form .field-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  /* minmax(0,1fr) + min-width:0 → ô Giờ bắt đầu không lấn sang ô Số giờ */
  .form .field-row-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .form .field-row > .field { min-width: 0; }
  .form .field-row-3 .field:first-child { grid-column: 1 / -1; }   /* Ngày làm: cả hàng */

  .form input:not([type=checkbox]):not([type=radio]),
  .form select,
  .form textarea { font-size: 16px; min-height: 48px; width: 100%; max-width: 100%; box-sizing: border-box; }
  .form textarea { min-height: 76px; }
  .btn-lg { min-height: 52px; font-size: 17px; }

  /* Form ứng tuyển: lựa chọn dễ chạm */
  .checks .check, .seg-item { min-height: 44px; }

  /* ---------- Cách đặt: tiêu đề + nút xếp dọc ---------- */
  .how-head { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ===== Fix cứng ô ngày/giờ trên iPhone ===== */
input[type="date"],
input[type="time"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  text-align: left !important;
}
input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value {
  text-align: left !important;
  margin: 0 !important;
}
.field-row-3 {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 12px !important;
}
.field-row-3 > * { min-width: 0 !important; max-width: 100% !important; }
.field-row-3 > *:first-child { grid-column: 1 / -1 !important; }