/* RESET & BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  font-size: 100%;
  scroll-behavior: smooth;
}
body {
  font-family: Arial, sans-serif;
  color: #282828;
  overflow-x: hidden;
}

//* ============================
   X. NAVBAR (común a todas las páginas)
============================ */
:root {
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between; /* Logo izq, enlaces centro, hamburguesa der */
  background-color: #9a999e;
  padding: 10px 20px;
  position: relative;
   z-index: 1000; 
}

/* Logo */
.navbar .logo {
  flex: 0 0 auto;
}
.navbar .logo img {
  height: clamp(40px, 6vw, 60px);
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
}

/* Menú de enlaces centrado */
.nav-links {
  display: flex;
  flex: 1 1 auto;    /* Ocupa espacio central */
  justify-content: center;
  gap: 20px;          /* Separación uniforme */
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Cada enlace */
.nav-links li {
  margin: 0;
}
.nav-links li a {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  padding: 8px 12px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  transition: background-color 0.3s;
}

.nav-links li a:hover {
  background-color: #ce7036;
  border-radius: 4px;
}

/* Botón hamburguesa */
.hamburger {
  flex: 0 0 auto;
  display: none;
  font-size: clamp(1.5rem, 4vw, 2rem);
  cursor: pointer;
  color: #282828;
}

/* Ocultar checkbox */
#toggle {
  display: none;
}

/* Responsive: menú hamburguesa en móvil */
@media (max-width: 600px) {
  .hamburger {
    display: block;
  }
  .nav-links {
    position: absolute;
    top: 60px;
    right: 0;
    background-color: #9a999e;
    flex-direction: column;
    width: 100%;
    display: none;

    /* Nuevo: centramos los ítems */
    align-items: center;
  }
  .nav-links li {
    margin: 10px 0;
    width: 100%;             /* Ocupa todo el ancho del menú */
  }
  .nav-links li a {
    display: block;          /* Para que el width funcione */
    width: 100%;
    text-align: center;      /* Centrar el texto */
  }
  /* Mostrar menú al activar checkbox */
  #toggle:checked + .hamburger + .nav-links {
    display: flex;
  }
}


/* HERO */
.hero {
  position: relative;
  min-height: 60vh;
  background: url('/img/obras/ingenieria-electrica-011.jpg') center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 20px;
}
.hero-logo {
  max-width: 200px;
  margin: 0 auto 20px;
  display: block;
}
.hero-content h1 {
  font-size: clamp(1.5rem, 8vw, 3rem);
  color: #fff;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.7);
}
.hero-content h2 {
  font-size: clamp(1.2rem, 4vw, 2rem);
  color: #fff;
  margin-top: 10px;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.5);
}

/* CLIENTES */
.clients {
  background: #fff;
  padding: 40px 20px;
  text-align: center;
}
.clients h2 {
  font-size: clamp(1.2rem, 4vw, 2rem);
  color: #001e4f;
  margin-bottom: 20px;
}
.slider-container {
  position: relative;
  overflow: hidden;
  margin: 0 auto;
}
.slider-track {
  display: flex;
  gap: 60px;
  will-change: transform;
}
.slide {
  flex: 0 0 auto;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.arrow {
  position: absolute;
  bottom: 10px;
  background: #ce7036;
  color: #fff;
  border: none;
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.3s;
  z-index: 2;
}
.arrow:hover {
  opacity: 1;
}
.prev {
  left: 10px;
}
.next {
  right: 10px;
}

/* VIDEO */
.video-section {
  background: #011627;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.video-section h2 {
  color: #fff;
  font-size: 2rem;
  margin-bottom: 20px;
  text-align: center;
}
.video-container {
  position: relative;
  width: 70%;
  max-width: 800px;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}
.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.video-container.cropped iframe {
  width: 120%;
  height: 120%;
  top: -10%;
  left: -10%;
}
.video-caption {
  color: #fff;
  text-align: center;
  margin-top: 10px;
}

/* FOOTER */
footer {
  background: #014f6f;
  padding: 40px 20px;
  color: #fff;
}
.footer-container {
  display: flex;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}
.footer-box {
  width: 45%;
  padding: 20px;
}
.footer-icons a {
  margin-right: 10px;
  color: #fff;
  font-size: 1.2rem;
  transition: color 0.3s;
}
.footer-icons a:hover {
  color: #ffdd90;
}
.contact-data p {
  display: flex;
  align-items: center;
  margin: 8px 0;
}
.contact-data i {
  margin-right: 8px;
  color: #ffdd90;
}
.copyright {
  text-align: center;
  padding: 10px;
  color: #fff;
  background: #013b54;
}

/* COOKIES */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #282828;
  color: #fff;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  z-index: 1000;
}
.cookie-banner a {
  color: #ce7036;
  text-decoration: underline;
}
.cookie-banner button {
  background: #ce7036;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}
.cookie-banner button:hover {
  background: #b85c2d;
}

/* SPLASH SCREEN */
.splash-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.splash-overlay.active {
  display: flex;
}
.splash-content {
  position: relative;
  width: 80vw;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
}
.splash-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}
.splash-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
  line-height: 32px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}


.splash-close:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}

.splash-close:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(206, 112, 54, 0.5);
}

/* RESPONSIVE */
@media (max-width: 600px) {
  /* Mostrar hamburguesa */
  .hamburger {
    display: block;
  }
  /* Ocultar enlaces */
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #9a999e;
    flex-direction: column;
    display: none;
  }
  /* Enlaces a pantalla completa */
  .nav-links li a {
    text-align: center;
    padding: 12px 0;
    width: 100%;
  }
  /* Abrir menú al marcar checkbox */
  #toggle:checked + .hamburger + .nav-links {
    display: flex;
  }

  /* Footer responsivo */
  .footer-container {
    flex-direction: column;
    align-items: center;
  }
  .footer-box {
    width: 100%;
    margin-bottom: 20px;
    text-align: center;
  }

  /* Video y slider ajustes */
  .video-section h2 {
    font-size: 1.5rem;
  }
  .video-container {
    width: 90%;
  }
  .slide {
    width: 140px;
    height: 140px;
  }
  .arrow {
    font-size: 1.2rem;
    width: 30px;
    height: 30px;
  }
}
