/*
Theme Name: Flatsome Child
Description: This is a child theme for Flatsome Theme
Author: UX Themes
Template: flatsome
Version: 3.0
*/

/*************** ADD CUSTOM CSS HERE.   ***************/

@media only screen and (max-width: 550px) {
  /*************** ADD MOBILE ONLY CSS HERE  ***************/

  /* Sắp xếp lại thứ tự các cột trong footer */
  #footer .row,
  #footer .row-small {
    display: flex !important;
    flex-direction: column !important;
  }

  #footer .row > .col:nth-child(1) .col-inner .img {
    margin: 0 auto;
  }

  /* Đặt lại thứ tự hiển thị */
  #footer .row > .col:nth-child(1) {
    order: 1 !important;
  } /* Công ty */
  #footer .row > .col:nth-child(4) {
    order: 2 !important;
  } /* Bản đồ */
  #footer .row > .col:nth-child(2) {
    order: 3 !important;
  } /* VP HCM */
  #footer .row > .col:nth-child(3) {
    order: 4 !important;
  } /* VP Đắk Lắk */

  /* Reset lại vị trí tuyệt đối của bản đồ trên mobile */
  #footer .col-footer-image-position .col-inner {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 1 !important;
    margin-top: 20px !important;
    margin-bottom: 20px !important;
  }

  #footer .col-footer-image-position img {
    width: 100% !important;
    height: auto !important;
  }
}

/* Fix Section Thành tựu: Tràn cột màu xanh ra mép phải màn hình */
section:has(.wpcf7) .row {
  max-width: 100% !important;
  width: 100% !important;
}

/* Loại bỏ giới hạn chiều rộng của container nếu Flatsome tự động bọc row */
section:has(.wpcf7) .container {
  max-width: 100% !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Căn lề trái cho cột chứa Form để thẳng hàng với container chung (1350px) */
section:has(.wpcf7) .row > .col:first-child {
  padding-left: calc((100% - 1350px) / 2 + 15px) !important;
}

/* Đảm bảo cột bên phải (màu xanh) sát mép phải và nội dung căn giữa dọc */
section:has(.wpcf7) .row > .col:last-child {
  padding-right: 0 !important;
}

section:has(.wpcf7) .row > .col:last-child .col-inner {
  margin-right: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  min-height: 480px !important;
}

/* Tăng khoảng cách cho màn hình Ultra-wide >= 1530px để khớp với ảnh mẫu */
@media (min-width: 1530px) {
  section:has(.wpcf7) .row > .col:last-child .col-inner {
    padding-left: 15px !important;
  }
}

@media (min-width: 1370px) {
  .px-desktop .col-inner {
    padding: 20px !important;
  }
}

@media (min-width: 1360px) {
  .px-desktop .col-inner {
    padding: 15px !important;
  }
}

/* Căn chỉnh text trong cột màu xanh (Desktop) */
section:has(.wpcf7) .row > .col:last-child h3,
section:has(.wpcf7) .row > .col:last-child .text-996360642 h3 {
  color: #ff9339 !important; /* Màu cam tiêu đề */
  font-size: 1.2rem !important;
  text-transform: uppercase !important;
  margin-bottom: 15px !important;
  letter-spacing: 1px !important;
}

section:has(.wpcf7) .row > .col:last-child p,
section:has(.wpcf7) .row > .col:last-child .text-1060380150 p {
  color: #ffffff !important;
  font-size: 2.2rem !important;
  line-height: 1.3 !important;
  font-weight: 700 !important;
  margin-bottom: 0 !important;
}

.nav-spacing-medium > li {
  margin: 0 18px;
}

.header-main .nav > li > a {
  font-size: 18px;
}

/* Responsive cho màn hình nhỏ hơn container */
@media (max-width: 1350px) {
  section:has(.wpcf7) .row > .col:first-child {
    padding-left: 15px !important;
  }

  .header-main .nav > li > a {
    font-size: 18px;
  }
  .nav-spacing-medium > li {
    margin: 0 18px;
  }
}

@media (max-width: 1300px) {
  .nav-spacing-medium > li {
    margin: 0 16px;
  }
}

@media (max-width: 1250px) {
  .nav-spacing-medium > li {
    margin: 0 14px;
  }
}

@media (max-width: 1200px) {
  .header-main .nav > li > a {
    font-size: 16px;
  }
}

@media (max-width: 1150px) {
  .nav-spacing-medium > li {
    margin: 0 12px;
  }
}

@media (max-width: 1100px) {
  .header-main .nav > li > a {
    font-size: 14px;
  }

  .nav-spacing-medium > li {
    margin: 0 9px;
  }
}

@media (max-width: 1024px) {
  .header-main .nav > li > a {
    font-size: 14px;
  }
}

@media (max-width: 850px) {
  section:has(.wpcf7) .row > .col:first-child {
    padding-left: 15px !important;
  }
}

@media (max-width: 550px) {
  section:has(.wpcf7) .row > .col.p-0 {
    padding: 0px !important;
  }
}

/* Đưa mục "TÌM HIỂU THÊM" lên trên form trên mobile/tablet */
@media (max-width: 850px) {
  section:has(.wpcf7) {
    background-color: #008037 !important; /* Đồng bộ nền toàn section sang màu xanh */
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  section:has(.wpcf7) .row {
    display: flex !important;
    flex-direction: column-reverse !important;
    max-width: 100% !important;
  }

  section:has(.wpcf7) .row > .col:last-child {
    padding: 0 !important;
  }

  section:has(.wpcf7) .row > .col:last-child .col-inner {
    padding: 30px 20px 0px 20px !important;
  }

  /* Styling cho text trên mobile */
  section:has(.wpcf7) .row > .col:last-child h2,
  section:has(.wpcf7) .row > .col:last-child h3 {
    color: #ff9339 !important;
    font-size: 1.1rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin-bottom: 15px !important;
    text-align: center !important;
  }

  section:has(.wpcf7) .row > .col:last-child p {
    font-size: 1.8rem !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin-bottom: 0 !important;
    text-align: center !important;
  }

  section:has(.wpcf7) .row > .col:last-child .col-inner {
    min-height: auto !important;
  }

  section:has(.wpcf7) .row > .col:first-child {
    padding: 0px 20px 30px 20px !important;
  }

  section:has(.wpcf7) .row > .col:first-child .col-inner {
    padding-top: 0px !important;
  }

  /* Căn giữa nút Gửi trên mobile */
  section:has(.wpcf7) .wpcf7-form p:has(.wpcf7-submit) {
    text-align: center !important;
  }

  section:has(.wpcf7) .wpcf7-submit {
    display: table !important;
    margin: 0px auto 0 auto !important;
  }

  section:has(.wpcf7) .wpcf7-form-control-wrap {
    margin-bottom: 12px !important;
  }

  section:has(.wpcf7) .wpcf7-form {
    margin-top: 0px !important;
  }
}

/* ==========================================================================
   CONTACT FORM 7 CUSTOM DESIGN
   ========================================================================== */

/* Căn lề và khoảng cách cho form */
.wpcf7-form {
  margin-top: 15px;
}

.wpcf7-form p {
  margin-bottom: 0px !important;
}

/* Tùy chỉnh các ô nhập liệu và wrapper */
.wpcf7-form-control-wrap {
  display: block !important;
  width: 100% !important;
  margin-bottom: 20px !important;
  position: relative;
}

.wpcf7-form-control.wpcf7-text,
.wpcf7-form-control.wpcf7-textarea,
.wpcf7-form-control.wpcf7-number,
.wpcf7-form-control.wpcf7-tel,
.wpcf7-form-control.wpcf7-email {
  background-color: #ffffff !important;
  border: 1px solid #e1e1e1 !important;
  border-radius: 2px !important;
  padding: 12px 20px !important;
  font-size: 16px !important;
  color: #333 !important;
  width: 100% !important;
  box-shadow: none !important;
  min-height: 50px;
  transition: all 0.3s ease;
  margin-bottom: 0 !important;
}

/* Tùy chỉnh thông báo lỗi (The field is required) */
.wpcf7-not-valid-tip {
  display: block !important;
  background: none !important;
  border: none !important;
  color: #e31a1a !important;
  font-size: 14px !important;
  font-weight: 500;
  margin-top: 8px !important;
  margin-bottom: 10px !important;
  padding: 0 !important;
  position: static !important;
}

/* Ẩn mũi tên mặc định của theme cho thông báo lỗi */
.wpcf7-not-valid-tip::before,
.wpcf7-not-valid-tip::after {
  display: none !important;
}

/* Thông báo kết quả cuối form (Thành công/Thất bại) */
.wpcf7-response-output {
  margin: 10px 0 0 0 !important;
  padding: 12px 15px !important;
  font-size: 15px !important;
  border-radius: 5px !important;
  border: 2px solid #ff7e00 !important;
}

.wpcf7-form-control.wpcf7-textarea {
  min-height: 160px;
}

.wpcf7-form-control.wpcf7-text:focus,
.wpcf7-form-control.wpcf7-textarea:focus {
  background-color: #ffffff !important;
  border-color: #ff7e00 !important;
  outline: none !important;
}

/* Tùy chỉnh nút Gửi (Ghi đè mạnh mẽ theme Flatsome) */
form.wpcf7-form input.wpcf7-submit,
form.wpcf7-form .wpcf7-submit,
.wpcf7-form input[type="submit"] {
  background-color: #ff7e00 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 4px !important;
  padding: 10px 30px !important; /* Reset padding vì đã bỏ mũi tên CSS */
  font-weight: 700 !important;
  text-transform: none !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  display: inline-block !important;
  min-width: 120px;
  margin-top: 10px;
  box-shadow: none !important;
  height: auto !important;
  line-height: 1.5 !important;
  font-size: 16px !important;
  position: relative;
}

/* Sử dụng background image hoặc pseudo-element cho thẻ bọc nếu input không hỗ trợ ::after */
/* Lưu ý: Nếu Flatsome bọc input trong span.wpcf7-form-control-wrap, ta có thể dùng nó */
.wpcf7-submit-container {
  position: relative;
  display: inline-block;
}

/* Giải pháp thay thế: Nếu là thẻ input, ta thêm văn bản vào value trong admin hoặc dùng JS.
   Ở đây tôi sẽ thử dùng CSS background nếu là mũi tên đơn giản */
/* Loại bỏ icon mũi tên thừa vì text nút đã có */
form.wpcf7-form .wpcf7-submit {
  background-image: none !important;
}

form.wpcf7-form input.wpcf7-submit:hover,
.wpcf7-form input[type="submit"]:hover {
  background-color: #e67200 !important;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 126, 0, 0.4) !important;
}

/* Responsive */
@media (max-width: 550px) {
  .wpcf7-form-control.wpcf7-text,
  .wpcf7-form-control.wpcf7-textarea {
    padding: 12px 20px !important;
  }
}

/* Loại bỏ đường gạch đứng | giữa các mục menu trên header (Desktop) */
.nav-divided > li > a::after {
  display: none !important;
}

/* ==========================================================================
   TỐI ƯU HÓA RESPONSIVE MOBILE & TABLET (CÂN ĐỐI BỐ CỤC)
   ========================================================================== */
@media only screen and (max-width: 550px) {
  .psc-project-slider .psc-project-card {
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
  }

  .psc-project-slider .psc-project-content {
    padding: 15px 12px !important;
  }

  .psc-project-slider .psc-project-title {
    font-size: 16px !important;
    line-height: 1.3 !important;
    margin-bottom: 6px !important;
  }

  .psc-project-slider .psc-project-desc {
    font-size: 13px !important;
    line-height: 1.4 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}
