/* ==========================================================================
   Goreto Site Search
   Enqueued as assets/css/search-overlay.css
   ========================================================================== */

.header__search-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-width: 30px;
  min-height: 30px;
  margin-right: 6px;
  padding: 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--rr-heading-primary, #00043a);
  cursor: pointer;
  flex-shrink: 0;
  visibility: visible !important;
  transition: color 0.2s ease;
}

.header__main .header__right .header__action .header__search-toggle {
  display: inline-flex !important;
}

.header__main .header__right {
  flex-shrink: 0;
}

.header__main .header__right .header__action {
  flex-shrink: 0;
}

.header__hamburger {
  margin-left: 0;
}

@media (max-width: 575px) {
  .header__hamburger {
    margin-left: 20px;
  }
}

.header__search-toggle:hover,
.header__search-toggle:focus-visible {
  color: var(--rr-theme-primary, #c5151e);
  outline: none;
}

.header__search-toggle i,
.header__search-icon {
  display: block;
  width: 18px;
  height: 18px;
  font-size: 18px;
}

body.goreto-search-open {
  overflow: hidden;
}

.goreto-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 72px 24px 24px;
}

.goreto-search-overlay.is-open {
  display: flex;
}

.goreto-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(39 39 39 / 20%);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.goreto-search-panel {
  position: relative;
  width: min(680px, 100%);
  max-height: min(78vh, 720px);
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 60px rgba(0, 4, 58, 0.12), 0 2px 8px rgba(0, 4, 58, 0.06);
}

.goreto-search-panel-inner {
  display: flex;
  flex-direction: column;
  max-height: min(78vh, 720px);
}

.goreto-search-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
}

.goreto-search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 14px;
  border: 2px solid var(--rr-theme-primary, #c5151e);
  border-radius: 8px;
  background: var(--rr-common-white, #fff);
}

.goreto-search-input-icon {
  color: var(--rr-heading-primary, #00043a);
  font-size: 16px;
  flex-shrink: 0;
  opacity: 0.55;
}

.goreto-search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-family: var(--rr-ff-body);
  font-size: 16px;
  font-weight: var(--rr-fw-regular, 400);
  line-height: 1.4;
  color: var(--rr-heading-primary, #00043a);
  outline: none;
  appearance: none;
  border: none !important;
  margin: 0 !important;
}

.goreto-search-input::-webkit-search-cancel-button,
.goreto-search-input::-webkit-search-decoration,
.goreto-search-input::-ms-clear {
  display: none;
  appearance: none;
}

.goreto-search-input::placeholder {
  color: #9aa3ad;
}

.goreto-search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #c5cad0;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 0;
  transition: background-color 0.15s ease;
}

.goreto-search-clear[hidden] {
  display: none !important;
}

.goreto-search-clear:hover,
.goreto-search-clear:focus-visible {
  background: #aeb6bf;
  outline: none;
}

.goreto-search-clear-icon {
  display: block;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.goreto-search-clear i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
  font-size: 10px;
  line-height: 1;
}

.goreto-search-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--rr-heading-primary, #00043a);
  cursor: pointer;
  flex-shrink: 0;
  line-height: 0;
  opacity: 0.7;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.goreto-search-close:hover,
.goreto-search-close:focus-visible {
  opacity: 1;
  color: var(--rr-theme-primary, #c5151e);
  outline: none;
}

.goreto-search-close-icon {
  display: block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.goreto-search-close i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 22px;
  line-height: 1;
}

.goreto-search-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.goreto-search-status {
  padding: 0 20px 12px;
  font-size: 13px;
  color: #9aa3ad;
}

.goreto-search-status[hidden] {
  display: none !important;
}

.goreto-search-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.goreto-search-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(197, 21, 30, 0.2);
  border-top-color: var(--rr-theme-primary, #c5151e);
  border-radius: 50%;
  animation: goretoSearchSpin 0.7s linear infinite;
}

@keyframes goretoSearchSpin {
  to {
    transform: rotate(360deg);
  }
}

.goreto-search-results {
  flex: 1;
  overflow: auto;
  padding: 0 20px 8px;
}

.goreto-search-results[hidden],
.goreto-search-empty[hidden] {
  display: none !important;
}

.goreto-search-group {
  margin-bottom: 18px;
}

.goreto-search-group:last-child {
  margin-bottom: 0;
}

.goreto-search-group-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  font-family: var(--rr-ff-body);
  font-size: 11px;
  font-weight: var(--rr-fw-sbold, 600);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rr-heading-primary, #00043a);
  white-space: nowrap;
}

.goreto-search-group-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(0, 4, 58, 0.1);
}

.goreto-search-group-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.goreto-search-item-link {
  display: block;
  position: relative;
  padding: 14px 16px 14px 18px;
  border-radius: 6px;
  background: var(--rr-common-white, #fff);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0, 4, 58, 0.06);
  border: 1px solid rgba(0, 4, 58, 0.05);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.goreto-search-item-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: transparent;
  transition: background-color 0.15s ease;
}

.goreto-search-item-link:hover,
.goreto-search-item-link.is-active,
.goreto-search-item-link:focus-visible {
  border-color: rgba(197, 21, 30, 0.15);
  box-shadow: 0 2px 8px rgba(0, 4, 58, 0.08);
  outline: none;
}

.goreto-search-item-link:hover::before,
.goreto-search-item-link.is-active::before,
.goreto-search-item-link:focus-visible::before {
  background: var(--rr-theme-primary, #c5151e);
}

.goreto-search-item-title {
  display: block;
  font-family: var(--rr-ff-body, 'Plus Jakarta Sans', sans-serif);
  font-size: 17px;
  font-weight: var(--rr-fw-medium, 500);
  line-height: 1.5;
  color: var(--rr-heading-primary, #00043a);
}

.goreto-search-item-excerpt {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--rr-text-body, #00043a);
  opacity: 0.72;
}

.goreto-search-empty {
  padding: 32px 20px;
  font-size: 15px;
  color: #9aa3ad;
  text-align: center;
}

.goreto-search-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px 24px;
  padding: 14px 20px 16px;
  border-top: 1px solid rgba(0, 4, 58, 0.08);
  font-size: 12px;
  color: #9aa3ad;
}

.goreto-search-footer kbd {
  display: inline-block;
  min-width: 20px;
  padding: 2px 5px;
  margin-right: 2px;
  border: 1px solid #d5dbe0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.35;
  color: #6b7680;
  box-shadow: 0 1px 0 rgba(0, 4, 58, 0.04);
}

@media (max-width: 767px) {
  .goreto-search-overlay {
    padding: 56px 12px 12px;
  }

  .goreto-search-panel {
    border-radius: 12px;
  }

  .goreto-search-header {
    padding: 14px;
    gap: 10px;
  }

  .goreto-search-input-wrap {
    min-height: 46px;
    padding: 0 12px;
  }

  .goreto-search-input {
    font-size: 16px;
  }

  .goreto-search-results,
  .goreto-search-status,
  .goreto-search-empty {
    padding-left: 14px;
    padding-right: 14px;
  }

  .goreto-search-results {
    padding-left: 14px;
    padding-right: 14px;
  }

  .goreto-search-footer {
    display: none;
  }
}
