/* ========================================================= */
/* BASE */
/* ========================================================= */

body {
  font-family: 'Montserrat', sans-serif;
  padding-top: 110px; /* espacio real para navbar fijo */
}

html {
  scroll-behavior: smooth;
}

img {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.h2 {
  text-wrap: balance;
}

/* ========================================================= */
/* BOTONES */
/* ========================================================= */

.btn {
  display: inline-block;
  padding: 8px 18px;
  font-size: 15px;
  font-weight: bold;
  color: #fff;
  background-color: #ff0000;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 8px 16px rgba(255, 0, 0, 0.3);
}

.btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(255, 0, 0, 0.5);
}

.btn:focus,
.btn:active {
  outline: none;
  transform: translateY(0);
  box-shadow: 0 8px 16px rgba(255, 0, 0, 0.3);
  opacity: 1;
  filter: none;
}

/* ========================================================= */
/* NAVBAR */
/* ========================================================= */

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  background: rgba(17, 24, 39, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  transition: background 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease;
}

header.scrolled {
  background: rgba(17, 24, 39, 0.92);
  border-bottom-color: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

/* Contenedor interno */
header > div {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

/* Logo navbar responsive */
.navbar-logo {
  height: 100%;
  max-height: 100%;
  width: auto;
}

.header-logo-link {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 2px;
}

/* Ajuste flex móvil */
@media (max-width: 767px) {
  header .flex {
    justify-content: space-between !important;
  }
}

/* Links */
nav a,
#mobile-menu a {
  position: relative;
}

/* Link activo */
nav a.active::after,
#mobile-menu a.active::after {
  content: '';
  position: absolute;
  left: 10%;
  bottom: -4px;
  width: 80%;
  height: 2px;
  background: #ff0000;
  border-radius: 2px;
}

/* Menú móvil */
#mobile-menu {
  background: rgba(17, 24, 39, 0.98);
  border-top: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.45);
}

#mobile-menu a {
  width: 100%;
  text-align: right;
}

/* Navbar moderno */
.nav-link {
  color: rgba(255, 255, 255, 0.86);
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover {
  color: #ffffff;
  transform: translateY(-1px);
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0%;
  height: 2px;
  background: #ff2e2e;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.mobile-link {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-link:last-child {
  border-bottom: none;
}

/* ========================================================= */
/* OFFSET SCROLL */
/* ========================================================= */

section {
  scroll-margin-top: 130px;
}

/* Capas: hero detrás y marcas encima */
#hero {
  position: relative;
  z-index: 0;
}

#marcas {
  position: relative;
  z-index: 10;
}

/* Ajuste de ancla para el hero con navbar fijo */
#hero {
  scroll-margin-top: 150px;
}

@media (min-width: 768px) {
  #hero {
    scroll-margin-top: 170px;
  }
}

/* Solapa la sección de marcas sobre el hero */
#marcas {
  margin-top: -80px;
  padding-top: 72px;
}

@media (min-width: 768px) {
  #marcas {
    margin-top: -110px;
    padding-top: 96px;
  }
}

/* Borde redondeado en clientes sin modificar espaciado */
#clientes {
  position: relative;
  border-bottom-left-radius: 3rem;
  border-bottom-right-radius: 3rem;
  overflow: hidden;
}

#contacto {
  position: relative;
  z-index: 10;
  padding-top: 140px;
}

@media (min-width: 768px) {
  #contacto {
    padding-top: 170px;
  }

}

/* ========================================================= */
/* SERVICIOS BACKGROUNDS */
/* ========================================================= */

.bg-servicio-1 {
  background-image: url('images/servicios/servicio1.jpg');
}
.bg-servicio-2 {
  background-image: url('images/servicios/servicio2.jpg');
}
.bg-servicio-3 {
  background-image: url('images/servicios/servicio3.jpg');
}

@supports (background-image: url('x.webp')) {
  .bg-servicio-1 {
    background-image: url('images-webp/servicios/servicio1.webp');
  }
  .bg-servicio-2 {
    background-image: url('images-webp/servicios/servicio2.webp');
  }
  .bg-servicio-3 {
    background-image: url('images-webp/servicios/servicio3.webp');
  }
}

/* ========================================================= */
/* PROTECCIÓN */
/* ========================================================= */

.relative {
  user-select: none;
  -webkit-user-drag: none;
}

/* ========================================================= */
/* HAMBURGUESA */
/* ========================================================= */

.hamburger {
  width: 32px;
  height: 24px;
  position: relative;
  cursor: pointer;
}

.hamburger span {
  position: absolute;
  width: 100%;
  height: 3px;
  background: white;
  left: 0;
  transition: all 0.4s ease;
  border-radius: 2px;
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 10px; }
.hamburger span:nth-child(3) { bottom: 0; }

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg);
  top: 10px;
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg);
  bottom: 10px;
}

/* ========================================================= */
/* CARRUSEL INFINITO LOGOS (MARQUESINA REAL) */
/* ========================================================= */

.logo-marquee {
  overflow: hidden;
  position: relative;
  width: 100%;
}

.logo-marquee-track {
  display: flex;
  width: max-content;
  animation: logo-scroll 35s linear infinite;
}

.logo-marquee-track:hover {
  animation-play-state: running; /* nunca se pausa */
}

.logo-marquee-item {
  flex: 0 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-marquee-item img {
  height: 80px;
  width: auto;
  object-fit: contain;
  opacity: 0.85;
}

@media (max-width: 768px) {
  .logo-marquee-item img {
    height: 60px;
  }
}

@keyframes logo-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}
