/* 
BẢNG MÀU:
#0070D1 Xanh dương PS5 - nút bấm, link
#003791 Xanh dương đậm - hover nút bấm, link
#F5F5F5 Xám nhạt - nền bảng, khối phụ
#1F1F1F Xám đậm
#5F5F5F Xám cho footer, disclaimer
#000000 Chữ đen trên nền trắng, thanh điều hướng, footer
#FFFFFF Chữ trắng trên nền đen, nền chính
*/

* {
  box-sizing: border-box;
  /* Giúp tính toán kích thước phần tử dễ dàng hơn */
  margin: 0;
}

body {
  font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
  padding: 0;
  /* Xóa khoảng trắng mặc định của trình duyệt */
  background-color: #eee;
  /* Màu nền dự phòng nếu ảnh không tải được */
  /* Dùng linear-gradient để tạo lớp phủ màu xám mờ đè lên ảnh (làm dịu) */

  background-image:
    linear-gradient(rgba(238, 238, 238, 0.9), rgba(238, 238, 238, 0.9)),
    url("../img/bg-pattern2.jpg");
  background-repeat: repeat;

  /* Lặp lại ảnh theo cả chiều ngang và dọc */
  background-attachment: fixed;
  /* Giữ nền cố định khi cuộn trang */

  -webkit-font-smoothing: antialiased;
  /* Giúp chữ hiển thị sắc nét hơn trên màn hình Mac/iOS */
  -moz-osx-font-smoothing: grayscale;
  /* Font smoothing cho Firefox trên macOS */
  text-rendering: optimizeLegibility;
  /* Cải thiện rendering chữ trên Windows */
}

techtoys-header,
techtoys-footer {
  display: block;
}

techtoys-header {
  /* Ngoài cách này còn cách position:fixed với top: 0; và left: 0; */
  /* (xem video 158. Position Fixed trên Udemy WEB1014 & 159 Position Sticky */
  /* (https://fpl.udemy.com/course/in-depth-html-css-course-build-responsive-websites/learn/lecture/13720618#overview) */
  position: sticky;
  /* Giữ header cố định ở đầu trang khi cuộn xuống */
  top: 0;
  /* Dính vào vị trí trên cùng (0px từ đỉnh màn hình) */
  z-index: 999;
  /* Độ ưu tiên hiển thị cao để header luôn nằm trên các phần tử khác */
  /* 2 dòng dưới cho hiệu ứng blur và xuyên thấu nhẹ */
  background-color: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  /* width: 100%; */
  /* Chiếm toàn bộ chiều rộng màn hình */
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  /* Bóng đổ nhẹ bên dưới header tạo hiệu ứng nổi và phân tách với nội dung */
}

/* ------- FOOTER ------- */
techtoys-footer {
  background: #003791;
  border-top: 1px solid #ddd;
  padding: 24px 24px;
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 24px;
}

.footer-brand p {
  color: #fff;
  font-size: 12px;
  margin-top: 16px;
  line-height: 1.7;
  font-weight: 300;
}

.footer-logo {
  max-width: 120px;
  height: auto;
  margin-bottom: 16px;
}

.footer-logo-link {
  display: inline-block;
  text-decoration: none;
}

.footer-column h4 {
  font-size: 14px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
  color: #fff;
  font-family: "Goldman", "Helvetica Neue", Arial, sans-serif;
}

.footer-column ul {
  list-style: none;
  padding-left: 0;
  /* Xóa thụt lề mặc định của UL */
  margin-left: 0;
}

.footer-column li {
  margin-bottom: 6px;
}

.footer-column a {
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  transition: color 0.2s ease;
  font-weight: 300;
}

.footer-column a:hover {
  color: #007bff;
}

.footer-bottom {
  max-width: 1280px;
  margin: 20px auto 0;
  padding-top: 12px;
  border-top: 1px solid #ddd;
  text-align: center;
  color: #fff;
  font-size: 12px;
}

.footer-bottom p {
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: 300;
  line-height: 1.6;
}

/* ------- NÚT BẤM CHUNG ------- */
.button {
  background-color: #0070d1;
  color: #fff;
  border-radius: 20px;
  font-weight: bold;
  padding: 10px 24px;
}

.button:hover {
  background-color: #003791;
}

/* ------- CONTAINER CHÍNH ------- */
.container {
  /* Áp dụng "tỉ lệ vàng" (85.4%, 76.4%, 61.8%) */
  width: 100%;
  margin: 0 auto;
  /* Canh giữa trang, 0 là trên dưới, auto là trái phải */
  background-color: #fff;
}

/* ------- HEADER ------- */
.header {
  background-color: transparent;
  position: relative;
  /* Cần để đặt vị trí của các thành phần con một cách tuyệt đối */
}

.img-logo {
  width: 150px;
  /* Chiều rộng logo mặc định là cố định */
  max-width: 100%;
  /* Khi màn hình nhỏ hơn thì logo sẽ có kích thước nhỏ hơn */
  padding: 20px 25px;
  cursor: pointer;
  /* Đổi sprite của chuột khi hover vào nút */
}

.header-right {
  position: absolute;
  right: 25px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-item {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #1F1F1F;
  gap: 8px;
  transition: color 0.2s;
  cursor: pointer;
}

.header-item:hover {
  color: #0070d1;
}

.header-item:hover .header-icon {
  box-shadow: 0 0 5px #0070d1;
}

.header-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 50%;
  padding: 2px;
}

.header-text-col {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.text-top {
  font-size: 11px;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
}

.text-bottom {
  font-size: 13px;
  font-weight: bold;
  font-family: "Goldman", "Helvetica Neue", Arial, sans-serif;
}

/* ------- GOLDMAN FONT RENDERING FIX CHO WINDOWS (ĐỠ BỊ NHÒE, XẤU) ------- */
.footer-column h4,
.menu ul li a,
.product-name a,
.text-bottom,
.category,
.order-button a,
.product-price,
.discount-price,
.btn-search {
  -webkit-font-smoothing: subpixel-antialiased;
  /* Để Render tốt hơn trên windows với kết quả tốt hơn */

  text-rendering: optimizeLegibility;
  /* Tối ưu font rendering giữa các loại trình duyệt */

}

/* ------- MENU ĐIỀU HƯỚNG ------- */
.menu {
  min-height: 40px;
  /* Thay vì height cố định, dùng min-height để menu có thể mở rộng khi search box xuống dòng */
  border: 1px solid rgba(0, 55, 145, 0.9);
  background-color: rgba(0, 55, 145, 0.9);
  /* display: flex; là cách sắp xếp các phần tử con bên trong container theo hàng hoặc cột.
     Dễ dàng căn chỉnh theo chiều ngang (justify-content) và chiều dọc (align-items).
     Rất hữu ích để tạo bố cục linh hoạt mà không cần dùng float hay line-height. */
  display: flex;
  flex-wrap: wrap;
  /* Cho phép các phần tử con xuống dòng khi không đủ chỗ */
  align-items: center;
  /* Căn giữa dọc */
}

.menu ul {
  padding: 0;
  /* Xóa khoảng trong mặc định khoảng 40px bên trái của <ul> */
  display: flex;
  justify-content: flex-start;
  /* Căn trái toàn bộ menu */
}

.menu ul li {
  list-style: none;
  padding: 0 10px;
  white-space: nowrap;
  /* Ngăn chữ bị xuống dòng khi màn hình nhỏ */
  height: 40px;
  /* Chiều cao cố định bằng với menu */
  display: flex;
  align-items: center;
  /* Dùng flexbox để căn giữa theo chiều dọc */
}

.menu ul li:hover {
  background-color: #002288;
}

.menu ul li a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 12px;
  font-family: "Goldman", "Helvetica Neue", Arial, sans-serif;
}

.menu ul li a:hover {
  color: #fff;
  text-decoration: underline;
  cursor: pointer;
  /* Đổi sprite của chuột khi hover vào nút */
}

/* ------- BANNER ------- */
.img-banner {
  cursor: pointer;
  display: block; /* Loại bỏ khoảng trắng mặc định (inline spacing) dưới ảnh */
  width: 100%;
  height: auto;
  object-fit: cover;}

/* ------- DANH MỤC ------- */
.category {
  font-weight: 400;
  text-align: left;
  font-size: 16px;
  padding: 10px 15px;
  /* Hiệu ứng gradient cho 'category' */
  background: linear-gradient(to right, #003791, transparent);
  color: #fff;
  margin-top: 0;
  font-family: "Goldman", "Helvetica Neue", Arial, sans-serif;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  /* text-align: center; */
}

/* ------- SẢN PHẨM ------- */
.product {
  grid-template-columns: repeat(1, 1fr);
  display: grid;
  grid-gap: 3px;
  padding: 3px 6px;
  width: 88%;
  margin: 0 auto;
}

.text-bottom,
.text-top,
.header-text-col {
  display: none;
}

.header-item {
  padding: 0px 0px;
  margin: 0px 0px;
}

@media (min-width: 768px) {
  .img-logo{
    width: 200px;
  }
  .product {
    grid-template-columns: repeat(2, 1fr);
  }

  .text-bottom,
  .text-top,
  .header-text-col {
    display: block;
  }
}

@media (min-width: 1024px) {
  .img-logo{
    width: 250px;
  }
  .product {
    grid-template-columns: repeat(4, 1fr);
  }
}

.product-items {
  border: 1px solid #eee;
  text-align: center;
  margin: 5px 3px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-name {
  font-weight: bold;
  font-size: 12px;
  padding: 5px 0;
  min-height: 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.product-name a {
  text-decoration: none;
  color: #003791;
  font-family: "Goldman", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
}

.product-name a:hover {
  text-decoration: underline;
}

.product-items img:hover {
  box-shadow: 0 0 5px #0070d1;
}

.product-items a:has(.product-img) {
  display: block;
  line-height: 0;
  font-size: 0;
  text-align: center;
}

.product-img {
  width: 66%;
  height: auto;
  object-fit: contain;
  display: inline-block;
  margin-bottom: 10px;
}

.discount-price {
  color: crimson;
  font-size: 12px;
  font-family: "Goldman", "Helvetica Neue", Arial, sans-serif;
  text-decoration: line-through;
}

.product-price {
  font-weight: 400;
  color: #0070d1;
  font-size: 12px;
  font-family: "Goldman", "Helvetica Neue", Arial, sans-serif;
}

.order-button {
  background-color: #003791;
  border-radius: 3px;
  border: none;
  margin: 5px auto 15px;
  height: 25px;
  padding: 0 10px;
}

.order-button:hover {
  background-color: #0070d1;
  cursor: pointer;
}

.order-button a {
  text-decoration: none;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  font-family: "Goldman", "Helvetica Neue", Arial, sans-serif;
}

.order-button a:hover {
  text-decoration: underline;
}

/* ------- TIN TỨC ------- */
.title {
  font-weight: bold;
  padding: 10px;
  font-size: 14px;
}

.title a {
  color: #003791;
  text-decoration: none;
}

.title a:hover {
  text-decoration: underline;
}

.img-news {
  width: 300px;
  margin: 0 10px;
  float: left;
}

.img-news:hover {
  box-shadow: 0 0 5px #0070d1;
}

.news {
  border: 1px solid #eee;
  margin-bottom: 15px;
  padding: 15px 0 0 0;
  display: flow-root;
}

.intro {
  text-align: justify;
  /* Căn đều 2 bên lề văn bản */
  line-height: 25px;
  margin: 0 20px 20px;
  padding-bottom: 10px;
  font-size: 14px;
  font-weight: 500;
}

/* ------- FOOTER CŨ (dự phòng) ------- */
.footer {
  background-color: #003791;
  color: #fff;
  text-align: left;
  font-size: 11px;
  padding: 10px 20px;
}

.img-footer {
  width: 111px;
  /* Chiều rộng logo mặc định là cố định */
  max-width: 100%;
  /* Khi màn hình nhỏ hơn thì logo sẽ có kích thước nhỏ hơn */
  margin: 10px 0;
}

/* ------- TÌM KIẾM ------- */
/* Class cha của cả form-search và btn-search. Đẩy form tìm kiếm sang bên phải menu */
.search-container {
  margin-left: auto;
  /* Đẩy form sang phải khi đủ chỗ trên cùng 1 dòng */
  display: flex;
  /* Biến form thành flex container để căn chỉnh input/button */
  align-items: center;
  /* Căn giữa dọc cho search box và Search button */
  padding: 5px 25px 5px 15px;
  /* Khoảng cách đồng đều: trên phải dưới trái */
  min-height: 30px;
  /* Đảm bảo chiều cao tối thiểu đồng đều */
  flex-shrink: 1;
  /* Cho phép co lại khi không đủ chỗ */
  gap: 10px;
}

.form-search {
  /* margin-right: 5px; */
  /* Tạo khoảng cách nhỏ giữa ô input và nút tìm kiếm */
  max-width: 260px;
  flex: 0 1 260px;
  width: 100%;
  border: 0;
  border-radius: 3px;
  height: 25px;
  padding-left: 10px;
}

.btn-search {
  padding: 0 10px;
  height: 25px;
  background-color: #0070d1;
  color: #fff;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  font-family: "Goldman", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  transition: all 0.2s;
  font-size: 12px;
}

.btn-search:hover {
  /* background-color: #003791; */
  border-color: #fff;
}

/* ------- FORM LIÊN HỆ ------- */
.forms {
  float: left;
  width: 400px;
  margin: 15px 0 10px 25px;
  font-size: 11px;
}

sup {
  color: #c1080f;
}

.forms input {
  width: 330px;
  height: 30px;
  border: 1px solid #0070d1;
  border-radius: 6px;
}

.forms .input-submit,
.forms .input-reset {
  margin-top: 10px;
  background-color: #0070d1;
  border: none;
  color: #fff;
  width: 66px;
}

textarea {
  width: 330px;
  height: 100px;
  border: 1px solid #0070d1;
  font-weight: 500;
  border-radius: 6px;
}

.map {
  margin-top: 22px;
}

.address {
  color: #003791;
  margin: 50px 0 25px 25px;
  line-height: 15px;
  font-weight: 500;
  font-size: 11px;
}