.mt-header-search {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Search icon in menu */

.mt-search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.mt-search-toggle:hover,
.mt-search-toggle:focus {
  background: rgba(255, 0, 0, 0.16);
  color: #ff1a1a;
}

.mt-search-icon {
  font-size: 26px;
  line-height: 1;
  transform: translateY(-1px);
}

/* Search overlay */

.mt-search-panel {
  position: fixed;
  left: 0;
  right: 0;
  top: 500px;
  z-index: 9999;
  display: none;
  padding: 18px 20px;
  background: rgba(0, 0, 0, 0.96);
  border-top: 1px solid rgba(255, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 0, 0, 0.35);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
}

.mt-search-panel.is-open {
  display: block;
}

.mt-search-inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
}

/* Search input */

.mt-search-input {
  width: 100%;
  height: 54px;
  padding: 0 58px 0 18px;
  border: 1px solid rgba(255, 0, 0, 0.45);
  border-radius: 4px;
  background: #080808;
  color: #ffffff;
  font-size: 18px;
  outline: none;
}

.mt-search-input:focus {
  border-color: #ff1a1a;
  box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.18);
}

.mt-search-input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

/* Close button */

.mt-search-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.mt-search-close:hover {
  color: #ff1a1a;
}

/* Search results */

.mt-header-search .mt-search-results {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-height: 480px;
  margin-top: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  border-radius: 4px;
  background: #101010;
}

.mt-header-search .mt-search-results .mt-search-result {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
  float: none !important;
  clear: both !important;
  padding: 15px 18px;
  color: #ffffff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease;
}

.mt-header-search .mt-search-results .mt-search-result:hover {
  background: rgba(255, 0, 0, 0.16);
}

.mt-header-search .mt-search-results .mt-search-result:last-child {
  border-bottom: 0;
}

.mt-header-search .mt-search-results .mt-search-result-title {
  display: block !important;
  width: 100% !important;
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mt-header-search .mt-search-results .mt-search-result-meta {
  display: block !important;
  width: 100% !important;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.03em;
}

/* No results message */

.mt-search-no-results {
  padding: 14px 16px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
}

/* Scrollbar */

.mt-header-search .mt-search-results::-webkit-scrollbar {
  width: 8px;
}

.mt-header-search .mt-search-results::-webkit-scrollbar-track {
  background: #080808;
}

.mt-header-search .mt-search-results::-webkit-scrollbar-thumb {
  background: #b00000;
  border-radius: 999px;
}

.mt-header-search .mt-search-results::-webkit-scrollbar-thumb:hover {
  background: #ff1a1a;
}

/* Mobile */

@media (max-width: 768px) {
  .mt-search-panel {
    top: 0;
    padding: 16px;
  }

  .mt-search-inner {
    max-width: 100%;
  }

  .mt-search-input {
    height: 50px;
    font-size: 16px;
  }

  .mt-header-search .mt-search-results {
    max-height: 70vh;
  }
}

/* Mobile and tablet menu adjustments */

@media (max-width: 1024px) {
  .mt-header-search {
    display: inline-flex;
    width: auto;
  }

  .mt-search-toggle {
    background: rgba(255, 0, 0, 0.12);
    color: #b00000;
  }

  .mt-search-toggle:hover,
  .mt-search-toggle:focus {
    background: rgba(255, 0, 0, 0.22);
    color: #ff0000;
  }

  .mt-search-icon {
    color: inherit;
  }

  .mt-search-panel {
    top: 72px;
    z-index: 999999;
    padding: 14px 16px;
  }

  .mt-search-inner {
    max-width: 100%;
  }

  .mt-search-input {
    height: 50px;
    font-size: 16px;
  }

  .mt-search-close {
    right: 10px;
  }

  .mt-header-search .mt-search-results {
    max-height: 70vh;
  }
}