/**
 * Tìm kiếm site — card dropdown header + trang /tim-kiem
 */

/* —— Header: nút icon + wrapper —— */
.header-search {
  position: relative;
  flex: 0 0 auto;
}

.header-btn--search {
  width: 40px;
  min-width: 40px;
  padding: 0;
  font-size: 17px;
  color: var(--sunny-dark);
}

.header-btn--search.is-open {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #ff9324 0%, #e95d00 100%);
  box-shadow: 0 6px 16px rgba(233, 93, 0, 0.28);
}

.header-btn--search i {
  line-height: 1;
}

/* —— Card dropdown dưới icon —— */
.site-search-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  width: min(400px, calc(100vw - 32px));
  pointer-events: none;
}

.site-search-panel:not([hidden]) {
  pointer-events: auto;
}

.site-search-panel__dialog {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(255, 116, 24, 0.18);
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 116, 24, 0.08) 0%, transparent 46%),
    linear-gradient(165deg, #fffdfb 0%, #fff 58%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 16px 40px rgba(20, 17, 16, 0.16);
  transform: translateY(-8px) scale(0.98);
  opacity: 0;
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.18s ease;
}

.site-search-panel__dialog::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 14px;
  width: 14px;
  height: 14px;
  background: #fffdfb;
  border-top: 1px solid rgba(255, 116, 24, 0.18);
  border-left: 1px solid rgba(255, 116, 24, 0.18);
  transform: rotate(45deg);
  box-shadow: -2px -2px 6px rgba(20, 17, 16, 0.04);
}

.site-search-panel:not([hidden]) .site-search-panel__dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.site-search-panel__inner {
  position: relative;
  z-index: 1;
  padding: 16px 16px 14px;
}

.site-search-panel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.site-search-panel__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #141110;
  letter-spacing: -0.01em;
}

.site-search-panel__close {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 116, 24, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #4a4441;
  cursor: pointer;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.site-search-panel__close:hover {
  color: var(--sunny-dark);
  border-color: rgba(255, 116, 24, 0.35);
  background: #fff4eb;
}

.site-search-panel__field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 12px;
  border: 1px solid rgba(255, 116, 24, 0.22);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(255, 116, 24, 0.08);
}

.site-search-panel__field-icon {
  flex: 0 0 auto;
  color: var(--sunny);
  font-size: 16px;
}

.site-search-panel__input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #141110;
  outline: none;
}

.site-search-panel__input::placeholder {
  color: #8a827e;
}

.site-search-panel__submit {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff8a15, #ff5d00);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 93, 0, 0.24);
  transition: filter 0.18s ease, transform 0.18s ease;
}

.site-search-panel__submit:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.site-search-panel__hint {
  margin: 8px 2px 0;
  color: #686d73;
  font-size: 12px;
}

.site-search-panel__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0e4dc;
}

.site-search-panel__tags-label {
  color: #686d73;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.site-search-panel__tag {
  display: inline-flex;
  padding: 5px 10px;
  border: 1px solid rgba(255, 116, 24, 0.2);
  border-radius: 999px;
  background: rgba(255, 244, 235, 0.9);
  color: #b84a00 !important;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none !important;
  transition:
    color 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.site-search-panel__tag:hover {
  color: #fff !important;
  background: linear-gradient(135deg, #ff8a15, #ff5d00);
  border-color: transparent;
}

/* —— Trang kết quả —— */
.site-search-hero.nh-hero {
  padding-bottom: clamp(28px, 4vw, 44px);
}

.site-search-hero__main {
  max-width: 720px;
}

.site-search-hero__title {
  margin: 0 0 10px;
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.022em;
  color: #07070a;
}

.site-search-hero__title span {
  color: var(--sunny-dark);
}

.site-search-hero__lead {
  margin: 0 0 22px;
  color: #4a4441;
  font-size: clamp(14px, 1.05vw, 16px);
  line-height: 1.6;
}

.site-search-hero__form {
  margin-bottom: 14px;
}

.site-search-hero__field {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid rgba(255, 116, 24, 0.24);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(255, 116, 24, 0.1);
  overflow: hidden;
}

.site-search-hero__icon {
  display: inline-grid;
  place-items: center;
  width: 52px;
  flex: 0 0 52px;
  color: var(--sunny);
  font-size: 20px;
  background: rgba(255, 244, 235, 0.85);
}

.site-search-hero__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 14px 12px;
  border: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 500;
  color: #141110;
  outline: none;
}

.site-search-hero__submit {
  flex: 0 0 auto;
  padding: 0 22px;
  border: 0;
  background: linear-gradient(135deg, #ff8a15, #ff5d00);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.18s ease;
}

.site-search-hero__submit:hover {
  filter: brightness(1.05);
}

.site-search-hero__meta {
  margin: 0;
  color: #4a4441;
  font-size: 14px;
}

.site-search-hero__meta strong {
  color: var(--sunny-dark);
}

.site-search-hero__meta--warn {
  color: #b84a00;
}

.site-search-section.nh-feed {
  padding-top: 0;
}

.site-search-section--pages {
  padding-bottom: 0;
}

.site-search-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: clamp(18px, 2.5vw, 26px);
  padding-bottom: 14px;
  border-bottom: 1px solid #f0e4dc;
}

.site-search-section__title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 700;
  color: #141110;
}

.site-search-section__title i {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  font-size: 16px;
  color: #fff;
  background: linear-gradient(135deg, #ff8a15, #ff5d00);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(255, 93, 0, 0.24);
}

.site-search-section__count {
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff4eb;
  border: 1px solid rgba(255, 116, 24, 0.2);
  color: #b84a00;
  font-size: 12px;
  font-weight: 700;
}

.site-search-pages {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.site-search-page-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid #f0e0d6;
  border-radius: 16px;
  background: linear-gradient(165deg, #fffaf6 0%, #fff 48%);
  text-decoration: none !important;
  box-shadow: 0 8px 22px rgba(45, 31, 25, 0.05);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.site-search-page-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 116, 24, 0.28);
  box-shadow: 0 14px 32px rgba(255, 116, 24, 0.1);
}

.site-search-page-card__icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 10px;
  color: var(--sunny-dark);
  background: rgba(255, 116, 24, 0.1);
  font-size: 16px;
}

.site-search-page-card__main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.site-search-page-card__title {
  color: #141110;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.site-search-page-card__desc {
  color: #686d73;
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.site-search-pager-meta {
  margin: 24px 0 10px;
  color: #686d73;
  font-size: 13px;
  text-align: center;
}

.site-search-empty__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(48px, 8vw, 72px) 24px;
  border: 1px dashed #f0d8cc;
  border-radius: 22px;
  background: linear-gradient(180deg, #fffaf6 0%, #fff 100%);
}

.site-search-empty__icon {
  display: inline-grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin-bottom: 16px;
  border-radius: 50%;
  color: var(--sunny);
  font-size: 30px;
  background: rgba(255, 116, 24, 0.1);
  border: 1px solid rgba(255, 116, 24, 0.18);
}

.site-search-empty__cta {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  background: linear-gradient(135deg, #ff8a15, #ff5d00);
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(255, 93, 0, 0.24);
}

@media (max-width: 991.98px) {
  .header-search {
    width: 100%;
  }

  .header-btn--search {
    width: 100%;
  }

  .site-search-panel {
    left: 0;
    right: 0;
    width: 100%;
  }

  .site-search-panel__dialog::before {
    right: auto;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
  }

  .site-search-panel__field {
    flex-wrap: wrap;
    border-radius: 14px;
    padding: 10px;
  }

  .site-search-panel__submit {
    width: 100%;
    margin-top: 4px;
  }
}

@media (max-width: 767.98px) {
  .site-search-hero__field {
    flex-direction: column;
  }

  .site-search-hero__icon {
    width: 100%;
    height: 44px;
  }

  .site-search-hero__submit {
    width: 100%;
    padding: 12px;
  }

  .site-search-pages {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-search-panel__dialog,
  .site-search-page-card,
  .site-search-panel__submit {
    transition: none;
  }
}
