/* =============================================
   SPLENDOR VITA — Buscador Interno
   ============================================= */

/* ── Overlay ─────────────────────────────── */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}
.search-overlay.active { display: flex; }

.search-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ── Panel ────────────────────────────────── */
.search-overlay__panel {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 75vh;
  margin: 0 1.5rem;
  background: var(--color-bg, #faf9f7);
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.3);
  overflow: hidden;
}

/* ── Header / Input ───────────────────────── */
.search-overlay__header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--color-border, #e8e4de);
  position: relative;
}
.search-overlay__icon {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-light, #6b6b6b);
  pointer-events: none;
}
.search-overlay__input {
  width: 100%;
  padding: 1.25rem 3.5rem 1.25rem 3.75rem;
  background: transparent;
  border: none;
  font-family: var(--font-serif, 'Playfair Display', serif);
  font-size: 1.35rem;
  color: var(--color-text, #1a1a1a);
  outline: none;
  letter-spacing: 0.02em;
}
.search-overlay__input::placeholder {
  color: var(--color-text-light, #6b6b6b);
  font-style: italic;
  opacity: 0.7;
}
.search-overlay__clear {
  position: absolute;
  right: 4rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-light, #6b6b6b);
  padding: 0.25rem;
  display: none;
}
.search-overlay__clear.visible { display: block; }
.search-overlay__close {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-light, #6b6b6b);
  padding: 0.25rem;
  transition: color 0.15s ease;
}
.search-overlay__close:hover { color: var(--color-text, #1a1a1a); }

/* ── Body / Results ───────────────────────── */
.search-overlay__body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border, #e8e4de) transparent;
}

/* ── Results Group ────────────────────────── */
.search-results-group {
  padding: 0.5rem 0;
}
.search-results-group__title {
  font-family: var(--font-sans, 'Cormorant Garamond', sans-serif);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-light, #6b6b6b);
  padding: 0.5rem 1.5rem;
  margin: 0;
}

/* ── Result Item ──────────────────────────── */
.search-result-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.search-result-item:hover,
.search-result-item.search-result--active {
  background: rgba(201, 169, 110, 0.08);
}
.search-result-item.search-result--active {
  border-left-color: var(--color-secondary, #c9a96e);
}

/* Thumbnail (productos) */
.search-result__thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-border, #e8e4de);
}

/* Icono (blog/faq) */
.search-result__icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(201, 169, 110, 0.1);
  color: var(--color-secondary, #c9a96e);
}

/* Info */
.search-result__info {
  flex: 1;
  min-width: 0;
}
.search-result__name {
  font-family: var(--font-serif, 'Playfair Display', serif);
  font-size: 0.95rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}
.search-result__meta {
  font-size: 0.75rem;
  color: var(--color-text-light, #6b6b6b);
  margin: 0.15rem 0 0;
}
.search-result__price {
  font-family: var(--font-sans, 'Cormorant Garamond', sans-serif);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-secondary, #c9a96e);
  flex-shrink: 0;
  white-space: nowrap;
}

/* Highlight */
.search-highlight {
  background: rgba(201, 169, 110, 0.25);
  color: inherit;
  padding: 0 2px;
  border-radius: 1px;
}

/* ── "Ver todos" link ─────────────────────── */
.search-results__viewall {
  display: block;
  padding: 0.6rem 1.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-secondary, #c9a96e);
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.search-results__viewall:hover { opacity: 0.7; }

/* ── Recent searches ──────────────────────── */
.search-recent {
  padding: 1rem 1.5rem;
}
.search-recent__title {
  font-family: var(--font-sans, 'Cormorant Garamond', sans-serif);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-light, #6b6b6b);
  margin: 0 0 0.75rem;
}
.search-recent__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.search-recent__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  background: rgba(201, 169, 110, 0.08);
  border: 1px solid var(--color-border, #e8e4de);
  font-family: var(--font-sans, 'Cormorant Garamond', sans-serif);
  font-size: 0.8rem;
  color: var(--color-text, #1a1a1a);
  cursor: pointer;
  transition: background 0.15s ease;
}
.search-recent__chip:hover { background: rgba(201, 169, 110, 0.15); }
.search-recent__chip-x {
  font-size: 0.65rem;
  opacity: 0.5;
  cursor: pointer;
  margin-left: 0.2rem;
}
.search-recent__chip-x:hover { opacity: 1; }

/* ── Empty state ──────────────────────────── */
.search-empty {
  padding: 3rem 1.5rem;
  text-align: center;
}
.search-empty__title {
  font-family: var(--font-serif, 'Playfair Display', serif);
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  color: var(--color-text, #1a1a1a);
}
.search-empty__sub {
  font-size: 0.85rem;
  color: var(--color-text-light, #6b6b6b);
  margin: 0;
}

/* ── Footer hints ─────────────────────────── */
.search-overlay__footer {
  padding: 0.65rem 1.5rem;
  border-top: 1px solid var(--color-border, #e8e4de);
  display: flex;
  gap: 1.5rem;
  font-family: var(--font-sans, 'Cormorant Garamond', sans-serif);
  font-size: 0.72rem;
  color: var(--color-text-light, #6b6b6b);
}
.search-overlay__hint { display: flex; align-items: center; gap: 0.35rem; }
kbd.search-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4em;
  padding: 0.1em 0.4em;
  background: #eee;
  border: 1px solid var(--color-border, #e8e4de);
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.68rem;
  line-height: 1;
}

/* ── Mobile ───────────────────────────────── */
@media (max-width: 768px) {
  .search-overlay {
    padding-top: 0;
    align-items: flex-end;
  }
  .search-overlay__panel {
    max-width: 100%;
    max-height: 92vh;
    margin: 0;
    border-radius: 16px 16px 0 0;
  }
  .search-overlay__input { font-size: 1.1rem; padding-left: 3.25rem; }
  .search-overlay__footer { display: none; }
  .search-result__thumb { width: 40px; height: 40px; }
}
