/* =========================
   HEADER BASE
========================= */

.site-header {
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 9999;
}

/* =========================
   TOP HEADER
========================= */

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  gap: 16px;
}

/* Teléfono */
.header-phone {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray);
  white-space: nowrap;
}

/* Logo */
.header-logo {
  display: flex;
  justify-content: center;
}

.header-logo img {
  max-height: 52px;
  width: auto;
}

/* Botón contacto */
.header-contact-btn {
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--gradient-primary);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(79, 110, 247, 0.35);
  transition: transform 0.25s ease;
}

.header-contact-btn:hover {
  transform: translateY(-2px);
}

/* =========================
   NAV DESKTOP
========================= */

.header-nav {
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
}

.header-nav ul {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: center;
  gap: 26px;
  list-style: none;
}

.header-nav a {
  display: block;
  padding: 16px 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--dark);
  position: relative;
  text-decoration: none;
}

/* underline desktop */
.header-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 8px;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.header-nav a:hover::after {
  width: 100%;
}

/* =========================
   HAMBURGUESA
========================= */

.header-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 10000;
}

.header-burger span {
  width: 22px;
  height: 2px;
  background: var(--dark);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.header-burger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.header-burger.active span:nth-child(2) {
  opacity: 0;
}

.header-burger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =========================
   MOBILE / TABLET
========================= */

@media (max-width: 992px) {

  body {
    overflow-x: hidden;
  }

  .header-top {
    padding: 12px 16px;
    gap: 12px;
  }

  .header-phone {
    display: none;
  }

  .header-logo {
    order: 1;
    justify-content: flex-start;
  }

  .header-logo img {
    max-height: 42px;
  }

  .header-contact-btn {
    order: 2;
    padding: 8px 16px;
    font-size: 0.75rem;
    margin-left: auto;
    margin-right: 12px;
  }

  .header-burger {
    order: 3;
    display: flex;
  }

  /* NAV MOBILE */
  .header-nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    overflow-y: auto;
    background: #ffffff;
    transition: max-height 0.4s ease;
    border-bottom: 1px solid #e5e7eb;
  }

  .header-nav.open {
    max-height: 100vh;
  }

  .header-nav ul {
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
    gap: 18px;
  }

  .header-nav a {
    font-size: 1rem;
    padding: 14px 0;
    width: 100%;
    text-align: center;
  }

  /* feedback táctil elegante */
  .header-nav a:active {
    opacity: 0.65;
    transform: scale(0.97);
  }
}

/* =========================
   FIX DEFINITIVO TAP / FOCUS
========================= */

/* Elimina highlight azul */
.header-nav,
.header-nav * {
  -webkit-tap-highlight-color: transparent;
}

/* Elimina foco visual de Chrome */
.header-nav a {
  outline: none;
  background-color: transparent;
  box-shadow: 0 0 0 0 transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.header-nav a:focus,
.header-nav a:focus-visible {
  outline: none !important;
  background-color: transparent !important;
  box-shadow: 0 0 0 0 transparent !important;
}
/* =========================
   FIX TAP AZUL MOBILE
========================= */

/* Elimina highlight azul en tap (Android / iOS) */
.header-burger,
.header-burger *,
.header-nav,
.header-nav * {
  -webkit-tap-highlight-color: transparent;
}

/* Quita focus visual solo en mobile */
@media (max-width: 992px) {
  .header-nav a,
  .header-burger {
    outline: none;
    background-color: transparent;
    box-shadow: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  .header-nav a:focus,
  .header-nav a:focus-visible,
  .header-burger:focus,
  .header-burger:focus-visible {
    outline: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
  }
}
