/* ====== FORM SEARCH TRÊN HEADER ====== */
.mf-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mf-search input[type="search"] {
  width: 240px;
  padding: 0.45rem 0.6rem;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  outline: none;
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mf-search input[type="search"]:focus {
  border-color: #1f3353;
  box-shadow: 0 0 0 3px rgba(31, 51, 83, 0.15);
}

.mf-search button {
  padding: 0.45rem 0.8rem;
  border: 1px solid #1f3353;
  background-color: #1f3353;
  color: #fff;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
}

.mf-search button:hover {
  opacity: 0.95;
}

/* ====== DROPDOWN GỢI Ý ====== */
.mf-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1100;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-top: 0.35rem;
  max-height: 420px;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.mf-s-item {
  display: flex;
  gap: 0.6rem;
  padding: 0.55rem 0.6rem;
  text-decoration: none;
  color: #111;
  align-items: center;
  transition: background-color 0.15s;
}

.mf-s-item:hover {
  background: #f5f7fb;
}

.mf-s-item img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #eee;
  background: #fafafa;
}

.mf-s-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.2;
}

.mf-s-name {
  font-weight: 600;
  font-size: 0.92rem;
}

.mf-s-meta {
  font-size: 0.78rem;
  color: #6b7280;
  margin-top: 2px;
}

.mf-s-name mark {
  background: transparent;
  color: #d12f2f;
  font-weight: 700;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 992px) {
  .mf-search input[type="search"] {
    width: 180px;
  }
}

@media (max-width: 576px) {
  .mf-search input[type="search"] {
    width: 140px;
    font-size: 0.85rem;
  }

  .mf-search button {
    display: none;
  }
}

/* ====== GIÚP KHÔNG CHE MENU DROPDOWN ====== */
.mf-topmenu .mf-suggest {
  z-index: 2000;
}


/* xử lý phần bung thanh input */
.mf-search {
  position: relative;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

.mf-search input {
  width: 0;
  opacity: 0;
  padding: 5px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-size: 14px;
}

.mf-search.active input {
  width: 200px;
  opacity: 1;
  margin-right: 8px;
}

.mf-search button {
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 600;
  transition: none;
}




/* === Nút chữ Find khi mở rộng === */
.mf-search .text-btn {
  font-size: 14px;
  color: #114070;
  ;
  background: #fff;
  border: 1px solid #114070;
  border-radius: 6px;
  padding: 6px 12px;
}


/* Simple mobile search bar */
@media (max-width: 991.98px) {
  .container form[role="search"] {
    background: var(--bs-primary);
    border-radius: 999px;
    padding: 6px;
  }

  .container form[role="search"] .form-control {
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 14px;
  }

  .container form[role="search"] .form-control:focus {
    box-shadow: none;
  }

  .container form[role="search"] .btn {
    border-radius: 999px;
    font-size: 16px;
  }

  /* --- Fix mobile search full width --- */
  .mobile-search-wrapper {
    width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .mobile-search-wrapper form {
    background: var(--bs-primary);
    border-radius: 999px;
    padding: 6px 8px;
    margin: 0 10px;
    /* bo nhẹ hai bên cho đẹp */
    display: flex;
    align-items: center;
  }

  .mobile-search-wrapper input.form-control {
    flex: 1;
    border: none;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 14px;
    color: #333;
  }

  .mobile-search-wrapper input.form-control:focus {
    box-shadow: none;
  }

  .mobile-search-wrapper .btn {
    border-radius: 999px;
    background: var(--bs-secondary);
    color: #fff;
    font-size: 16px;
    padding: 6px 12px;
    border: none;
  }

  .mobile-search-wrapper {
    margin-top: -8px !important;
  }

}

/* Ẩn ảnh sản phẩm trong carousel khi màn hình nhỏ hơn 992px */
@media (max-width: 991.98px) {
  #carouselId {
    display: none !important;
  }
}




/* thử nghiệm */
/* ========== STYLISH SEARCH ========== */
.stylish-search {
  position: relative;
  width: 50px;
  height: 50px;
  background: #fff;
  border-radius: 25px;
  border: 2px solid #1f3353;
  /* dùng màu thương hiệu */
  padding: 5px;
  transition: all 0.8s ease;
  overflow: hidden;
}

.stylish-search input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 42.5px;
  line-height: 30px;
  outline: none;
  border: none;
  display: none;
  font-size: 1em;
  border-radius: 20px;
  padding: 0 20px;
  color: #1f3353;
}

.stylish-search button {
  box-sizing: border-box;
  padding: 10px;
  width: 42.5px;
  height: 42.5px;
  position: absolute;
  top: 0;
  right: 0;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #1f3353;
  font-size: 1.2em;
  cursor: pointer;
  transition: all 0.8s ease;
}

/* Hover mở rộng ra */
.stylish-search:hover {
  width: 260px;
  cursor: pointer;
}

.stylish-search:hover input {
  display: block;
  padding-right: 45px;
}

.stylish-search:hover button i {
  background: #1f3353;
  color: #fff;
  border-radius: 50%;
  padding: 10px;
}

/* phần loading thanh search */
.mf-loading{
  display:flex; align-items:center; justify-content:center;
  padding:28px; color:#6b7280;
}
.mf-spinner{
  width:22px; height:22px; border:3px solid #e5e7eb; border-top-color:#1f3353;
  border-radius:50%; animation:mfspin 0.9s linear infinite;
}
@keyframes mfspin{ to{ transform:rotate(360deg); } }
[hidden] { display: none !important; }

/* hover card ở trang search → hiện bàn tay */
.mf-grid .mf-card { cursor: pointer; }
.mf-grid .mf-card a { cursor: pointer; } /* phòng khi có thẻ a bên trong */
