/* ==========================================================================
   Vegarix v3 Deluxe Full-Screen Search Overlay
   Mobile-First, 180ms Smooth Slide-Up/Fade-In, No-Zoom 16px Font, Shimmer Skeletons
   ========================================================================== */

.v3-search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #ffffff;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 180ms ease, transform 180ms cubic-bezier(0.16, 1, 0.3, 1), visibility 180ms;
  box-sizing: border-box;
}

.v3-search-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* Header & Search Bar */
.v3-search-header {
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.v3-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 2px 8px;
  height: 50px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.v3-search-bar:focus-within {
  border-color: #0f172a;
  background: #ffffff;
}

.v3-search-back-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.v3-search-back-btn:hover,
.v3-search-back-btn:active {
  background: #f1f5f9;
  color: #0f172a;
}

.v3-search-form {
  flex: 1;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
}

/* Input font size MUST be >= 16px to prevent iOS Safari auto-zoom */
.v3-search-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 16px !important;
  font-weight: 500;
  color: #0f172a;
  padding: 0 4px;
}

.v3-search-input::placeholder {
  color: #94a3b8;
  font-size: 15px;
}

.v3-search-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.v3-search-clear-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #e2e8f0;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.v3-search-clear-btn:hover,
.v3-search-clear-btn:active {
  background: #cbd5e1;
  color: #0f172a;
}

.v3-search-spinner {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
}

@keyframes v3Spin {
  100% { transform: rotate(360deg); }
}

.v3-spinner-rot {
  animation: v3Spin 0.75s linear infinite;
}

/* Scrollable Body */
.v3-search-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  box-sizing: border-box;
}

/* Sections inside Initial View */
.v3-search-section {
  margin-bottom: 24px;
}

.v3-search-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.v3-search-section-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #475569;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.v3-search-clear-all-btn {
  border: none;
  background: transparent;
  color: #ef4444;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
}

.v3-search-clear-all-btn:hover {
  text-decoration: underline;
}

.v3-search-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.v3-search-chip {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  text-decoration: none;
}

.v3-search-chip:hover,
.v3-search-chip:active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.v3-recent-chip {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.v3-chip-del {
  margin-left: 4px;
  color: #94a3b8;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.v3-chip-del:hover {
  color: #ef4444;
  background: #fee2e2;
}

/* Shimmer Skeletons */
@keyframes v3Shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.v3-skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  min-height: 56px;
  border-bottom: 1px solid #f1f5f9;
}

.v3-skeleton-thumb {
  width: 54px;
  height: 54px;
  min-width: 54px;
  border-radius: 8px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: v3Shimmer 1.5s infinite;
  flex-shrink: 0;
}

.v3-skeleton-lines {
  flex: 1;
}

.v3-skeleton-line {
  border-radius: 4px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: v3Shimmer 1.5s infinite;
}

.v3-sk-title {
  height: 14px;
  width: 75%;
  margin-bottom: 8px;
}

.v3-sk-meta {
  height: 12px;
  width: 45%;
}

/* Results Rows */
.v3-category-match-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px dashed #e2e8f0;
}

.v3-cat-match-label {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}

.v3-result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  min-height: 56px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s ease;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
}

.v3-result-row:active,
.v3-result-row:hover {
  background: #f8fafc;
}

.v3-result-thumb {
  width: 54px;
  height: 54px;
  min-width: 54px;
  border-radius: 8px;
  object-fit: cover;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.v3-result-info {
  flex: 1;
  min-width: 0;
}

.v3-result-title {
  font-size: 14.5px;
  font-weight: 500;
  color: #0f172a;
  line-height: 1.35;
  margin: 0 0 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.v3-match-bold {
  font-weight: 700;
  color: #0f172a;
  background: #fef08a;
  border-radius: 2px;
  padding: 0 2px;
}

.v3-result-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.v3-result-price {
  font-weight: 700;
  color: #0f172a;
}

.v3-result-cat {
  color: #64748b;
  font-size: 12px;
}

.v3-result-arrow {
  color: #cbd5e1;
  font-size: 13px;
  flex-shrink: 0;
  padding-right: 4px;
}

.v3-result-row:hover .v3-result-arrow {
  color: #0f172a;
}

/* Empty State */
.v3-search-empty {
  text-align: center;
  padding: 36px 16px;
}

.v3-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 12px;
}

.v3-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px 0;
}

.v3-empty-desc {
  font-size: 13.5px;
  color: #64748b;
  margin: 0 0 20px 0;
}

.v3-empty-suggestions {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  text-align: left;
}

.v3-empty-sugg-title {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 10px;
}

/* Bottom View All Bar */
.v3-search-footer {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
}

.v3-view-all-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  background: #0f172a;
  color: #ffffff;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
  transition: background 0.15s ease, opacity 0.15s ease;
  user-select: none;
}

.v3-view-all-btn:hover {
  background: #1e293b;
  color: #ffffff;
}

.v3-view-all-btn:active {
  opacity: 0.9;
}
