/**
 * Goxa Search AI - Estilos de la barra de busqueda
 * Diseñada para integrarse con el header de Goxa Industrial
 * Colores: #ffc700 (amarillo Goxa), #1c1c1c (fondo header), #6ec1ce (azul acento)
 */

/* ============================
   OCULTAR BUSCADOR ORIGINAL
   ============================ */

/* Ocultar el bloque original de leoproductsearch */
#leo_search_block_top {
  display: none !important;
}

/* Ocultar el ps_searchbar si existe */
#search_block_top {
  display: none !important;
}

/* ============================
   CONTENEDOR PRINCIPAL
   ============================ */

.goxasearchai-wrapper {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  max-width: 600px;
  margin: 0 15px;
}

/* ============================
   TOGGLE NORMAL / IA
   ============================ */

.goxasearchai-toggle {
  display: flex;
  border-radius: 8px 0 0 8px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(255, 199, 0, 0.4);
  border-right: none;
  height: 42px;
  background: rgba(255, 255, 255, 0.08);
}

.goxasearchai-mode-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 14px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: black;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.25s ease;
  white-space: nowrap;
  height: 100%;
  position: relative;
}

.goxasearchai-mode-btn .material-icons {
  font-size: 18px;
}

.goxasearchai-mode-btn:hover {
  color: black;
  background: rgba(255, 255, 255, 0.1);
}

.goxasearchai-mode-btn[data-mode="ai"] {
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.goxasearchai-mode-btn.active {
  color: #1c1c1c;
  background: #ffc700;
}

.goxasearchai-mode-btn.active[data-mode="ai"] {
  background: #6ec1e4;
  color: #1c1c1c;
}

/* ============================
   BARRA DE BUSQUEDA
   ============================ */

.goxasearchai-searchbar {
  flex: 1;
  position: relative;
}

.goxasearchai-form {
  width: 100%;
}

.goxasearchai-input-wrapper {
  display: flex;
  align-items: center;
  background: black;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-left: none;
  border-radius: 0 8px 8px 0;
  overflow: hidden;
  height: 42px;
  transition: border-color 0.25s ease;
}

.goxasearchai-input-wrapper:focus-within {
  border-color: #ffc700;
  box-shadow: 0 0 0 3px rgba(255, 199, 0, 0.15);
}

.goxasearchai-input-wrapper:focus-within.goxasearchai-ai-active {
  border-color: #6ec1e4;
  box-shadow: 0 0 0 3px rgba(110, 193, 228, 0.15);
}

.goxasearchai-icon {
  padding: 0 12px;
  color: #999;
  font-size: 20px;
  flex-shrink: 0;
}

.goxasearchai-icon-ai {
  color: #6ec1e4;
}

.goxasearchai-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: #ffffff;
  background: transparent;
  padding: 0 8px;
  height: 100%;
}

.goxasearchai-input::placeholder {
  color: #aaa;
}

.goxasearchai-submit-btn {
  display: none !important;
}

.goxasearchai-submit-btn:hover {
  color: #ffc700;
  background: rgba(255, 199, 0, 0.05);
}

.goxasearchai-submit-ai {
  color: #6ec1e4;
}

.goxasearchai-submit-ai:hover {
  color: #5ab5d6;
  background: rgba(110, 193, 228, 0.05);
}

/* ============================
   DROPDOWN DE RESULTADOS
   ============================ */

.goxasearchai-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-top: 2px solid #ffc700;
}

.goxasearchai-dropdown-results {
  padding: 8px 0;
}

.goxasearchai-dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  text-decoration: none;
  color: #333;
  transition: background 0.15s ease;
  gap: 12px;
}

.goxasearchai-dropdown-item:hover {
  background: #f8f8f8;
}

.goxasearchai-dropdown-item img {
  width: 45px;
  height: 45px;
  object-fit: contain;
  border-radius: 4px;
  background: #f5f5f5;
  flex-shrink: 0;
}

.goxasearchai-dropdown-item-info {
  flex: 1;
  min-width: 0;
}

.goxasearchai-dropdown-item-name {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.goxasearchai-dropdown-item-category {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}

.goxasearchai-dropdown-item-price {
  font-size: 14px;
  font-weight: 700;
  color: #ffc700;
  white-space: nowrap;
}

.goxasearchai-dropdown-item-stock {
  font-size: 11px;
  margin-top: 2px;
  text-align: right;
}

.goxasearchai-dropdown-item-stock.in-stock {
  color: #27ae60;
}

.goxasearchai-dropdown-item-stock.out-stock {
  color: #e74c3c;
}

.goxasearchai-dropdown-footer {
  padding: 10px 16px;
  text-align: center;
  border-top: 1px solid #eee;
}

.goxasearchai-dropdown-footer a {
  color: #6ec1e4;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.goxasearchai-dropdown-footer a:hover {
  text-decoration: underline;
}

.goxasearchai-dropdown-empty {
  padding: 20px;
  text-align: center;
  color: #999;
  font-size: 13px;
}

/* ============================
   LOADING SPINNER
   ============================ */

.goxasearchai-dropdown-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  color: #888;
  font-size: 13px;
}

.goxasearchai-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #e9ecef;
  border-top-color: #ffc700;
  border-radius: 50%;
  animation: goxasearchai-spin 0.6s linear infinite;
  flex-shrink: 0;
}

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

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

@media (max-width: 768px) {
  .goxasearchai-wrapper {
    max-width: 100%;
    margin: 8px 0;
  }

  .goxasearchai-toggle {
    border-radius: 0;
  }

  .goxasearchai-mode-label {
    display: none;
  }

  .goxasearchai-mode-btn {
    padding: 0 10px;
  }

  .goxasearchai-input-wrapper {
    border-radius: 0 8px 8px 0;
  }
}

@media (max-width: 480px) {
  .goxasearchai-toggle {
    display: none;
  }

  .goxasearchai-input-wrapper {
    border-radius: 8px;
  }
}
