/* Global Search Block Styles - Compact glassy bar */
.global-search-block {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.global-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  overflow: hidden;
}

.global-search-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.6s ease;
}

.global-search-wrapper:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.global-search-wrapper:hover::before {
  left: 100%;
}

.global-search-wrapper:focus-within {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15), 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.global-search-input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  outline: none !important;
  padding: 7px 16px !important;
  font-size: 13px !important;
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 400 !important;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  line-height: 1.3 !important;
}

.global-search-input::placeholder {
  color: rgba(255, 255, 255, 0.6) !important;
  font-weight: 400 !important;
  font-style: italic;
}

.global-search-submit {
  border: none !important;
  background: transparent !important;
  cursor: pointer;
  padding: 6px !important;
  margin: 0 8px 0 0 !important;
  border-radius: 0 !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: auto !important;
  box-shadow: none !important;
  position: relative;
  overflow: visible;
  flex-shrink: 0;
}

.global-search-submit::before {
  content: '';
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  position: relative;
  transition: all 0.2s ease;
  z-index: 2;
}

.global-search-submit::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 2px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 1px;
  transform: translate(-50%, -50%) translate(6px, 6px) rotate(45deg);
  transition: all 0.2s ease;
  z-index: 2;
}

.global-search-submit:hover {
  background: transparent !important;
  transform: scale(1.1) !important;
  box-shadow: none !important;
}

.global-search-submit:hover::before {
  border-color: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}

.global-search-submit:hover::after {
  background: rgba(255, 255, 255, 1);
  transform: translate(-50%, -50%) translate(7px, 7px) rotate(45deg);
}

.global-search-submit:active {
  transform: scale(1.05) !important;
}

/* Form wrapper override */
.global-search-block .form-item {
  margin: 0 !important;
  padding: 0 !important;
}

.global-search-block .form-type-search {
  margin: 0 !important;
  width: 100% !important;
}

.global-search-block label {
  display: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .global-search-block {
    max-width: 700px;
  }
  
  .global-search-wrapper {
    border-radius: 20px;
    padding: 0;
  }
  
  .global-search-input {
    font-size: 12px !important;
    padding: 8px 12px !important;
  }
  
  .global-search-submit {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    margin: 3px 4px 3px 0 !important;
    padding: 0 !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3);
  }
  
  .global-search-submit:active {
    background: rgba(255, 255, 255, 0.35) !important;
    transform: scale(0.95) !important;
  }
  
  .global-search-submit::before {
    width: 14px;
    height: 14px;
    border-width: 2px;
    border-color: rgba(255, 255, 255, 1);
  }
  
  .global-search-submit::after {
    width: 6px;
    height: 2px;
    background: rgba(255, 255, 255, 1);
    transform: translate(-50%, -50%) translate(6px, 6px) rotate(45deg);
  }
  
  /* Make autocomplete dropdown full width on mobile */
  .global-search-autocomplete-dropdown {
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }
}

@media (max-width: 480px) {
  .global-search-block {
    max-width: 200px;
  }
  
  .global-search-wrapper {
    border-radius: 18px;
  }
  
  .global-search-input {
    font-size: 10px !important;
    padding: 5px 8px !important;
  }
  
  .global-search-submit {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    margin: 2px 3px 2px 0 !important;
    padding: 0 !important;
  }
  
  .global-search-submit::before {
    width: 12px;
    height: 12px;
    border-width: 2px;
  }
  
  .global-search-submit::after {
    width: 5px;
    height: 2px;
    transform: translate(-50%, -50%) translate(5px, 5px) rotate(45deg);
  }
}

@media (max-width: 360px) {
  .global-search-block {
    max-width: 180px;
  }
  
  .global-search-wrapper {
    border-radius: 15px;
  }
  
  .global-search-input {
    font-size: 9px !important;
    padding: 4px 6px !important;
  }
  
  .global-search-submit {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    margin: 2px 2px 2px 0 !important;
    padding: 0 !important;
  }
  
  .global-search-submit::before {
    width: 10px;
    height: 10px;
    border-width: 1.5px;
  }
  
  .global-search-submit::after {
    width: 4px;
    height: 1.5px;
    transform: translate(-50%, -50%) translate(4px, 4px) rotate(45deg);
  }
}

/* Professional animations */
@keyframes searchPulse {
  0%, 100% {
    box-shadow: 
      0 8px 32px rgba(0, 0, 0, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow: 
      0 12px 40px rgba(0, 0, 0, 0.15),
      inset 0 1px 0 rgba(255, 255, 255, 0.15);
  }
}

.global-search-wrapper:focus-within {
  animation: searchPulse 2s ease-in-out infinite;
}

/* Smooth typing effect */
.global-search-input:focus {
  animation: none !important;
}

/* Glass reflection effect */
.global-search-wrapper::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 1px;
  right: 1px;
  height: 50%;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    transparent 100%
  );
  border-radius: 30px 30px 0 0;
  pointer-events: none;
}

/* Autocomplete Dropdown Styles */
.global-search-autocomplete-dropdown {
  position: absolute !important;
  background: #fff !important;
  border: none !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  z-index: 9999 !important;
  max-height: 400px !important;
  overflow-y: auto !important;
  padding: 0.5rem !important;
  margin-top: 0.5rem !important;
}

.autocomplete-suggestion {
  padding: 1rem 1.25rem !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  border-radius: 8px !important;
  margin-bottom: 0.25rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  position: relative !important;
  color: #333 !important;
  font-size: 1rem !important;
}

.autocomplete-suggestion:last-child {
  margin-bottom: 0 !important;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.selected {
  background: #4DA803 !important;
  color: #fff !important;
  transform: translateX(4px) !important;
}

.autocomplete-suggestion .search-icon {
  font-size: 1.1rem !important;
  opacity: 0.7 !important;
}

.autocomplete-suggestion:hover .search-icon,
.autocomplete-suggestion.selected .search-icon {
  opacity: 1 !important;
}

.autocomplete-suggestion .suggestion-main {
  flex: 1 !important;
  font-weight: 500 !important;
}

.autocomplete-suggestion .suggestion-category {
  font-size: 0.85rem !important;
  opacity: 0.7 !important;
  font-style: italic !important;
  margin-left: 0.5rem !important;
}

.autocomplete-suggestion .suggestion-arrow {
  font-size: 1.2rem !important;
  opacity: 0 !important;
  transition: opacity 0.2s ease !important;
}

.autocomplete-suggestion:hover .suggestion-arrow,
.autocomplete-suggestion.selected .suggestion-arrow {
  opacity: 1 !important;
}

/* Mobile styles for autocomplete */
@media (max-width: 768px) {
  .global-search-autocomplete-dropdown {
    border-radius: 16px !important;
    padding: 0.75rem !important;
    max-height: 60vh !important;
    margin-top: 0.75rem !important;
  }
  
  .autocomplete-suggestion {
    padding: 1.25rem 1.5rem !important;
    font-size: 1.125rem !important;
    border-radius: 12px !important;
    margin-bottom: 0.5rem !important;
  }
  
  .autocomplete-suggestion .search-icon {
    font-size: 1.3rem !important;
  }
  
  .autocomplete-suggestion .suggestion-main {
    font-size: 1.125rem !important;
  }
  
  .autocomplete-suggestion .suggestion-arrow {
    font-size: 1.4rem !important;
  }
}