.header {
  background: #f7f9fc98;
  padding: 15px 0;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0; /* 🔹 AÑADIDO: asegura posición correcta */
  z-index: 1000;
  backdrop-filter: blur(10px);
  overflow-x: hidden;
  -webkit-backface-visibility: hidden; /* 🔹 AÑADIDO: mejora rendimiento en iOS */
  backface-visibility: hidden;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
}

/* Language Selector */
.language-selector {
  display: flex;
  gap: 8px;
  background: #f5f5f5;
  padding: 6px;
  border-radius: 25px;
  margin: 0 15px;
}

.lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 24px;
}

.lang-btn:hover {
  background: rgba(255, 107, 133, 0.1);
  transform: scale(1.05);
}

.lang-btn.active {
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.lang-btn .flag {
  font-size: 24px;
  line-height: 1;
}

/* Header Height */
.header {
  padding: 25px 0;
  min-height: 80px;
}

.nav-container {
  min-height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 22px;
  font-weight: bold;
  text-decoration: none;
  flex-shrink: 1;
  min-width: 0;
}

.logo-icon {
  width: 50px;
  height: auto;
}

.logo .match {
  color: #F87E79;
}

.logo .paw {
  color: #5BC5C5;
}

.nav-menu {
  display: flex;
  gap: 35px;
  align-items: center;
}

.nav-menu a {
  color: #2C3E50;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.nav-menu a:hover {
  color: #FF6B85;
}

.dropdown-arrow {
  font-size: 10px;
  margin-left: 5px;
}

.app-badge {
  background: #FF6B85;
  color: white;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: bold;
  position: absolute;
  top: -10px;
  right: -28px;
}

.donate-btn {
  background: #EA526F;
  color: white;
  padding: 10px 18px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
  flex-shrink: 0;
  white-space: nowrap;
}

.donate-btn:hover {
  background: #F87E79;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 133, 0.4);
}

/* 🔹 RESPONSIVE - Tablets */
@media (max-width: 768px) {
  .header {
    position: fixed; /* 🔹 REFORZADO: asegura que sea fijo en tablet */
    top: 0;
    left: 0;
    right: 0;
  }

  .nav-menu {
    display: none;
  }

  .language-selector {
    margin: 0 10px;
    padding: 4px;
    gap: 4px;
  }
  
  .lang-btn {
    width: 36px;
    height: 36px;
  }
  
  .lang-btn .flag {
    font-size: 20px;
  }

  .donate-btn {
    font-size: 14px;
    padding: 10px 16px;
  }

  .logo {
    font-size: 22px;
  }

  .logo-icon {
    width: 35px;
  }
}

/* 🔹 RESPONSIVE - Mobile pequeño */
@media (max-width: 480px) {
  .header {
    position: fixed; /* 🔹 REFORZADO: asegura que sea fijo en mobile */
    top: 0;
    left: 0;
    right: 0;
  }

  .nav-container {
    padding: 0 10px;
    gap: 8px;
  }

  .language-selector {
    margin: 0 5px;
    padding: 3px;
    gap: 3px;
  }

  .lang-btn {
    width: 32px;
    height: 32px;
  }

  .lang-btn .flag {
    font-size: 18px;
  }

  .donate-btn {
    font-size: 12px;
    padding: 8px 12px;
  }

  .logo {
    font-size: 18px;
  }

  .logo-icon {
    width: 30px;
  }
}

/* 🔹 RESPONSIVE - Mobile muy pequeño */
@media (max-width: 360px) {
  .header {
    position: fixed; /* 🔹 REFORZADO: asegura que sea fijo */
    top: 0;
    left: 0;
    right: 0;
  }

  .nav-container {
    padding: 0 8px;
  }

  .language-selector {
    margin: 0;
    padding: 2px;
    gap: 2px;
  }

  .lang-btn {
    width: 28px;
    height: 28px;
  }

  .lang-btn .flag {
    font-size: 16px;
  }

  .donate-btn {
    font-size: 11px;
    padding: 6px 10px;
  }

  .logo {
    font-size: 16px;
  }

  .logo-icon {
    width: 28px;
  }
}