/* ══════════════════════════════════════════════════════
   ENCABEZADO COMPARTIDO — Harley Motos
   Un solo archivo para el header, buscador, nav y drawer.
   Se usa en todas las páginas del sitio (y en /admin).
══════════════════════════════════════════════════════ */

header { background: #000; color: #fff; }
.top-bar {
  display: flex; align-items: center;
  padding: 8px 32px; gap: 22px; min-height: unset;
}
.hamburger {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px; padding: 4px; flex-shrink: 0;
}
.hamburger span { display: block; width: 28px; height: 2.5px; background: #fff; border-radius: 2px; transition: background 0.2s; }
.hamburger:hover span { background: #60a5fa; }

.brand-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.brand-link:hover { opacity: 0.85; }
.brand-link:active { transform: scale(0.97); }
.brand-logo-img {
  height: 160px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 0 14px rgba(59, 130, 246, 0.5));
  transition: transform 0.25s;
}
.brand-link:hover .brand-logo-img { transform: scale(1.05) rotate(-2deg); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; flex-shrink: 0; margin-left: 8px; }
.brand-text .brand-line1 { color: #93c5fd; font-size: 10px; font-weight: 700; letter-spacing: 2.5px; }
.brand-text .brand-line2 {
  color: #fff; font-size: 22px; font-weight: 900; font-style: italic;
  letter-spacing: 1.8px; text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.search-wrap { flex: 1; display: flex; justify-content: flex-end; min-width: 0; }
.search-box {
  display: flex; align-items: center; gap: 10px;
  width: 100%; max-width: 380px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px; padding: 9px 18px;
  transition: background 0.2s, border-color 0.2s;
}
.search-box:hover { background: rgba(255,255,255,0.15); }
.search-box:focus-within { border-color: #3b82f6; background: rgba(59,130,246,0.12); }
.search-box svg { color: #9ca3af; flex-shrink: 0; width: 16px; height: 16px; stroke: #9ca3af; }
.search-box input { background: transparent; border: none; outline: none; color: #fff; font-size: 13.5px; width: 100%; }
.search-box input::placeholder { color: #9ca3af; }

nav.topnav { background: #000; border-top: 1px solid #1f2937; }
nav.topnav ul {
  display: flex; flex-wrap: nowrap; justify-content: space-between;
  align-items: center; list-style: none;
  padding: 0 20px; margin: 0; width: 100%; min-height: 56px; gap: 4px;
}
nav.topnav ul li { flex: 1; display: flex; justify-content: center; min-width: 0; }
nav.topnav ul li a {
  background: none; border: none; color: #60a5fa;
  font-size: 13px; font-weight: bold; letter-spacing: 1.2px;
  padding: 16px 6px; cursor: pointer; transition: color 0.2s;
  white-space: nowrap; width: 100%; text-align: center;
  text-decoration: none; display: block;
}
nav.topnav ul li a:hover { color: #fff; }
nav.topnav ul li a.active-tab { color: #fff; position: relative; }
nav.topnav ul li a.active-tab::after {
  content: ""; position: absolute; left: 20%; right: 20%; bottom: 6px;
  height: 2px; background: #3b82f6; border-radius: 2px;
}

.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 40; }
.overlay.open { display: block; }

.drawer {
  position: fixed; top: 0; left: 0; height: 100%; width: 288px;
  background: #111827; color: #fff; z-index: 50;
  box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  transform: translateX(-100%); transition: transform 0.3s ease;
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-close { display: flex; justify-content: flex-end; padding: 16px; flex-shrink: 0; }
.drawer-close button { background: none; border: none; color: #9ca3af; cursor: pointer; display: flex; padding: 4px; }
.drawer-close button:hover { color: #fff; }
.drawer-close button svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }
.drawer nav { border-top: none; flex: 1; overflow-y: auto; background: transparent; }
.drawer nav ul { flex-direction: column; justify-content: flex-start; padding: 0; gap: 0; min-height: unset; flex-wrap: wrap; list-style: none; display: flex; }
.drawer nav ul li { width: 100%; flex: unset; display: block; }
.drawer nav ul li a {
  width: 100%; text-align: left; color: #e5e7eb; font-size: 14px; font-weight: 500;
  padding: 14px 24px; letter-spacing: 0.3px; border-bottom: 1px solid #1f2937;
  margin: 0; border-radius: 0; text-decoration: none;
  display: flex; align-items: center; gap: 12px;
  transition: background 0.2s, color 0.2s, padding-left 0.2s;
}
.drawer nav ul li a svg,
.drawer-bottom button svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; flex-shrink: 0; }
.drawer nav ul li a:hover { background: #1f2937; color: #fff; padding-left: 30px; }
.drawer-bottom { flex-shrink: 0; border-top: 1px solid #374151; }
.drawer-bottom button {
  width: 100%; text-align: left; background: none; border: none;
  font-size: 14px; font-weight: 500; padding: 16px 24px; cursor: pointer;
  border-bottom: 1px solid #1f2937; color: #e5e7eb; transition: background 0.2s;
  font-family: inherit; display: flex; align-items: center; gap: 12px;
}
.drawer-bottom button:last-child { border-bottom: none; color: #60a5fa; }
.drawer-bottom button:hover { background: #1f2937; }

/* ══════════════════════════════════════════════════════
   RESPONSIVE — MÓVIL
   En categorías/admin el menú de arriba (LLANTAS, REPUESTOS...)
   se oculta en móvil; solo queda el hamburguesa. En el inicio
   (nav.hero-topnav) esos botones se conservan porque ahí sí
   deben verse en móvil.
══════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .top-bar { padding: 8px 14px; gap: 10px; }
  .brand-logo-img { height: 42px; }
  .brand-text { margin-left: 6px; }
  .brand-text .brand-line1 { font-size: 7.5px; letter-spacing: 1.5px; }
  .brand-text .brand-line2 { font-size: 15px; letter-spacing: 1px; }
  .search-box { padding: 7px 12px; }
  .search-box input { font-size: 12.5px; }

  nav.topnav:not(.hero-topnav) { display: none; }
}
