:root {
  --background_color: white;
  --main-color: rgb(208, 30, 72);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 62.5%;
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande",
    "Lucida Sans", Arial, sans-serif;
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  background-color: #eef2f6;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: black;
}

.header {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.6rem 6rem;
  padding: 0.3rem 6rem;
  background-color: var(--background_color);
  transition: padding 0.3s ease;
  z-index: 1000;
}

.header.shrink {
  padding: 0rem 8rem 0rem 2rem; /* reducido pero visible */
}

.header.shrink a {
  font-size: 1.6rem;
}

.header__logo {
  width: 16rem;
}

.header__logo img {
  width: 100%;
}

.header__nav ul {
  display: flex;
  gap: 3.2rem; /* separación clara entre enlaces */
  font-size: 1.8rem;
  margin: 0;
}

.header a {
  transition: font-size 0.3s ease;
  font-size: 1.8rem;
}

/* Hero */

.hero {
  font-size: 1.8rem; /* texto base ≈18px */
  padding: 0 2.4rem;
  height: 100vh;
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url(../src/puebla.webp);
  background-repeat: no-repeat;
  background-size: cover;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background-position: center center;
  color: whitesmoke;
}

.hero-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.4rem;
}

.hero-content h1 {
  font-size: 5.2rem; /* ≈52px título principal */
  margin-bottom: 2.4rem;
}

.hero-servicios {
  width: fit-content;
  color: #eef2f6;
  background-color: rgb(208, 30, 72);
  font-size: 2rem; /* ≈20px */
  padding: 1.2rem 2.4rem; /* mejor proporción */
  border-radius: 0.8rem;
}

.servicios p {
  margin-bottom: 1.6rem;
}

.servicios ul {
  list-style-type: disc;
  font-size: 2rem;
}

.servicios {
  padding: 6.4rem 2.4rem;
  background-color: #f9fafb;
  text-align: center;
}

.servicios h2 {
  font-size: 3.2rem;
  margin-top: 6rem;
  margin-bottom: 4rem;
}

.servicios-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3.2rem;
}

.servicio-card {
  background: white;
  padding: 2.4rem;
  border-radius: 1.2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.servicio-card:hover {
  transform: translateY(-0.8rem);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.servicio-card img {
  width: 5rem;
  margin-bottom: 1.6rem;
}

.servicio-card h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #d01e48;
}

.servicio-card p {
  font-size: 1.6rem;
  line-height: 1.5;
  color: #444;
}

.material-symbols-rounded,
.i {
  font-size: 8rem;
  color: #d01e48; /* tu color de hero-servicios */
}

.call {
  color: var(--background_color);
}

h2 {
  font-size: 3.2rem;
  margin: 6rem 0;
  /* margin-top: 0rem; */
  margin-bottom: 4rem;
  text-align: center;
}

.ubicacion {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  /* height: 100vh; */
  padding: 4rem 2rem;
}

.ubicacion p {
  font-size: 2rem;
}

.ubicacion iframe {
  width: 100%;
  max-width: 800px; /* opcional: limita el ancho en pantallas grandes */
  height: 500px;
  border: 0;
  border-radius: 1rem;
}

.contacto span {
  font-weight: 500;
  font-size: 2.4rem;
}

.contacto p {
  font-size: 2rem;
  margin-bottom: 2.4rem;
}

.contacto-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.4rem;
}

.contacto-container .atencion p {
  font-size: 1.8rem;
  margin: 0;
  text-align: left;
}

.contacto-container .atencion b {
  font-size: 2rem;
  text-align: left;
  font-weight: bold;
}

.contacto-container .atencion {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contacto-card:hover {
  transform: translateY(-0.4rem);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.contact-icons {
  font-size: 2.4rem;
  color: #d01e48;
}

.contacto-card img.contact-icons {
  width: 2.4rem;
  height: 2.4rem;
}

.contacto-form input,
textarea {
  padding: 1.8rem;
  border: 0;
}

.contacto-form textarea {
  resize: none;
  height: 16rem;
}

.contacto {
  display: flex;
  flex-direction: column;
  padding: 3rem 2rem;
  background-color: #f9fafb;
  text-align: center;
  /* height: 100vh; */
}

.main-contacto-container {
  display: grid;
  grid-template-columns: 40% 60%;
  grid-template-areas: "izquierda derecha";
  padding: 0 2rem;
  gap: 4rem;
}

.contacto-info {
  grid-area: izquierda;
  background-color: white;
  place-items: center;
  padding: 2rem;
  border-radius: 1rem; /* esquinas redondeadas */
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12); /* sombra suave */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contacto-form {
  grid-area: derecha;
}

.contacto-container {
  flex: 1;
  min-width: 28rem;
  text-align: left;
}

.contacto-container span {
  font-weight: 600;
  font-size: 2.2rem;
  display: block;
}

.contacto-container p {
  font-size: 1.8rem;
  margin-bottom: 2rem;
}

.contacto-card-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.contacto-card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80%;
  gap: 1rem;
  padding: 1.5rem 1.5rem;
  background: var(--main-color);
  border-radius: 0.8rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s, box-shadow 0.3s;
}

.contacto-card:hover {
  transform: translateY(-0.3rem);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.contacto-card a {
  font-size: 1.8rem;
  color: white;
}

.contacto-card img.contact-icons {
  width: 2.4rem;
  height: 2.4rem;
}

.contact-img-container {
  display: flex;
  justify-content: center;
  width: 100%;
}

.contact-img-container img {
  width: 400px;
}

/* Contenedor del formulario */
.contacto-form {
  padding: 0 50px;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  width: 100%;
  max-width: 100rem;
  height: 100%;
  margin: auto;
}

/* Cada grupo */
.form-group {
  position: relative;
  width: 100%;
}

/* Inputs y textarea */
.contacto-form input,
.contacto-form textarea {
  width: 100%;
  padding: 15px 20px 12px 20px;
  border: 2px solid var(--main-color);
  border-radius: 10px;
  font-size: 1.8rem;
  background: transparent;
  color: var(--main-color);
  outline: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

/* Label */
.contacto-form label {
  position: absolute;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  font-size: 2rem;
  color: var(--main-color);
  pointer-events: none;
  background-color: var(--background_color); /* mismo color del fondo */
  padding: 0 6px;
  transition: 0.2s ease;
}

.contacto-form .txtarea label {
  top: 25%;
}

/* Focus o con valor */
.contacto-form input:focus,
.contacto-form textarea:focus,
.contacto-form input:valid,
.contacto-form textarea:valid {
  border-color: var(--main-color);
}

/* mantenemos tus reglas de focus/valid, y añadimos filled */
.contacto-form input.filled + label,
.contacto-form textarea.filled + label {
  top: 0;
  left: 12px;
  transform: translateY(-50%);
  font-size: 1.6rem;
  color: var(--main-color);
}

/* Label animado: se pega al borde */
.contacto-form input:focus + label,
.contacto-form input:valid + label,
.contacto-form textarea:focus + label,
.contacto-form textarea:valid + label {
  top: 0; /* se sube al borde superior */
  left: 12px;
  transform: translateY(-50%); /* mitad del grosor del borde */
  font-size: 1.6rem;
  color: var(--main-color);
}

.btn-enviar {
  width: fit-content;
  color: #eef2f6;
  background-color: var(--main-color);
  font-size: 1.8rem; /* ≈20px */
  padding: 1.2rem 2.4rem; /* mejor proporción */
  border-radius: 0.8rem;
  border: none;
  cursor: pointer;
}

@media (max-width: 768px) {
  .main-contacto-container {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    padding: 0;
  }

  .contacto-container,
  .contacto-form {
    min-width: 100%;
  }

  .contacto-form::before {
    content: "Envíanos un mensaje";
    font-size: 2.4rem;
    font-weight: bold;
    text-align: left;
  }
}

.footer {
  font-size: 1.8rem;
  color: gray;
  text-align: center;
  background-color: #eef2f6;
  padding: 2rem 0;
}

.menu {
  transition: transform 0.5s ease;
  transform: rotate(0deg);
}

.menu.girar {
  transition: transform 0.5s ease;
  transform: rotate(180deg);
}

.nav-toggle {
  display: none;
}

/* --- Hero de Proyectos --- */
.proyectos-hero {
  position: relative;
  width: 100%;
  height: 300px;
  background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
    url(../src/arch.jpg);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.proyectos-hero::before {
  content: "Proyectos";
  position: absolute;
  font-size: 4rem;
  font-weight: bold;
  text-align: center;
  transform: translate(-50%, -50%);
  top: 50%;
  left: 50%;
  pointer-events: none;
}

/* --- Grid de Proyectos --- */
.proyectos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  padding: 4rem;
}

/* .proyectos-grid .card {
  background-color: whitesmoke;
  margin: 0 auto;
  width: 100%;
  height: 50%;
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 1px rgba(0,0,0,0.15);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
} */

.card-v2 {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* imagen arriba */
.card-img-container {
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
}
.card-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* cuerpo visible */
.card-body {
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex: 1 1 auto;
}
.card-v2-title {
  font-size: 1.6rem;
}
.card-v2-description {
  display: none;
  color: #555;
  font-size: 1.4rem;
}

/* botón */
.ver-descripcion {
  margin-top: auto;
  align-self: flex-start;
  background: var(--main-color);
  color: #fff;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 0.6rem;
  cursor: pointer;
  font-size: 1.4rem;
}

/* OVERLAY (oculto por defecto, cubre toda la card) */
.card-overlay {
  position: absolute;
  inset: 0; /* top/right/bottom/left = 0 */
  background: rgba(255, 255, 255, 0.98);
  transform: translateY(100%); /* escondida abajo */
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
  display: flex;
  flex-direction: column;
  padding: 1.2rem;
  z-index: 20;
  pointer-events: none;
}

/* close button */
.overlay-close {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  margin-left: auto;
  cursor: pointer;
}

/* contenido dentro de overlay */
.overlay-header{
  display: flex;
  justify-content: space-between;
}
.overlay-content {
  overflow: auto;
  padding-top: 0.4rem;
}
.overlay-content h3 {
  margin: 0 0 0.6rem 0;
  font-size: 1.6rem;
}
.overlay-content p {
  font-size: 1.4rem;
  color: #333;
  line-height: 1.5;
}

/* --- Clase que activa el overlay completo (a la que el JS añadirá) --- */
.card-v2.expanded .card-overlay {
  transform: translateY(70%); /* overlay cubre toda la card */
  pointer-events: auto;
}

/* small screens: hover no fiable, overlay abierto ocupa toda la pantalla visualmente */
@media (max-width: 768px) {
  .card-overlay {
    background: #fff;
  }
  .card-v2.expanded .card-overlay {
    transform: translateY(0);
  }
}

.proyectos-grid .card:hover {
  transform: translateY(-0.5rem);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.card .card-img-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.card .card-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card .card-img-container img:hover {
  transform: scale(1.05);
}

.card p {
  padding: 0.1rem 1rem;
  font-size: 1.8rem;
  font-weight: 500;
  color: #333;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .proyectos-hero {
    height: 250px;
  }

  .proyectos-hero::before {
    font-size: 3rem;
  }
}

@media (max-width: 768px) {
  .proyectos-hero {
    height: 200px;
  }

  .proyectos-hero::before {
    font-size: 2.4rem;
  }

  .proyectos-grid {
    grid-template-columns: 1fr; /* 1 columna en móvil */
    gap: 2.5rem;
    padding: 2rem;
  }

  .card p {
    font-size: 1.6rem;
  }
}

@media (max-width: 480px) {
  .proyectos-hero {
    height: 180px;
  }

  .proyectos-hero::before {
    font-size: 2rem;
  }

  .proyectos-grid {
    padding: 2.5rem;
    gap: 2rem;
  }
}

/* Por debajo de 768 */
@media (max-width: 768px) {
  .header {
    width: 100%;
    padding: 0;
  }

  .hero {
    width: 100%;
    padding: 0;
  }

  .hero-content h1 {
    font-size: 2.6rem;
    padding: 2rem;
  }

  .servicios-grid {
    display: flex;
    flex-direction: column;
  }

  .contacto-info {
    display: flex;
    flex-direction: column;
  }

  .header {
    display: block;
  }

  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-toggle p {
    font-size: 2rem;
  }

  .menu {
    font-size: 4.8rem;
  }

  .header__logo {
    margin: 0 auto;
    padding: 8px;
  }

  .header__nav {
    opacity: 1;
    transform: translateY(0);
  }

  /* menú cerrado por defecto */
  .header__nav {
    max-height: none; /* quitamos limitación de altura */
    padding: 0 2rem; /* padding cerrado */
    overflow: hidden;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #d01e48;
    transform: translateY(-12px); /* empieza un poco levantado */
    opacity: 0; /* invisible */
    visibility: hidden; /* evita clicks */
    pointer-events: none; /* no interactuable */
    transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1),
      opacity 0.28s ease, padding 0.28s ease, visibility 0s linear 0.28s; /* visibilidad se retrasa hasta desaparecer */
    z-index: 1200;
  }

  /* menú abierto */
  .header__nav.open {
    transform: translateY(0); /* baja suavemente */
    opacity: 1; /* visible */
    visibility: visible; /* interactuable */
    pointer-events: auto; /* clicks habilitados */
    padding: 2rem 2rem; /* padding interior al abrir */
    transition-delay: 0s; /* transición inmediata al abrir */
  }

  .nav__list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0.5rem 0;
  }

  .nav__list li a {
    display: block;
    padding: 1rem 2rem;
    color: #eef2f6;
  }

  iframe {
    width: 100%;
  }

  .footer {
    padding: 2rem 0;
  }
}


