/**
 * Header.css - Estilos para el header
 * 
 * Contiene todos los estilos específicos del encabezado del sitio
 */

/* --- HEADER MODERNO Y LIMPIO --- */
.site-header {
  background: #fff;
  box-shadow: 0 2px 8px rgba(61, 90, 254, 0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow 0.3s, background 0.3s;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  gap: 24px;
}

.site-branding {
  display: flex;
  align-items: center;
  margin-right: 32px;
}

.site-title {
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: 0.5px;
}

.site-title a {
  color: #1a56db;
  font-family: 'Poppins', sans-serif;
  text-decoration: none;
}

.custom-logo {
  max-height: 180px;
  width: auto;
  height: auto;
  transition: transform 0.3s;
}

.custom-logo:hover {
  transform: scale(1.05);
}

.menu-container {
  display: flex;
  align-items: center;
  background: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  max-width: none;
  flex: 1 1 auto;
}

.main-navigation {
  width: 100%;
}

.header-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 8px;
  justify-content: center;
  width: 100%;
}

.header-menu li {
  margin: 0;
  position: relative;
}

.header-menu a {
  display: flex;
  align-items: center;
  color: #2d5bd7;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  text-transform: uppercase;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.header-menu a:hover,
.header-menu .current-menu-item > a {
  background: #eaf1fb;
  color: #1a46af;
}

.header-menu i {
  margin-right: 6px;
  color: #4a7dfa;
  font-size: 17px;
}

/* Buscador */
.header-search {
  position: relative;
  width: 300px;
  margin-left: 24px;
}

.search-form {
  position: relative;
  width: 100%;
}

.search-field {
  width: 100%;
  padding: 10px 75px 10px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 25px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: #f8fafc;
  color: #334155;
}

/* Ocultar el botón de limpiar nativo del navegador */
.search-field::-webkit-search-cancel-button,
.search-field::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}
.search-field::-ms-clear {
  display: none;
}

.search-field:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

.search-clear {
  position: absolute;
  right: 45px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  z-index: 3;
  opacity: 0.7;
}

.search-clear:hover {
  color: #64748b;
  opacity: 1;
}

.search-submit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #3b82f6;
  padding: 0;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  z-index: 2;
}

.search-submit:hover {
  color: #2563eb;
}

/* Botón menú móvil */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  margin-right: 8px;
  padding: 8px;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 24px;
  height: 24px;
  justify-content: center;
}

.hamburger-line {
  width: 100%;
  height: 3px;
  background: #1a56db;
  border-radius: 2px;
  transition: all 0.3s;
}

/* --- RESPONSIVE HEADER --- */
@media (max-width: 991px) {
  .header-content {
    flex-wrap: wrap;
    gap: 12px;
  }
  .menu-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    box-shadow: 0 4px 16px rgba(61, 90, 254, 0.08);
    border-radius: 0 0 12px 12px;
    padding: 16px 0;
    z-index: 1001;
    display: none;
  }
  .menu-container.active {
    display: flex;
  }
  .header-menu {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }
  .header-menu li {
    width: 100%;
  }
  .header-menu a {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 24px;
    border-radius: 0;
  }
  .header-search {
    width: 100%;
    margin: 12px 0 0 0;
  }
  .mobile-menu-toggle {
    display: block;
  }
  .custom-logo {
    max-height: 130px;
  }
}

@media (max-width: 600px) {
  .header-content {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .site-branding {
    justify-content: center;
    margin: 0 0 8px 0;
  }
  .header-search {
    width: 100%;
    margin: 8px 0 0 0;
  }
  .custom-logo {
    max-height: 90px;
  }
}

/* Sugerencias de búsqueda */
.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 320px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  z-index: 1000;
  overflow: hidden;
  display: none;
}

.suggestions-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.suggestion-item {
  margin: 0;
  padding: 0;
}

.suggestion-link {
  display: flex;
  align-items: center;
  padding: 12px;
  text-decoration: none;
  color: #334155;
  border-radius: 8px;
  transition: all 0.2s ease;
  gap: 16px;
}

.suggestion-link:hover {
  background: #f1f5f9;
}

.suggestion-thumb {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-shrink: 0;
  padding: 4px;
}

.suggestion-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.suggestion-title {
  display: block;
  font-weight: 500;
  font-size: 14px;
  color: #1e293b;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-height: 2.6em;
}

.suggestion-price {
  display: block;
  font-size: 15px;
  color: #3b82f6;
  font-weight: 600;
}

.no-suggestions {
  padding: 16px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

/* Botón Ver todos los resultados */
.see-all-results {
  display: block;
  width: 100%;
  padding: 14px;
  text-align: center;
  background: #f8fafc;
  border: none;
  border-top: 1px solid #e2e8f0;
  color: #3b82f6;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.see-all-results:hover {
  background: #f1f5f9;
  color: #2563eb;
}

/* Responsive */
@media (max-width: 768px) {
  .header-search {
    width: 100%;
    margin: 10px 0 0;
  }
  
  .search-suggestions {
    width: 100%;
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    border-radius: 20px 20px 0 0;
    max-height: 80vh;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  }
  
  .suggestions-list {
    max-height: calc(80vh - 50px);
  }
}