.rs-header-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.rs-header-search-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: var(--dark-color);
  transition: all 0.25s ease;
  position: relative;
}

.rs-header-search-icon:hover,
.rs-header-search-icon:focus-visible {
  color: var(--primary-color);
  background: rgba(0, 86, 137, 0.08);
}

.rs-header-search-icon i {
  font-size: 22px;
  line-height: 1;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.rs-header-search-icon .has-close {
  position: absolute;
  opacity: 0;
  visibility: hidden;
  transform: rotate(-90deg) scale(0.7);
}

.rs-header-search-icon.icon-close .has-search {
  opacity: 0;
  visibility: hidden;
}

.rs-header-search-icon.icon-close .has-close {
  opacity: 1;
  visibility: visible;
  transform: rotate(0) scale(1);
  color: var(--primary-color);
}

.rs-header-search-inner.header-search-form {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 330px;
  background: #ffffff;
  padding: 10px;
  border-radius: 12px;
  box-shadow: 0 14px 35px rgba(0, 32, 74, 0.14);
  border: 1px solid rgba(0, 86, 137, 0.12);
  z-index: 99999;
}

[dir="rtl"] .rs-header-search-inner.header-search-form {
  right: auto;
  left: 0;
}

/* 2. Search Inputs & Buttons (Shared across Header, Offcanvas & Search Page) */
.rs-header-search {
  position: relative;
  width: 100%;
}

.rs-header-search input.header-search-input,
.search-page-box input {
  width: 100%;
  height: 48px;
  padding: 0 48px 0 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: #f8fafc;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

[dir="rtl"] .rs-header-search input.header-search-input,
[dir="rtl"] .search-page-box input {
  padding: 0 16px 0 48px;
}

.rs-header-search input:focus,
.search-page-box input:focus {
  background: #ffffff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 86, 137, 0.15);
}

.rs-header-search button,
.search-page-box button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: none;
  background: var(--primary-color);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

[dir="rtl"] .rs-header-search button,
[dir="rtl"] .search-page-box button {
  right: auto;
  left: 6px;
}

.rs-header-search button:hover,
.search-page-box button:hover {
  background: var(--secondary-color);
  transform: translateY(-50%) scale(1.05);
}

.search-field-error {
  box-sizing: border-box;
  width: 100%;
  font-size: 13.5px;
  font-weight: 500;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 9px 14px;
  margin-top: 8px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: searchShake 0.3s ease;
}

input.is-invalid {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
  animation: searchShake 0.3s ease;
}

.search-field-error.search-shake-active {
  animation: searchShake 0.3s ease;
}

@keyframes searchShake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-4px);
  }

  75% {
    transform: translateX(4px);
  }
}

.search-autocomplete-dropdown {
  margin-top: 8px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.search-suggest-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  text-decoration: none;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}

.search-suggest-item:hover,
.search-suggest-item.active-suggest {
  background: #f0f7fc;
  text-decoration: none;
}

.search-suggest-thumb {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  background: #f8fafc;
  border: 1px solid #eef2f6;
  flex-shrink: 0;
}

.search-suggest-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.search-suggest-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.search-suggest-title mark {
  background: #fef08a;
  color: #1e293b;
  padding: 0 2px;
  border-radius: 2px;
}

.search-suggest-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #0284c7;
  letter-spacing: 0.5px;
}

.search-suggest-status {
  padding: 12px;
  text-align: center;
  font-size: 12.5px;
  color: #64748b;
  font-style: italic;
}

.search-view-all-btn {
  display: block;
  text-align: center;
  padding: 9px;
  background: #f8fafc;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 12.5px;
  border-top: 1px solid #e2e8f0;
  text-decoration: none;
}

.search-view-all-btn:hover {
  background: var(--primary-color);
  color: #ffffff;
  text-decoration: none;
}

/* 5. Search Results Page & Responsive Components */
.search-page-form {
  position: relative;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

.search-page-box {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.search-page-form .search-field-error,
.search-page-box ~ .search-field-error,
.search-results-page .header-search-form .search-field-error {
  max-width: 680px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  border-radius: 10px;
  box-sizing: border-box;
}

.search-page-form .search-autocomplete-dropdown,
.search-page-box ~ .search-autocomplete-dropdown,
.search-results-page .header-search-form .search-autocomplete-dropdown {
  max-width: 680px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.search-page-empty-msg {
  max-width: 680px;
  width: 100%;
}

.search-page-box input {
  height: 52px;
  font-size: 15px;
  border-radius: 10px;
}

.search-page-box button {
  width: 40px;
  height: 40px;
  font-size: 18px;
}

.search-filters-wrap {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.search-filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  text-decoration: none;
  transition: all 0.2s ease;
}

.search-filter-pill:hover,
.search-filter-pill.active {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
  text-decoration: none;
}

.search-result-card {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #eef2f6;
  background: #ffffff;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.search-result-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.search-result-card .rs-blog-thumb {
  position: relative;
  overflow: hidden;
  background: #f8fafc;
}

.search-result-card .rs-blog-thumb img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.search-result-card:hover .rs-blog-thumb img {
  transform: scale(1.05);
}

/* 6. Mobile Responsiveness */
@media (max-width: 767px) {
  .rs-header-search-inner.header-search-form {
    width: min(calc(100vw - 30px), 300px);
    right: -10px;
  }

  [dir="rtl"] .rs-header-search-inner.header-search-form {
    right: auto;
    left: -10px;
  }

  .search-page-box input {
    height: 46px;
    font-size: 14px;
  }

  .search-page-box button {
    width: 34px;
    height: 34px;
  }

  .search-filter-pill {
    padding: 6px 14px;
    font-size: 12.5px;
  }

  .search-result-card .rs-blog-thumb img {
    height: 185px;
  }
}

/* =========================================================
   HEADER SEARCH & LIVE AUTOCOMPLETE (NO SCROLL)
   ========================================================= */
.rs-header-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.rs-header-search-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: var(--dark-color);
  transition: all 0.25s ease;
  position: relative;
}

.rs-header-search-icon:hover,
.rs-header-search-icon:focus-visible {
  color: var(--primary-color);
  background: rgba(0, 86, 137, 0.08);
}

.rs-header-search-icon i {
  font-size: 22px;
  line-height: 1;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.rs-header-search-icon .has-close {
  position: absolute;
  opacity: 0;
  visibility: hidden;
  transform: rotate(-90deg) scale(0.7);
}

.rs-header-search-icon.icon-close .has-search {
  opacity: 0;
  visibility: hidden;
}

.rs-header-search-icon.icon-close .has-close {
  opacity: 1;
  visibility: visible;
  transform: rotate(0) scale(1);
  color: var(--primary-color);
}

.rs-header-search-inner.header-search-form {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 330px;
  background: #ffffff;
  padding: 10px;
  border-radius: 12px;
  box-shadow: 0 14px 35px rgba(0, 32, 74, 0.14);
  border: 1px solid rgba(0, 86, 137, 0.12);
  z-index: 99999;
}

[dir="rtl"] .rs-header-search-inner.header-search-form {
  right: auto;
  left: 0;
}

.rs-header-search {
  position: relative;
  width: 100%;
}

.rs-header-search input.header-search-input {
  width: 100%;
  height: 48px;
  padding: 0 48px 0 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: #f8fafc;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

[dir="rtl"] .rs-header-search input.header-search-input {
  padding: 0 16px 0 48px;
}

.rs-header-search input.header-search-input:focus {
  background: #ffffff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 86, 137, 0.15);
}

.rs-header-search button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: none;
  background: var(--primary-color);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

[dir="rtl"] .rs-header-search button {
  right: auto;
  left: 6px;
}

.rs-header-search button:hover {
  background: var(--secondary-color);
  transform: translateY(-50%) scale(1.05);
}

/* Autocomplete Live Suggestions Dropdown (No Scroll) */
.search-autocomplete-dropdown {
  margin-top: 8px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.search-suggest-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  text-decoration: none;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}

.search-suggest-item:hover,
.search-suggest-item.active-suggest {
  background: #f0f7fc;
  text-decoration: none;
}

.search-suggest-thumb {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  background: #f8fafc;
  border: 1px solid #eef2f6;
  flex-shrink: 0;
}

.search-suggest-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.search-suggest-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.search-suggest-title mark {
  background: #fef08a;
  color: #1e293b;
  padding: 0 2px;
  border-radius: 2px;
}

.search-suggest-type {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #0284c7;
  letter-spacing: 0.5px;
}

.search-suggest-status {
  padding: 12px;
  text-align: center;
  font-size: 12.5px;
  color: #64748b;
  font-style: italic;
}

.search-view-all-btn {
  display: block;
  text-align: center;
  padding: 9px;
  background: #f8fafc;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 12.5px;
  border-top: 1px solid #e2e8f0;
  text-decoration: none;
}

.search-view-all-btn:hover {
  background: var(--primary-color);
  color: #ffffff;
  text-decoration: none;
}


@media (max-width: 767px) {
  .rs-header-search-inner.header-search-form {
    width: min(calc(100vw - 30px), 300px);
    right: -10px;
  }

  [dir="rtl"] .rs-header-search-inner.header-search-form {
    right: auto;
    left: -10px;
  }
}