/* ============================= */
/* VARIABLES Y RESET */
/* ============================= */
:root {
  --dark: #292927;
  --stone: #f1efe9;
  --yellow: #ffe362;
  --light-text: #D9D7D0;
  --max-width: 1200px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Montserrat', sans-serif;
  color: var(--dark);
  background: #ffffff;
  line-height: 1.6;
  padding-top: 110px; /* Espacio para header fijo */
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

.section-title-box {
    display: inline-block;
    padding: 16px 32px;
    border: 4px solid black;
    color: black;
    font-size: 22px;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 70px;
    text-align: center;
}

/* Si la sección tiene fondo oscuro */

.section-dark {
    color: #ffffff !important;
    display: inline-block;
    padding: 16px 32px;
    border: 3px solid #ffffff;
    font-size: 22px;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 70px;
    text-align: center;
}

/* ============================= */
/* HEADER (Fijo) */
/* ============================= */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgb(41 41 39);
  backdrop-filter: blur(8px);
  padding: 18px 0;
  z-index: 2000; /* Mayor que el hero */
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  height: 80px;
  margin-top: 10px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav a {
  color: var(--light-text);
  text-decoration: none;
  font-weight: 500;
  transition: 0.2s ease;
  border: 1px solid var(--light-text);
  padding: 8px 16px;
  text-transform: uppercase;
}

.nav a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

/* ============================= */
/* HAMBURGUESA */
/* ============================= */

.menu-toggle {
  display: none; /* Se oculta en desktop */
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  z-index: 2100; /* Por encima de todo */
}

.menu-toggle span {
  width: 30px;
  height: 3px;
  background-color: var(--yellow); /* Usamos el amarillo para que resalte mucho */
  transition: 0.3s ease;
  border-radius: 2px;
  display: block;
}

/* Animación cuando está abierto (clase .open que añade el JS) */
.menu-toggle.open span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ============================= */
/* HERO CON VIDEO */
/* ============================= */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--dark); /*Fondo de seguridad */
}

.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  transform: translate(-50%, -50%);
  z-index: 1;
  filter: blur(3px) brightness(0.9); /* Opcional: desenfoca un pelín y baja el brillo */
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(297deg, rgba(0, 0, 0, 0.85) 0%, rgb(0 0 0 / 55%) 50%, #000000a6 100%);
  z-index: 2; /* Obligatorio: mayor que el z-index del video (1) */
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 3; /* Por encima del video y el overlay */
}

.hero h1 {
  font-size: 54px;
  max-width: 800px;
  color: #ffffff;
  font-weight: 900;
  line-height: 1.1;
  text-align: left;
  margin-bottom: 20px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero p {
  font-size: 1.1rem;
  max-width: 650px;
  color: var(--light-text);
  text-align: left;
  margin-bottom: 35px;
  line-height: 1.6;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

/* ============================= */
/* FORMULARIO CONTACTO */
/* ============================*/

.contact-layout {
    background: var(--stone);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 40px;
    align-items: flex-start;
  }

  /* Formulario a la izquierda */
  .contact-form-block {
    flex: 1.5;
    min-width: 300px;
  }

  /* Datos a la derecha */
  .contact-info-block {
    flex: 1;
    min-width: 280px;
    padding-top: 20px;
  }

  .form-group { margin-bottom: 20px; }

  /* Estilo unificado para todos los campos incluido el select */
  .contact-form input, 
  .contact-form select, 
  .contact-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    font-family: inherit;
    font-size: 16px;
    box-sizing: border-box;
  }

  .btn-submit {
    width: 100%;
    padding: 18px;
    background: #333;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    letter-spacing: 1px;
  }

  .info-item { margin-bottom: 25px; }
  .info-item strong { display: block; font-size: 1.1em; margin-bottom: 5px; }
  .info-item a { color: #d32f2f; text-decoration: none; font-weight: bold; font-size: 1.2em; }

  /* Ajuste para móviles */
  @media (max-width: 768px) {
    .contact-layout { flex-direction: column; padding: 20px; }
    .contact-info-block { border-top: 1px solid #ddd; padding-top: 30px; }
  }

/* ============================= */
/* BOTONES */
/* ============================= */
.btn-dark {
  background: var(--dark);
  color: #ffffff;
  padding: 16px 36px;
  border-radius: 16px;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  transition: 0.3s;
}

.hero .btn-dark {
  background: var(--yellow); /* Destaca más sobre el video */
  color: var(--dark);
}

.btn-dark:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-stone {
  background: var(--stone);
  color: #000;
  padding: 16px 36px;
  border-radius: 16px;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  transition: 0.3s;
}

.hero .btn-stone {
  background: var(--yellow); /* Destaca más sobre el video */
  color: var(--dark);
}

.btn-stone:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.linkedin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 43px;
  height: 43px;
  border: 1px solid var(--light-text);
  transition: 0.2s ease;
}

.linkedin-btn svg {
  width: 18px;
  height: 18px;
  fill: var(--light-text);
}

.linkedin-btn:hover {
  background: var(--yellow);
  border-color: var(--yellow);
}

.linkedin-btn:hover svg {
  fill: var(--dark);
}

/* ============================= */
/* SECTORES */
/* ============================= */
.sectores {
  display: flex;
  flex-wrap: wrap;
}

.sector {
  flex: 1 1 50%;
  padding: 80px;
}

.industrial {
  background: var(--dark);
  color: white;
}

.residencial {
  background: var(--yellow);
  color: var(--dark);
}

.residencial h1 {
  line-height: 35px;
  margin: 15px 0;
}

.sector ul {
  list-style: none;
  margin-top: 20px;
}

/* ============================= */
/* SERVICIOS, KPI Y CLIENTES */
/* ============================= */
.servicios, .clientes {
  background: var(--stone);
  padding: 100px 0;
}

.servicios-grid, .kpis, .clientes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  margin-top: 60px;
}

.card, .cliente {
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.kpi {
  background: var(--dark);
  color: white;
  padding: 30px;
  border-radius: 20px;
  text-align: center;
}

.kpi strong {
  display: block;
  font-size: 36px;
  color: var(--yellow);
  font-weight: 900;
}


/* ============================= */
/*        SERVICES          */
/* ============================= */


.section-services {
  padding: 100px 20px;
  background: var(--stone);
  text-align: center;
}

.section-services h2 {
  font-size: 36px;
  margin-bottom: 20px;
  letter-spacing: 1px;
  color: var(--dark);
}

.section-services p.section-intro {
  max-width: 700px;
  margin: 0 auto 60px;
  color: #555;
  line-height: 1.6;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  max-width: 1200px;
  margin: auto;
}

.service-card {
  background: white;
  color: var(--text);
  padding: 40px 30px;
  border-radius: 14px;
  text-align: left;
  box-shadow: 0 15px 35px rgba(0,0,0,0.08);
  transition: transform 0.3s ease;
  border-top: 4px solid var(--yellow);
}

.service-card:hover {
  transform: translateY(-6px);
}

.service-icon {
  width: 55px;
  height: 55px;
  margin-bottom: 25px;
}

.service-icon svg {
  width: 100%;
  height: 100%;
  fill: var(--yellow);
}

.service-card h3 {
  font-size: 22px;
  margin-bottom: 15px;
  color: var(--dark);
}

.service-card p {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.service-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.service-card li {
  margin-bottom: 10px;
  position: relative;
  padding-left: 22px;
  font-size: 14px;
}

.service-card li::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: var(--yellow);
  font-size: 14px;
}

.sector.residencial {
  position: relative;
  background: #ffe362;
  color: #000;
  padding: 80px;
  overflow: hidden;
}

/* imagen marca de agua */

.sector.residencial::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url(logo_gry_bg.png);
    background-repeat: no-repeat;
    background-position: right -80px bottom 50px;
    background-size: 800px;
    opacity: 0.09;
    pointer-events: none;
}

/* contenido siempre por encima */

.sector.residencial * {
  position: relative;
  z-index: 2;
}


/* ============================= */
/* CLIENTES */
/* ============================= */

.cliente img {
  /*filter: grayscale(100%) brightness(0); /* Los hace silueta negra */
  opacity: 0.6;
  transition: all 0.3s ease;
  max-width: 150px; /* Ajusta según tu diseño */
}

.cliente:hover img {
  filter: grayscale(0%) brightness(1); /* Vuelven a su color original al pasar el ratón */
  opacity: 1;
}


/* ============================= */
/* CONTACTO Y FOOTER */
/* ============================= */
.contacto, .experiencia {
  padding: 100px 0;
}

.contact-form {
  max-width: 600px;
  margin: 40px auto 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-form input, .contact-form textarea {
  padding: 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

footer {
  background: var(--dark);
  color: var(--light-text);
  padding: 50px 0;
  text-align: center;
}

/* ============================= */
/* RESPONSIVE (MOBILE) */
/* ============================= */
@media (max-width: 768px) {
  body { padding-top: 130px; }

  .menu-toggle { display: flex; z-index: 2001; /* Un nivel por encima del header */ }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--dark);
    flex-direction: column;
    padding: 25px;
    display: none;
  }

  .nav.active { display: flex; }

  .hero { min-height: 70vh; }

  .hero h1 {
    font-size: 32px;
    line-height: 1.2;
  }

  .sectores { flex-direction: column; }
  
  .sector { padding: 40px 24px; }
}