/* =========================================
   SEARCH-BAR.CSS - REDESIGNED
   Global search functionality with responsive design
   ========================================= */

/* =========================================
   OVERFLOW FIX FOR DROPDOWN VISIBILITY
   ========================================= */

/* Override global overflow hidden for search section */
.search-bar-section {
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
}

/* =========================================
   BASE SEARCH CONTAINER STYLES (DESKTOP)
   ========================================= */

.global-search-container {
  max-width: 1200px;
  width: calc(100% - 40px);
  margin: 0 auto;
  text-align: center;
  box-sizing: border-box;
  padding: 0;
  overflow: visible;
}

.global-search-form {
  display: flex;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  position: relative;
  box-sizing: border-box;
  overflow: visible;
}

/* =========================================
   SEARCH ICON STYLES
   ========================================= */

.search-icon-container {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  z-index: 9999999;
  color: #666;
  pointer-events: none;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-icon-container svg {
  width: 20px;
  height: 20px;
  stroke-width: 2px;
}

/* =========================================
   SEARCH INPUT STYLES
   ========================================= */

.global-search-input {
  flex: 1;
  padding: 12px 15px 12px 45px;
  border: 1px solid #ccc;
  border-radius: 25px;
  font-size: 16px; /* Prevents iOS zoom */
  outline: none;
  transition: all 0.3s ease;
  width: 100%;
  box-sizing: border-box;
  background-color: white;
  min-height: 44px; /* Touch-friendly */
}

.global-search-input:focus {
  border-color: #4a7fac;
  box-shadow: 0 0 0 2px rgba(74, 127, 172, 0.2);
}

.global-search-input::placeholder {
  color: #999;
  font-size: 15px;
}

/* =========================================
   SEARCH BUTTON STYLES
   ========================================= */

.global-search-button {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
}


/* =========================================
   RESPONSIVE BREAKPOINTS
   ========================================= */

/* Large tablets and small laptops (1240px and below) */
@media (max-width: 1240px) {
  .global-search-container {
    margin: 0 20px;
    width: calc(100% - 40px);
    /* REMOVED: padding: 0 20px; - This was causing double padding */
  }
}

/* Tablets (992px and below) */
@media (max-width: 992px) {
  .global-search-input {
    padding: 10px 12px 10px 40px;
    border-radius: 25px;
    font-size: 15px;
  }

  .search-icon-container {
    left: 10px;
  }

  .search-icon-container svg {
    width: 18px;
    height: 18px;
  }

  .suggestion-item {
    padding: 12px 14px;
  }

  .suggestion-text {
    font-size: 13px;
  }

  .suggestion-vendors {
    font-size: 12px;
  }
}

/* Small tablets and large phones (768px and below) */
@media (max-width: 768px) {
  .global-search-container {
    margin: 0 15px;
    width: calc(100% - 30px);
    /* REMOVED: padding: 0 15px; - This was causing double padding */
  }

  .global-search-input {
    padding: 12px 10px 12px 38px;
    border-radius: 25px;
    min-height: 48px; /* Slightly larger for mobile */
  }

  .search-icon-container {
    left: 8px;
  }

  .search-autocomplete-container {
    border-radius: 12px;
    margin-top: 6px;
    max-height: 300px; /* Reduced for mobile screens */
  }

  .suggestion-group-heading {
    padding: 10px 12px;
    font-size: 11px;
  }

  .suggestion-item {
    padding: 12px;
  }

  .suggestion-text {
    font-size: 14px;
  }

  .suggestion-vendors {
    font-size: 12px;
  }

  .suggestion-country {
    font-size: 11px;
  }
}

/* Small phones (480px and below) */
@media (max-width: 480px) {
  .global-search-container {
    margin: 0 15px;
    width: calc(100% - 30px);
    /* REMOVED: padding: 0 10px; - This was causing double padding */
  }

  .global-search-input {
    padding: 12px 8px 12px 35px;
    font-size: 16px; /* Keep 16px to prevent iOS zoom */
    border-radius: 25px;
  }

  .global-search-input::placeholder {
    font-size: 14px;
  }

  .search-icon-container {
    left: 6px;
  }

  .search-icon-container svg {
    width: 16px;
    height: 16px;
  }

  .search-autocomplete-container {
    border-radius: 10px;
    margin-top: 4px;
    max-height: 250px;
  }

  .suggestion-group-heading {
    padding: 8px 10px;
    font-size: 10px;
  }

  .suggestion-item {
    padding: 10px;
  }

  .suggestion-text {
    font-size: 13px;
  }

  .suggestion-vendors {
    font-size: 11px;
    margin-top: 2px;
  }

  .suggestion-country {
    font-size: 10px;
    margin-top: 2px;
  }
}

/* Very small phones (375px and below) */
@media (max-width: 375px) {
  .global-search-container {
    margin: 0 8px;
    width: calc(100% - 16px);
  }

  .global-search-input {
    padding: 10px 6px 10px 32px;
    border-radius: 25px;
  }

  .search-icon-container {
    left: 4px;
  }

  .search-icon-container svg {
    width: 14px;
    height: 14px;
  }

  .search-autocomplete-container {
    max-height: 200px;
  }

  .suggestion-item {
    padding: 8px;
  }

  .suggestion-text {
    font-size: 12px;
  }
}
