/* ALU Search Styles */

.alu-search-section {
  width: 100% !important;
  max-width: 600px !important;
  margin: 0 auto !important;
  display: block !important;
  position: relative !important;
  box-sizing: border-box !important;
  padding: 0 !important;
}


.alu-search-container-wrapper {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Search container */
.alu-search-container {
  background: white !important;
  border-radius: 4px !important;
  padding: 3px !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
  margin-bottom: 20px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.alu-search-input {
  border: none !important;
  outline: none !important;
  padding: 12px 15px !important;
  font-size: 14px !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  min-height: 48px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  background: white !important;
  color: #333 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  line-height: 1.5 !important;
}

.alu-search-input::placeholder {
  color: #bbb !important;
}

.alu-search-input:focus {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

@media (max-width: 849px) {
  .header-bottom-nav.mobile-nav .html.custom,
  .header-bottom-nav.mobile-nav li.html.custom,
  .header-bottom-nav.mobile-nav .html.custom.html_topbar_right {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  .header-bottom-nav.mobile-nav .alu-search-section,
  .header-bottom-nav.mobile-nav .alu-search-container-wrapper,
  .header-bottom-nav.mobile-nav .alu-search-container {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* --- NEW AGGRESSIVE OVERRIDE FOR FLATSOME --- */
  /* Force the container LI to be visible and have space */
  .mobile-nav > li.html {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 60px !important; /* Give it a minimum height */
    box-sizing: border-box !important;
  }
}

.alu-search-btn {
  background: linear-gradient(135deg, #f90505 0%, #8b5cf6 100%) !important;
  border: none !important;
  color: white !important;
  padding: 12px 18px !important;
  margin: 0 !important;
  margin-right: 0 !important;
  font-size: 14px !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  white-space: nowrap !important;
  transition: all 0.2s ease !important;
  border-radius: 0 4px 4px 0 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  box-shadow: none !important;
  text-decoration: none !important;
  flex: 0 0 auto !important;
  min-height: 48px !important;
  min-width: 100px !important;
  width: auto !important;
  height: auto !important;
  position: relative !important;
}

.alu-search-btn:hover {
  background: linear-gradient(135deg, #f90505 0%, #8b5cf6 100%) !important;
  color: white !important;
}

.alu-search-btn:active {
  transform: scale(0.98) !important;
}

/* Search suggestions dropdown */
.alu-search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 10000 !important;
  display: none;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  margin-top: -3px;
}

.alu-search-suggestions.show {
  display: block;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alu-search-suggestion-item {
  padding: 12px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid #f5f5f5;
  text-decoration: none;
  color: inherit;
}

.alu-search-suggestion-item:hover {
  background: #fef6f5;
}

.alu-search-suggestion-item:last-child {
  border-bottom: none;
}

.alu-search-suggestion-icon {
  color: #f53d2d;
  font-size: 14px;
  width: 20px;
  text-align: center;
}

.alu-search-suggestion-icon .fa-fire,
.alu-search-trending-title .fa-fire,
.alu-search-history-title .fa-history,
.fa-fire {
  color: #f90505 !important;
}

.alu-search-history-title .fa-history {
  color: #8b5cf6 !important;
}

.alu-search-suggestion-text {
  flex: 1;
  font-size: 14px;
  color: #333;
}

.alu-search-suggestion-text mark,
.alu-search-results-body mark {
  background: linear-gradient(135deg, #f90505 0%, #8b5cf6 100%) !important;
  color: #fff !important;
  padding: 0 4px;
  border-radius: 3px;
}

.alu-search-suggestion-category {
  font-size: 12px;
  color: #999;
  background: #f5f5f5;
  padding: 2px 8px;
  border-radius: 2px;
}

/* History section */
.alu-search-history-section {
  padding: 10px 15px;
  background: #fafafa;
  border-bottom: 1px solid #eee;
}

.alu-search-history-title {
  font-size: 12px;
  color: #000;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.alu-search-history-clear {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  color: #8a8a8a;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.1;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease;
}

.alu-search-history-clear i {
  font-size: 9px;
}

.alu-search-history-clear:hover {
  color: #f53d2d;
}

.alu-search-history-clear.is-hidden {
  display: none;
}

.alu-search-history-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.alu-search-history-tag {
  background: white;
  border: 1px solid #eee;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: #000;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.alu-search-history-tag:hover {
  border-color: #f53d2d;
  color: #f53d2d;
  background: #fff9f8;
}

/* Trending tags */
.alu-search-trending-section {
  margin-top: 20px;
}

.alu-search-trending-title {
  color: #333;
  font-size: 12px;
  margin-bottom: 8px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 1;
}

.alu-search-trending-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.alu-search-trending-tag {
  color: #333;
  font-size: 12px;
  text-decoration: none;
  background: #f5f5f5;
  padding: 4px 4px;
  border-radius: 16px;
  transition: all 0.2s ease;
  border: 1px solid #eee;
  cursor: pointer;
  display: inline-block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.alu-search-trending-tag:hover {
  color: #f53d2d;
  background: #fff;
  border-color: #f53d2d;
  text-decoration: none;
}

.alu-search-container-wrapper {
  position: relative;
}

/* Search result item */
.alu-search-suggestion-item {
  padding: 12px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid #f5f5f5;
  text-decoration: none;
  color: inherit;
}

.alu-search-suggestion-item:hover {
  background: #fef6f5;
}

.alu-search-suggestion-item:last-child {
  border-bottom: none;
}

/* Loading state */
.alu-search-loading {
  text-align: center;
  padding: 12px 15px;
  color: #999;
  font-size: 13px;
}

.alu-search-loading .spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #f5f5f5;
  border-left-color: #f53d2d;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Empty state */
.alu-search-empty {
  padding: 12px 15px;
  text-align: center;
  color: #999;
  font-size: 13px;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .alu-search-btn .alu-search-btn-text {
    display: inline !important;
  }

  .alu-search-btn i,
  .alu-search-btn .alu-search-btn-icon {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .alu-search-btn {
    padding: 6px 18px !important;
    margin: 0 !important;
  }

  .alu-search-trending-tags {
    gap: 8px;
    margin-bottom: 10px;
  }

  .alu-search-trending-tag {
    font-size: 12px;
    padding: 4px 4px;
  }

  .alu-search-input {
    font-size: 16px;
    padding: 12px 10px;
  }

  .alu-search-container {
    padding: 2px;
  }

  .alu-search-container-wrapper {
    position: relative;
    z-index: 1000;
  }

  .alu-search-suggestions {
    z-index: 10001 !important;
    max-height: 50vh;
  }

  .alu-search-btn {
    min-height: 44px;
  }

  .alu-search-input {
    min-height: 44px;
  }

  .alu-search-history-tag {
    min-height: 32px;
    padding: 8px 12px;
  }

  .alu-search-suggestion-item {
    min-height: 44px;
  }
}

/* Search Results Modal */
.alu-search-results-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.alu-search-results-content {
  background: white;
  border-radius: 8px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.alu-search-results-header {
  padding: 14px 16px;
  border-bottom: 1px solid #ececec;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #fff;
}

.alu-search-results-header h2 {
  margin: 0;
  font-size: 16px;
  color: #1f2937;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alu-search-results-header h2::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, #f53d2d 0%, #ff7a59 100%);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(245, 61, 45, 0.12);
}

.alu-search-results-close {
  background: #fff;
  border: 1px solid #e6e6e6;
  color: #7a7a7a;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border-radius: 8px;
  line-height: 1;
}

.alu-search-results-close:hover {
  color: #f53d2d;
  border-color: #f53d2d;
  background: #fff9f8;
  transform: translateY(-1px);
}

.alu-search-results-close:active {
  transform: scale(0.96);
}

.alu-search-results-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #fff;
}

.alu-search-results-count {
  margin: 0 0 20px 0;
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.alu-search-results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alu-search-suggestions .alu-search-results-count {
  margin: 0;
  padding: 10px 15px 6px;
  font-size: 12px;
  color: #666;
}

.alu-search-suggestions .alu-search-results-list {
  padding: 0 10px 10px;
  gap: 8px;
}

.alu-search-suggestions .alu-search-result-product-card {
  padding: 10px;
}

.alu-search-suggestions .alu-search-result-thumbnail {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
}

/* Product Card */
.alu-search-result-product-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: white;
}

.alu-search-result-product-card:hover {
  background: #fef6f5;
  border-color: #f53d2d;
  box-shadow: 0 4px 16px rgba(245, 61, 45, 0.2);
  transform: translateY(-2px);
}

/* Thumbnail */
.alu-search-result-thumbnail {
  flex: 0 0 80px;
  width: 80px;
  height: 80px;
  border-radius: 4px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.alu-search-result-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.alu-search-result-thumbnail-placeholder {
  color: #ccc;
  font-size: 32px;
}

/* Product Info */
.alu-search-result-info {
  flex: 1;
  min-width: 0;
}

.alu-search-result-title {
  font-size: 14px;
  color: #333;
  font-weight: 500;
  margin: 0 0 4px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.alu-search-result-category {
  font-size: 12px;
  color: #999;
  margin: 0;
}

/* Arrow Icon */
.alu-search-result-arrow {
  flex: 0 0 20px;
  color: #ccc;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alu-search-result-product-card:hover .alu-search-result-arrow {
  color: #f53d2d;
  transform: translateX(4px);
}

/* Notification */
.alu-search-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 4px;
  background: #f5f5f5;
  color: #333;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.alu-search-notification-warning {
  background: #fff3cd;
  color: #856404;
}

.alu-search-notification-success {
  background: #d4edda;
  color: #155724;
}

.alu-search-notification-error {
  background: #f8d7da;
  color: #721c24;
}

@media (max-width: 600px) {
  .alu-search-results-content {
    width: min(92vw, 560px);
    max-height: 85vh;
    border-radius: 12px;
  }

  .alu-search-results-modal {
    align-items: center;
    justify-content: center;
    padding: 12px;
  }

  .alu-search-notification {
    right: 10px;
    left: 10px;
    bottom: 10px;
  }

  .alu-search-result-product-card {
    padding: 10px;
    gap: 10px;
  }

  .alu-search-result-thumbnail {
    flex: 0 0 70px;
    width: 70px;
    height: 70px;
  }

  .alu-search-result-title {
    font-size: 13px;
  }

  .alu-search-results-header {
    padding: 12px 14px;
  }

  .alu-search-results-header h2 {
    font-size: 15px;
  }

  .alu-search-results-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .alu-search-results-body {
    padding: 15px;
  }
}
