/* Search trigger (rectangle in header slot) + modal. vs- prefix scoped. */

/* Header slot: the wrapper that used to hold the Wix instantsearch iframe. */
.vidacom-search-slot {
  display: flex !important;
  align-items: center;
  height: 100%;
  width: 100%;
}

.vidacom-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid #c7ccd3;
  color: #6b7280;
  cursor: text;
  font: 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
  min-width: 220px;
  max-width: 360px;
  box-sizing: border-box;
}
.vidacom-search-trigger:hover,
.vidacom-search-trigger:focus-visible {
  border-color: #1f3a5f;
  box-shadow: 0 0 0 2px rgba(31, 58, 95, 0.12);
  outline: none;
}
.vidacom-search-trigger svg { flex: 0 0 auto; color: #1f3a5f; }
.vidacom-search-trigger-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Fallback: small floating pill when the header slot isn't present. */
.vidacom-search-trigger.vidacom-search-floating {
  position: fixed;
  top: 18px;
  right: 110px;
  z-index: 9998;
  width: auto;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

@media (max-width: 720px) {
  .vidacom-search-trigger { min-width: 0; padding: 0 10px; }
  .vidacom-search-trigger-label { display: none; }
}

.vidacom-search-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  visibility: hidden;
  pointer-events: none;
}
.vidacom-search-modal.vs-open { visibility: visible; pointer-events: auto; }
.vs-overlay {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.vidacom-search-modal.vs-open .vs-overlay { opacity: 1; }

.vs-panel {
  position: absolute;
  left: 50%; top: 80px;
  transform: translate(-50%, -20px);
  width: min(640px, 92%);
  max-height: 70vh;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  display: flex; flex-direction: column;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.vidacom-search-modal.vs-open .vs-panel {
  opacity: 1;
  transform: translate(-50%, 0);
}

.vs-inputRow {
  display: flex; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
}
.vs-input {
  flex: 1;
  padding: 10px 4px;
  border: none;
  outline: none;
  font-size: 16px;
  background: transparent;
}
.vs-close {
  background: none; border: none; font-size: 26px; line-height: 1;
  cursor: pointer; color: #6b7280; padding: 0 8px;
}
.vs-close:hover { color: #111827; }

.vs-results {
  list-style: none; margin: 0; padding: 4px 0;
  overflow-y: auto; flex: 1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.vs-empty {
  padding: 24px 20px; color: #6b7280; font-size: 14px; text-align: center;
}
.vs-hit {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; text-decoration: none; color: inherit;
}
.vs-hit:hover { background: #f3f4f6; }
.vs-thumb {
  width: 44px; height: 60px; object-fit: cover;
  border-radius: 2px; background: #e5e7eb; flex: 0 0 auto;
}
.vs-meta { flex: 1; min-width: 0; }
.vs-name { font-weight: 600; font-size: 14px; line-height: 1.2; color: #111827; }
.vs-sub { font-size: 12px; color: #6b7280; margin-top: 2px; }
.vs-price { font-size: 14px; color: #374151; white-space: nowrap; }
