/* ============================================
   SMART SEARCH - Modern Algolia-Style
   ============================================ */

/* Overlay */
.search-result-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 9998;
}

.search-result-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Header wrapper z-index */
.search-popup-open .header-search-wrapper {
  position: relative;
  z-index: 10000;
}

/* Result Box Base */
.search-result-box {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: none;
}

.search-result-box--dropdown {
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  margin-top: 8px;
}

.header-search-wrapper {
  position: relative;
}

/* Popup Style */
.search-result-box--popup {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, 94vw);
  max-height: min(80vh, 680px);
  border-radius: 20px;
  border: none;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 9999;
}

/* Header with Search Input */
.search-result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--search-popup-header-bg, #667eea);
  position: sticky;
  top: 0;
  z-index: 2;
}

.search-result-header-input {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-result-header-input i {
  color: var(--search-popup-header-bg, #667eea);
  font-size: 1.1rem;
}

.search-result-input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1 1 auto;
  font-weight: 500;
  font-size: 1rem;
  color: #1e293b;
}

.search-result-input::placeholder {
  color: #94a3b8;
}

.search-result-close {
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: var(--search-popup-header-color, #fff);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.4rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}

.search-result-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Section Label */
.search-result-section {
  padding: 10px 20px;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

/* Results List */
.search-result-list {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1 1 auto;
  background: #f8fafc;
  padding: 12px;
  gap: 8px;
}

/* Product Card */
.search-result-item {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  border: 1px solid transparent;
  min-height: 100px;
}

.search-result-item:hover {
  border-color: var(--search-popup-header-bg, #667eea);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
}

/* Product Image */
.search-result-image {
  flex-shrink: 0;
  width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #f1f5f9 0%, #e2e8f0 100%);
  padding: 8px;
}

.search-result-image img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  padding: 4px;
}

/* Product Content */
.search-result-link {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  justify-content: center;
}

.search-result-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.search-result-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #1e293b;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-highlight {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
  color: #4338ca;
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 700;
}

/* Badges Row */
.search-result-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.search-result-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.search-result-badge.badge-model {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #4338ca;
}

.search-result-badge.badge-stock {
  font-weight: 700;
}

.search-result-badge.badge-stock.in-stock {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #047857;
}

.search-result-badge.badge-stock.out-stock {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #b91c1c;
}

/* Actions Column */
.search-result-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(145deg, #fafafb 0%, #f1f5f9 100%);
  min-width: 150px;
  width: 150px;
  border-left: 1px solid #e2e8f0;
}

/* Price */
.search-result-price {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.search-result-price .price-new {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--search-cart-btn-bg, #667eea);
}

.search-result-price .price-old {
  font-size: 0.75rem;
  color: #94a3b8;
  text-decoration: line-through;
}

/* Quantity Controls */
.search-result-qty {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.search-qty-btn {
  border: none;
  background: transparent;
  color: var(--search-cart-btn-bg, #667eea);
  width: 28px;
  height: 28px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-qty-btn:hover {
  background: #f1f5f9;
}

.search-qty-input {
  width: 32px;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
}

/* Add to Cart Button */
.search-add-to-cart {
  background: var(--search-cart-btn-bg, #667eea);
  border: none;
  color: var(--search-cart-btn-color, #fff);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.search-add-to-cart:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  filter: brightness(1.1);
}

.search-view-options {
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.search-view-options:hover {
  border-color: var(--search-cart-btn-bg, #667eea);
  color: var(--search-cart-btn-bg, #667eea);
}

/* Empty State */
.search-result-empty {
  padding: 40px 20px;
  text-align: center;
  color: #64748b;
}

.search-result-empty i {
  font-size: 3rem;
  color: #cbd5e1;
  margin-bottom: 12px;
  display: block;
}

/* Footer */
.search-result-footer {
  padding: 14px 20px;
  background: #fff;
  text-align: center;
  position: sticky;
  bottom: 0;
  z-index: 2;
  border-top: 1px solid #e2e8f0;
}

.search-result-footer a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--search-popup-header-bg, #667eea);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.search-result-footer a:hover {
  filter: brightness(0.85);
}

.search-result-footer a::after {
  content: '→';
  transition: transform 0.2s ease;
}

.search-result-footer a:hover::after {
  transform: translateX(4px);
}

/* Scrollbar */
.search-result-list::-webkit-scrollbar {
  width: 6px;
}

.search-result-list::-webkit-scrollbar-track {
  background: transparent;
}

.search-result-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.search-result-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ============================================
   HEADER SEARCH BOX - Modern Style
   ============================================ */

.header-search-wrapper {
  position: relative;
}

.header-search-form {
  width: 100%;
}

.header-search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 0 16px;
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  height: 48px;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.header-search-box:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.header-search-box:focus-within {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15), 0 4px 12px rgba(102, 126, 234, 0.1);
}

.header-search-icon {
  color: #94a3b8;
  font-size: 1rem;
  transition: color 0.2s ease;
}

.header-search-box:focus-within .header-search-icon {
  color: #667eea;
}

.header-search-input {
  flex: 1 1 auto;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: #1e293b;
  min-width: 0;
}

.header-search-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.header-search-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  background: linear-gradient(145deg, #f1f5f9 0%, #e2e8f0 100%);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  font-family: system-ui, -apple-system, sans-serif;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.header-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--search-btn-bg, #667eea);
  color: var(--search-btn-color, #fff);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.header-search-btn:hover {
  background: var(--search-btn-hover-bg, #764ba2);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

.header-search-btn i {
  font-size: 0.85rem;
}

/* ============================================
   SEARCH LOADING ANIMATION
   ============================================ */

/* Loading state for search box */
.header-search-box.is-searching {
  position: relative;
  overflow: hidden;
}

/* Progress bar sliding animation at bottom */
.header-search-box.is-searching::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--search-btn-bg, #667eea) 50%,
    transparent 100%
  );
  animation: searchProgressSlide 1.2s ease-in-out infinite;
  border-radius: 0 0 14px 14px;
}

@keyframes searchProgressSlide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Spinner icon color when searching */
.header-search-box.is-searching .header-search-icon {
  color: var(--search-btn-bg, #667eea);
}

/* Glow effect on the search box while loading */
.header-search-box.is-searching {
  border-color: var(--search-btn-bg, #667eea);
  box-shadow: 
    0 0 0 3px rgba(102, 126, 234, 0.15),
    0 0 20px rgba(102, 126, 234, 0.2);
}

/* Pulsing placeholder text */
.header-search-box.is-searching .header-search-input::placeholder {
  animation: placeholderPulse 1.5s ease-in-out infinite;
}

@keyframes placeholderPulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.3;
  }
}

/* Shimmer effect across the input */
.header-search-box.is-searching::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(102, 126, 234, 0.08) 50%,
    transparent 100%
  );
  animation: shimmerSlide 1.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes shimmerSlide {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Loading spinner in popup header */
.search-result-header-input.is-loading i.fa-search {
  display: none;
}

.search-result-header-input.is-loading::before {
  content: '';
  width: 18px;
  height: 18px;
  border: 2px solid rgba(102, 126, 234, 0.2);
  border-top-color: var(--search-popup-header-bg, #667eea);
  border-radius: 50%;
  animation: spinSearch 0.8s linear infinite;
  flex-shrink: 0;
}

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

/* ============================================
   LOAD MORE BUTTON
   ============================================ */

.search-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  margin-top: 8px;
  background: linear-gradient(145deg, #fff 0%, #f8fafc 100%);
  border: 2px dashed #e2e8f0;
  border-radius: 12px;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.search-load-more:hover {
  background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
  border-color: var(--search-popup-header-bg, #667eea);
  color: var(--search-popup-header-bg, #667eea);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.search-load-more:active {
  transform: translateY(0);
}

.search-load-more i {
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.search-load-more:hover i {
  animation: bounceDown 0.6s ease infinite;
}

@keyframes bounceDown {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

.search-load-more.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

.search-load-more.is-loading i {
  animation: spinSearch 0.8s linear infinite;
}

/* Progress indicator showing loaded count */
.search-load-more-progress {
  font-size: 0.75rem;
  font-weight: 500;
  color: #94a3b8;
  margin-left: 4px;
}

/* Skeleton loading for lazy loaded items */
.search-result-item.skeleton {
  pointer-events: none;
}

.search-result-item.skeleton .search-result-image,
.search-result-item.skeleton .search-result-title,
.search-result-item.skeleton .search-result-badge,
.search-result-item.skeleton .search-result-price,
.search-result-item.skeleton .search-result-qty {
  background: linear-gradient(
    90deg,
    #f1f5f9 0%,
    #e2e8f0 50%,
    #f1f5f9 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
  color: transparent !important;
}

.search-result-item.skeleton .search-result-image img {
  opacity: 0;
}

.search-result-item.skeleton .search-result-badge i,
.search-result-item.skeleton .search-result-qty button,
.search-result-item.skeleton .search-result-qty input {
  opacity: 0;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* ============================================
   MOBILE SEARCH
   ============================================ */

/* Mobile Search Trigger Button */
.mobile-search-trigger {
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--mobile-search-size, 44px);
  height: var(--mobile-search-size, 44px);
  border: none;
  background: var(--mobile-search-bg, #667eea);
  color: var(--mobile-search-color, #fff);
  border-radius: var(--mobile-search-radius, 12px);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
  flex-shrink: 0;
}

.mobile-search-trigger:hover,
.mobile-search-trigger:focus {
  background: var(--mobile-search-hover-bg, #764ba2);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
}

.mobile-search-trigger:active {
  transform: translateY(0) scale(0.98);
}

.mobile-search-trigger i {
  font-size: var(--mobile-search-icon-size, 1.1rem);
}

/* Header position variant - slightly larger for better visibility */
.mobile-search-trigger--header {
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Mobile Search Overlay */
.mobile-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-search-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile Search Container */
.mobile-search-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #fff;
  z-index: 10001;
  transform: translateY(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-height: 85vh;
  height: 85vh;
  overflow-y: auto;
}

.mobile-search-overlay.active + .mobile-search-container,
.mobile-search-container.active {
  transform: translateY(0);
}

/* Mobile Search Header */
.mobile-search-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--search-popup-header-bg, #667eea);
}

.mobile-search-input-wrapper {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mobile-search-input-wrapper i {
  color: var(--search-popup-header-bg, #667eea);
  font-size: 1rem;
}

.mobile-search-input {
  flex: 1 1 auto;
  border: none;
  background: transparent;
  outline: none;
  font-size: 1rem;
  font-weight: 500;
  color: #1e293b;
}

.mobile-search-input::placeholder {
  color: #94a3b8;
}

.mobile-search-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.5rem;
  transition: background 0.2s ease;
}

.mobile-search-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Mobile Search Results - Compact Design */
.mobile-search-results {
  max-height: calc(85vh - 80px);
  overflow-y: auto;
  background: #f8fafc;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-search-results .search-result-section {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 16px;
  font-size: 0.7rem;
}

.mobile-search-results .search-result-list {
  padding: 8px;
  gap: 6px;
}

/* Mobile Product Card - Horizontal Compact Layout */
.mobile-search-results .search-result-item {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  min-height: auto;
  padding: 8px;
  gap: 10px;
  border-radius: 12px;
}

.mobile-search-results .search-result-image {
  width: 60px;
  min-width: 60px;
  padding: 0;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-search-results .search-result-image img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 6px;
}

.mobile-search-results .search-result-link {
  flex: 1 1 auto;
  padding: 0;
  min-width: 0;
}

.mobile-search-results .search-result-details {
  gap: 4px;
}

.mobile-search-results .search-result-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}

.mobile-search-results .search-result-badges {
  gap: 4px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.mobile-search-results .search-result-badge {
  font-size: 0.6rem;
  padding: 2px 6px;
  white-space: nowrap;
}

.mobile-search-results .search-result-badge i {
  font-size: 0.55rem;
}

/* Mobile Actions - Compact Right Side */
.mobile-search-results .search-result-actions {
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  padding: 0;
  border-left: none;
  border-top: none;
  background: transparent;
  min-width: auto;
  width: auto;
}

.mobile-search-results .search-result-price {
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
}

.mobile-search-results .search-result-price .price-new {
  font-size: 0.9rem;
  font-weight: 700;
}

.mobile-search-results .search-result-price .price-old {
  font-size: 0.65rem;
}

/* Mobile Quantity Controls - Super Compact */
.mobile-search-results .search-result-qty {
  transform: scale(0.85);
  transform-origin: right center;
}

.mobile-search-results .search-add-to-cart {
  padding: 8px 10px;
  font-size: 0.75rem;
}

.mobile-search-results .search-view-options {
  font-size: 0.65rem;
  padding: 6px 10px;
}

/* Mobile Footer */
.mobile-search-results .search-result-footer {
  padding: 12px 16px;
}

.mobile-search-results .search-result-footer a {
  font-size: 0.85rem;
}

/* Mobile Load More Button */
.mobile-search-results .search-load-more {
  padding: 10px 16px;
  font-size: 0.8rem;
  margin-top: 4px;
}

/* Mobile Empty State */
.mobile-search-results .search-result-empty {
  padding: 30px 20px;
}

.mobile-search-results .search-result-empty i {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.mobile-search-results .search-result-empty p {
  font-size: 0.9rem;
}

/* Loading state for mobile search */
.mobile-search-input-wrapper.is-loading i.fa-search {
  display: none;
}

.mobile-search-input-wrapper.is-loading::before {
  content: '';
  width: 18px;
  height: 18px;
  border: 2px solid rgba(102, 126, 234, 0.2);
  border-top-color: var(--search-popup-header-bg, #667eea);
  border-radius: 50%;
  animation: spinSearch 0.8s linear infinite;
  flex-shrink: 0;
}

/* Show mobile search trigger on smaller screens */
@media (max-width: 991px) {
  .mobile-search-trigger {
    display: flex;
  }
}

/* Responsive */
@media (max-width: 640px) {
  .search-result-box--popup {
    /* top: 60px; */
    width: 96vw;
    max-height: 85vh;
    border-radius: 16px;
  }

  .search-result-header {
    padding: 12px 14px;
  }

  .search-result-item {
    flex-wrap: wrap;
  }

  .search-result-image {
    width: 80px;
    padding: 6px;
  }

  .search-result-image img {
    width: 68px;
    height: 68px;
  }

  .search-result-actions {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    border-left: none;
    border-top: 1px solid #e2e8f0;
    padding: 10px 14px;
  }

  .search-result-price {
    flex-direction: row;
    gap: 8px;
    align-items: baseline;
  }

  .header-search-box {
    height: 44px;
    padding: 0 4px 0 12px;
  }

  .header-search-shortcut {
    display: none;
  }

  .header-search-btn {
    width: 32px;
    height: 32px;
  }
  
  /* Mobile search container full screen adjustments */
  .mobile-search-header {
    padding: 12px;
  }
  
  .mobile-search-input-wrapper {
    padding: 10px 14px;
  }
  
  /* Extra small screens - even more compact */
  .mobile-search-results .search-result-item {
    padding: 6px;
    gap: 8px;
  }
  
  .mobile-search-results .search-result-image {
    width: 50px;
    min-width: 50px;
  }
  
  .mobile-search-results .search-result-image img {
    width: 44px;
    height: 44px;
  }
  
  .mobile-search-results .search-result-title {
    font-size: 0.8rem;
  }
  
  .mobile-search-results .search-result-badges {
    display: none; /* Hide badges on very small screens */
  }
  
  .mobile-search-results .search-result-price .price-new {
    font-size: 0.85rem;
  }
  
  .mobile-search-results .search-result-qty {
    transform: scale(0.8);
  }
}

/* Medium mobile screens */
@media (min-width: 400px) and (max-width: 640px) {
  .mobile-search-results .search-result-badges {
    display: flex;
  }
  
  .mobile-search-results .search-result-item {
    padding: 10px;
  }
}