/* ===== RESET BÁSICO ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== VARIABLES ===== */
:root {
  --azul: #1b827d;
  --blanco: #ffffff;
  --gris-suave: #f5f7fa;
  --header-height: 110px;
}

/* ===== BASE ===== */
body {
  font-family: "Segoe UI", Arial, sans-serif;
  color: #333;
  line-height: 1.6;
  background: var(--blanco);
  position: relative;
}

/* Fondo con logo */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("../img/logo-ilerdynamic.png") center no-repeat;
  background-size: 600px;
  opacity: 0.4;
  filter: blur(2px);
  z-index: -1;
}

/* Evita problemas con imágenes */
img {
  max-width: 100%;
  height: auto;
}

/* Scroll correcto con header fijo */
section,
.hero {
  scroll-margin-top: var(--header-height);
}

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  position: relative;

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 15px 40px;
  margin-bottom: 10px;

  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);

  border-bottom: 2px solid var(--azul);
}

.logo img {
  height: 80px;
  max-width: 250px;
  object-fit: contain;
}

/* ===== MENÚ ===== */
nav ul {
  list-style: none;
  display: flex;
  gap: 40px;
}

nav a {
  text-decoration: none;
  color: var(--azul);
  font-weight: 700;
  font-size: 1.3rem;
  transition: 0.3s;
}

nav a:hover {
  color: #154443;
  transform: scale(1.05);
}

/* ===== IDIOMAS ===== */
#lang-switch {
  position: absolute;
  top: 8px;
  right: 20px;
  font-size: 0.8rem;
}

#lang-switch a {
  padding: 0 4px;
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(rgba(32, 148, 129, 0.85), rgba(10, 42, 94, 0.85)),
    url("../img/PROYECTOS.jpeg") center/cover no-repeat;

  color: var(--blanco);
  text-align: center;
  padding: 100px 20px;
}

.hero h1 {
  font-size: 2.6rem;
  margin-bottom: 15px;
}

.hero p {
  max-width: 800px;
  margin: auto;
}

/* ===== SECCIONES ===== */
section {
  padding: 60px 20px;
  max-width: 1200px;
  margin: auto;

  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
}

section h2 {
  color: var(--azul);
  border-left: 5px solid var(--azul);
  padding-left: 10px;
  margin-bottom: 25px;
}

/* ===== SERVICIOS ===== */
.servicios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.servicio {
  background: var(--gris-suave);
  padding: 20px;
  border-radius: 8px;
  text-align: center;

  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: 0.2s;
}

.servicio:hover {
  transform: translateY(-5px);
}

.servicio img {
  height: 180px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 10px;
}

.servicio h3 {
  color: var(--azul);
}

/* ===== BOTONES ===== */
button,
.btn-mapa {
  display: inline-block;
  background-color: var(--azul);
  color: var(--blanco);
  padding: 10px 20px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s;
}

button:hover,
.btn-mapa:hover {
  background-color: #003b8e;
  transform: scale(1.03);
}

/* ===== MAPA ===== */
.mapa iframe {
  width: 100%;
  height: 350px;
  border: 0;
  border-radius: 8px;
}

.direccion {
  text-align: center;
  margin-top: 20px;
  color: var(--azul);
  font-weight: 600;
}

.direccion .btn-mapa {
  margin-top: 15px;
}

/* ===== FORMULARIO ===== */
.contacto form {
  display: grid;
  gap: 15px;
  max-width: 600px;
  margin: auto;
}

input,
textarea {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

/* ===== FOOTER ===== */
footer {
  background-color: var(--azul);
  color: var(--blanco);
  text-align: center;
  padding: 20px;
}

footer a {
  color: var(--blanco);
  text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  header {
    flex-direction: column;
    text-align: center;
  }

  nav ul {
    flex-direction: column;
    gap: 15px;
  }

  .logo img {
    height: 60px;
  }

  #lang-switch {
    position: static;
    width: 100%;
    text-align: right;
    margin: 6px 0 14px;
  }
}