/* ═══════════════════════════════════════════════════════
   TOTO SMART SEARCH – CSS  (Quiet Edition)
   Palette: black #0a0a0a  ·  white #ffffff  ·  grays only
   Font:    GothamSSm (loaded by theme)
   ═══════════════════════════════════════════════════════ */

/* ── Overlay wrapper ── */
.toto-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
}

.toto-search-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

/* ── Backdrop — very soft, barely-there ── */
.toto-search-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, .38);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  cursor: pointer;
}

/* ── Panel ── */
.toto-search-overlay__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 620px;
  margin: 0 1.25rem;
  margin-top: 80px;
  background: #ffffff;
  border-radius: 0 0 .75rem .75rem;
  box-shadow:
    0 1px 3px rgba(0,0,0,.06),
    0 8px 32px rgba(0,0,0,.1),
    0 24px 64px rgba(0,0,0,.06);
  overflow: hidden;
  transform: translateY(-8px);
  transition: transform .35s cubic-bezier(.22,1,.36,1);
}

.toto-search-overlay.is-open .toto-search-overlay__panel {
  transform: translateY(0);
}

/* ── Header — black ── */
.toto-search-overlay__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.375rem;
  background: #0a0a0a;
  border-bottom: none;
}

.toto-search-overlay__title {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: #ffffff;
  font-family: 'GothamSSm', 'Helvetica Neue', Arial, sans-serif;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.toto-search-overlay__close {
  background: none;
  border: none;
  color: #606060;
  cursor: pointer;
  padding: .3rem;
  border-radius: .3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .2s;
  line-height: 1;
}

.toto-search-overlay__close:hover {
  color: #ffffff;
}

/* ── Input row ── */
.toto-search-overlay__input-wrap {
  display: flex;
  align-items: center;
  padding: .875rem 1.375rem;
  gap: .75rem;
  border-bottom: 1px solid #f0f0f0;
  background: #ffffff;
  transition: border-color .25s;
}

.toto-search-overlay__input-wrap:focus-within {
  border-bottom-color: #0a0a0a;
}

.toto-search-overlay__input-icon {
  color: #d0d0d0;
  flex-shrink: 0;
  transition: color .25s;
}

.toto-search-overlay__input-wrap:focus-within .toto-search-overlay__input-icon {
  color: #606060;
}

.toto-search-overlay__input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'GothamSSm', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: #0a0a0a;
  caret-color: #0a0a0a;
  letter-spacing: .01em;
}

.toto-search-overlay__input::placeholder {
  color: #c8c8c8;
  font-weight: 300;
}

.toto-search-overlay__input::-webkit-search-cancel-button,
.toto-search-overlay__input::-webkit-search-decoration {
  -webkit-appearance: none;
}

.toto-search-overlay__clear {
  background: none;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #c0c0c0;
  flex-shrink: 0;
  transition: color .2s;
}

.toto-search-overlay__clear:hover {
  color: #0a0a0a;
}

/* ── Spinner — understated ── */
.toto-search-overlay__spinner {
  flex-shrink: 0;
}

.toto-spin {
  width: 18px;
  height: 18px;
  border: 1.5px solid #e8e8e8;
  border-top-color: #606060;
  border-radius: 50%;
  animation: toto-spin .8s linear infinite;
}

@keyframes toto-spin {
  to { transform: rotate(360deg); }
}

/* ── Results container ── */
.toto-search-overlay__results {
  max-height: min(58vh, 460px);
  overflow-y: auto;
  padding: .375rem 0;
  scrollbar-width: thin;
  scrollbar-color: #ebebeb transparent;
}

.toto-search-overlay__results:empty { padding: 0; }

.toto-search-overlay__results::-webkit-scrollbar { width: 3px; }
.toto-search-overlay__results::-webkit-scrollbar-track { background: transparent; }
.toto-search-overlay__results::-webkit-scrollbar-thumb {
  background: #e8e8e8;
  border-radius: 2px;
}

/* ── Section label ── */
.toto-search-section-label {
  padding: .625rem 1.375rem .2rem;
  font-family: 'GothamSSm', sans-serif;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: #c8c8c8;
}

/* ── Single result item ── */
.toto-search-item {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .625rem 1.375rem;
  text-decoration: none;
  color: #0a0a0a;
  transition: background .18s;
  cursor: pointer;
  border-left: 2px solid transparent;
}

.toto-search-item:hover,
.toto-search-item.is-active {
  background: #f7f7f7;
  border-left-color: #0a0a0a;
}

/* Thumbnail */
.toto-search-item__thumb {
  width: 46px;
  height: 46px;
  border-radius: .3rem;
  overflow: hidden;
  flex-shrink: 0;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toto-search-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.toto-search-item__thumb-placeholder { color: #d0d0d0; }

/* Text block */
.toto-search-item__body {
  flex: 1;
  min-width: 0;
}

.toto-search-item__title {
  font-family: 'GothamSSm', 'Helvetica Neue', Arial, sans-serif;
  font-size: .875rem;
  font-weight: 500;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Highlight matched text — underline only, no color pop */
.toto-search-item__title mark {
  background: transparent;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: #b0b0b0;
}

.toto-search-item__meta {
  font-family: 'GothamSSm', sans-serif;
  font-size: .65rem;
  font-weight: 500;
  color: #b8b8b8;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: .2rem;
}

/* Price / badge */
.toto-search-item__badge {
  font-family: 'GothamSSm', sans-serif;
  font-size: .78rem;
  font-weight: 600;
  color: #404040;
  flex-shrink: 0;
}

.toto-search-item__badge ins { text-decoration: none; }

/* Arrow */
.toto-search-item__arrow {
  color: #dcdcdc;
  flex-shrink: 0;
  transition: color .2s, transform .2s;
}

.toto-search-item:hover .toto-search-item__arrow,
.toto-search-item.is-active .toto-search-item__arrow {
  color: #606060;
  transform: translateX(2px);
}

/* ── View all ── */
.toto-search-viewall {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .75rem 1.375rem;
  margin: .25rem .875rem .625rem;
  border-radius: .375rem;
  border: 1px solid #e8e8e8;
  background: transparent;
  color: #404040;
  font-family: 'GothamSSm', sans-serif;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .2s, border-color .2s, color .2s;
  cursor: pointer;
}

.toto-search-viewall:hover {
  background: #0a0a0a;
  border-color: #0a0a0a;
  color: #ffffff;
}

/* ── No results ── */
.toto-search-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 2.25rem 1.375rem;
  text-align: center;
  color: #c8c8c8;
}

.toto-search-no-results svg { opacity: .25; }

.toto-search-no-results span {
  font-family: 'GothamSSm', sans-serif;
  font-size: .8rem;
  font-weight: 400;
  color: #a0a0a0;
}

/* ── Tip ── */
.toto-search-tip {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 1.25rem 1.375rem;
  color: #c8c8c8;
  font-family: 'GothamSSm', sans-serif;
  font-size: .75rem;
  font-weight: 400;
}

/* ── Divider ── */
.toto-search-divider {
  height: 1px;
  background: #f2f2f2;
  margin: .2rem 0;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .toto-search-overlay__panel {
    margin: 0;
    border-radius: 0;
    max-width: 100%;
    margin-top: 60px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
  }

  .toto-search-item__thumb {
    width: 40px;
    height: 40px;
  }

  .toto-search-overlay__input {
    font-size: .95rem;
  }
}
