/**
 * Navigation Search Button & Dropdown
 * Hiển thị nút icon tìm kiếm trên thanh menu #access
 */

/* Cho phép #access chứa menu bên trái và nút search bên phải */
#access {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  position: relative !important;
  z-index: 1000 !important;
  overflow: visible !important;
  padding-right: 10px;
  box-sizing: border-box;
}

#access > div.menu,
#access > div[class*="menu-"] {
  flex: 1 1 auto;
  min-width: 0;
}

#access ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

/* Container chứa icon tìm kiếm */
.nav-search-container {
  position: relative;
  margin-left: auto;
  padding: 0 4px 0 10px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  height: 48px;
  z-index: 1002;
}

/* Nút icon & text tìm kiếm màu xanh / trắng theo mockup */
.nav-search-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  outline: none;
}

.nav-search-btn:hover,
.nav-search-container.is-active .nav-search-btn {
  background: #ffffff;
  color: #008751;
  border-color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-search-btn svg {
  display: block;
  flex-shrink: 0;
}

.nav-search-btn-text {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

/* Khung form tìm kiếm dropdown mượt mà */
.nav-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 4px;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: #ffffff;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10005;
}

.nav-search-container.is-active .nav-search-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Mũi tên nhọn chỉ lên nút search */
.nav-search-dropdown::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 16px;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-left: 1px solid #e2e8f0;
  border-top: 1px solid #e2e8f0;
  transform: rotate(45deg);
}

/* Form & Input */
.nav-search-form {
  margin: 0;
  padding: 0;
  width: 100%;
}

.nav-search-input-wrap {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 2px 4px 2px 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  box-sizing: border-box;
}

.nav-search-input-wrap:focus-within {
  border-color: #008751;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 135, 81, 0.18);
}

.nav-search-input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  padding: 8px 6px !important;
  font-size: 14px !important;
  color: #1e293b !important;
  outline: none !important;
  box-shadow: none !important;
  width: 100% !important;
  height: 38px !important;
  margin: 0 !important;
  line-height: normal !important;
}

.nav-search-input::placeholder {
  color: #94a3b8;
  font-size: 13.5px;
}

/* Nút Submit Tìm kiếm */
.nav-search-submit {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #008751;
  border: none;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.2s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.nav-search-submit:hover {
  background: #047857;
  transform: scale(1.04);
}

/* Responsive */
@media (max-width: 768px) {
  .nav-search-dropdown {
    width: 280px;
    right: 0;
  }
}
