/* Live Search Results Dropdown */

/* Results wrapper positioning */
.gstore-header-search .wd-search-results-wrapper {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 1001;
  display: none;
}

.gstore-header-search .wd-search-results-wrapper.is-active {
  display: block !important;
}

/* Results container */
.gstore-header-search .wd-search-results {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  max-height: 500px;
  overflow-y: auto;
  padding: 0;
}

/* Search Results Container */
.gstore-search-results {
  padding: 16px;
}

/* Product Tiles Grid - 4 columns (2 rows of 4), landscape layout */
.gstore-search-tiles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .gstore-search-tiles-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Individual Product Tile */
.gstore-search-tile {
  position: relative;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.gstore-search-tile:hover {
  border-color: rgba(55, 19, 236, 0.2);
  box-shadow: 0 4px 12px rgba(55, 19, 236, 0.08);
  transform: translateY(-2px);
}

.gstore-search-tile-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* Tile Image Container - landscape (4:3) */
.gstore-search-tile-image {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 aspect ratio */
  background: #f5f5f5;
  overflow: hidden;
}

/* Live search uses .gstore-badge-group and .gstore-badge (styled in glassmorphic-theme / product-cards) */
.gstore-header-search .gstore-search-tile .gstore-badge-group {
  position: absolute;
  top: 8px;
  left: 8px;
  pointer-events: none;
}
.gstore-header-search .gstore-search-tile .gstore-badge-group.has-valentine {
  top: 8px;
}

.gstore-header-search .gstore-search-tile .gstore-badge.custom-pre_order {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.24);
}

.gstore-header-search .gstore-search-tile .gstore-valentine-ribbon {
  position: absolute;
  top: clamp(67px, 58%, 96px);
  left: -44px;
  transform: rotate(35deg);
  background: linear-gradient(135deg, #ff3b6b, #ff6fa5);
  color: #fff;
  padding: 3px 46px;
  font-family: "Great Vibes", cursive;
  font-weight: 400;
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.3px;
  box-shadow: 0 10px 20px rgba(255, 0, 80, 0.25);
  z-index: 6;
  pointer-events: none;
}


.gstore-header-search .gstore-search-tile .gstore-badge-rose {
  position: absolute;
  right: 8px;
  top: 8px;
  font-size: 14px;
  color: inherit;
  animation: roseFloat 1.6s infinite;
  z-index: 6;
  pointer-events: none;
}

.gstore-search-tile-image-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.gstore-search-tile-image-slide {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gstore-search-tile-image-slide.is-active {
  opacity: 1;
}

.gstore-search-tile-image-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gstore-search-tile-image-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  z-index: 2;
  pointer-events: none;
}

.gstore-search-tile-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition: background 0.2s ease;
}

.gstore-search-tile-dot.is-active {
  background: rgba(255, 255, 255, 0.95);
}

/* Tile Info */
.gstore-search-tile-info {
  padding: 10px;
}

.gstore-search-tile-title {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.6em;
}

.gstore-search-tile-price {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.gstore-search-tile-price-old {
  font-size: 0.75rem;
  color: #9ca3af;
  text-decoration: line-through;
}

.gstore-search-tile-price-current {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #3713ec;
}

/* View All Link */
.gstore-search-view-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  margin-top: 4px;
  background: rgba(55, 19, 236, 0.05);
  border: 1px solid rgba(55, 19, 236, 0.1);
  border-radius: 8px;
  color: #3713ec;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.gstore-search-view-all:hover {
  background: rgba(55, 19, 236, 0.1);
  transform: translateY(-1px);
}

.gstore-search-view-all svg {
  flex-shrink: 0;
}

/* Popular Searches */
.gstore-popular-searches {
  padding: 16px;
}

.gstore-popular-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1a1a1a;
}

.gstore-popular-title svg {
  color: #3713ec;
  flex-shrink: 0;
}

.gstore-popular-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gstore-popular-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 20px;
  color: #4a4a4a;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none !important;
  transition: all 0.2s ease;
  cursor: pointer;
}

.gstore-popular-tag:hover {
  background: rgba(55, 19, 236, 0.1);
  border-color: #3713ec;
  color: #3713ec;
  transform: translateY(-1px);
}

/* No Results */
.gstore-no-results {
  padding: 40px 20px;
  text-align: center;
}

.gstore-no-results svg {
  color: #9ca3af;
  margin-bottom: 16px;
}

.gstore-no-results h4 {
  margin: 0 0 8px;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a1a1a;
}

.gstore-no-results p {
  margin: 0 0 20px;
  color: #6b7280;
  font-size: 0.9375rem;
}

.gstore-no-results strong {
  color: #1a1a1a;
  font-weight: 600;
}

.gstore-browse-all {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: #3713ec;
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.gstore-browse-all:hover {
  background: #2910c0;
  transform: translateY(-1px);
}

/* Loading State */
.gstore-search-loading {
  padding: 40px 20px;
  text-align: center;
}

.gstore-search-loading p {
  margin: 12px 0 0;
  color: #6b7280;
  font-size: 0.9375rem;
}

.gstore-search-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid rgba(55, 19, 236, 0.1);
  border-top-color: #3713ec;
  border-radius: 50%;
  animation: gstore-spin 0.8s linear infinite;
}

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

/* Scrollbar styling */
.gstore-header-search .wd-search-results::-webkit-scrollbar {
  width: 8px;
}

.gstore-header-search .wd-search-results::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 0 12px 12px 0;
}

.gstore-header-search .wd-search-results::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

.gstore-header-search .wd-search-results::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* Dark mode */
html[data-theme="dark"] .gstore-header-search .wd-search-results {
  background: rgba(30, 30, 30, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .gstore-search-tile {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .gstore-search-tile:hover {
  border-color: rgba(124, 92, 255, 0.4);
  box-shadow: 0 4px 12px rgba(124, 92, 255, 0.15);
}

html[data-theme="dark"] .gstore-search-tile-image {
  background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .gstore-header-search .gstore-badge.condition {
  background: rgba(47, 111, 237, 0.4);
  border-color: rgba(124, 92, 255, 0.5);
  color: #ffffff;
}

html[data-theme="dark"] .gstore-header-search .gstore-badge.custom-pre_order {
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(147, 197, 253, 0.24);
  color: #93c5fd;
}

html[data-theme="dark"] .gstore-header-search .gstore-badge.sale {
  background: rgba(224, 72, 72, 0.35);
  border-color: rgba(224, 72, 72, 0.5);
  color: #ffb3b3;
}

html[data-theme="dark"] .gstore-search-tile-title {
  color: #ffffff;
}

html[data-theme="dark"] .gstore-search-tile-price-old {
  color: #6b7280;
}

html[data-theme="dark"] .gstore-search-tile-price-current {
  color: #7c5cff;
}

html[data-theme="dark"] .gstore-search-view-all {
  background: rgba(124, 92, 255, 0.1);
  border-color: rgba(124, 92, 255, 0.2);
  color: #7c5cff;
}

html[data-theme="dark"] .gstore-search-view-all:hover {
  background: rgba(124, 92, 255, 0.15);
}

html[data-theme="dark"] .gstore-popular-title {
  color: #ffffff;
}

html[data-theme="dark"] .gstore-popular-tag {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
}

html[data-theme="dark"] .gstore-popular-tag:hover {
  background: rgba(124, 92, 255, 0.15);
  border-color: #7c5cff;
  color: #7c5cff;
}

html[data-theme="dark"] .gstore-no-results h4 {
  color: #ffffff;
}

html[data-theme="dark"] .gstore-no-results p {
  color: #9ca3af;
}

html[data-theme="dark"] .gstore-no-results strong {
  color: #ffffff;
}

html[data-theme="dark"] .gstore-browse-all {
  background: #7c5cff;
  color: white;
}

html[data-theme="dark"] .gstore-browse-all:hover {
  background: #6b4eff;
}

html[data-theme="dark"] .gstore-search-spinner {
  border-color: rgba(124, 92, 255, 0.2);
  border-top-color: #7c5cff;
}

/* Error State */
.gstore-search-error {
  padding: 20px;
  text-align: center;
  color: #dc2626;
}

.gstore-search-error p {
  margin: 0;
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
  .gstore-header-search .wd-search-results {
    max-height: 400px;
  }

  .gstore-popular-searches {
    padding: 12px;
  }
}
