:root {
  --verde: #008900;
  --verde-oscuro: #006b00;
  --gris-caja: #7c7c7c;
  --grad-a: #0298b0;
  --grad-b: #77d55c;
  --texto-claro: #ffffff;
  --radio: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
  background: url("assets/fondo.png") no-repeat center center fixed;
  background-size: cover;
  color: #222;
}

/* NAV */
header.navbar {
  background: var(--verde);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.logo {
  display: flex;
  align-items: center;
  margin-right: 20px;
}

.logo img {
  height: 46px;
}

nav.links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

nav.links a {
  color: #eafcea;
  text-decoration: none;
  font-size: 0.98rem;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

nav.links a:hover {
  background: rgba(255, 255, 255, 0.15);
}

nav.links a.activo {
  color: #ffffff;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
}

/* CONTENEDOR PRINCIPAL */
main.caja {
  max-width: 1100px;
  margin: 32px auto;
  background: var(--gris-caja);
  border-radius: 24px;
  padding: 48px 56px;
  color: var(--texto-claro);
}

main.caja h1 {
  font-size: 2.6rem;
  margin-top: 0;
  margin-bottom: 24px;
}

main.caja p {
  font-size: 1.15rem;
  line-height: 1.55;
}

.fila {
  display: flex;
  gap: 40px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.fila > * {
  flex: 1 1 320px;
}

.fila img {
  width: 100%;
  border-radius: 10px;
  display: block;
}

/* PAGINA PRINCIPAL */
.hero {
  text-align: center;
  margin-bottom: 32px;
}

.filtros {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.filtros button {
  border: none;
  background: #d9d9d9;
  color: #333;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.filtros button:hover {
  background: #c4c4c4;
}

.filtros button.activo {
  background: #2fb6a8;
  color: #fff;
}

.grid-proyectos {
  display: grid;
  /* Ancho FIJO por tarjeta (no 1fr) para que no se estiren al filtrar */
  grid-template-columns: repeat(auto-fill, 250px);
  justify-content: center;
  gap: 24px;
}

.grid-proyectos figure {
  margin: 0;
  width: 250px;
  border-radius: 10px;
  overflow: hidden;
  background: #999;
}

.grid-proyectos img {
  width: 250px;
  height: 190px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: transform 0.25s ease;
}

.grid-proyectos figure:hover img {
  transform: scale(1.05);
}

/* Cualquier foto de contenido marcada como "zoomable" (fuera de la galería) */
img.zoomable {
  cursor: zoom-in;
}

.grid-proyectos figcaption {
  text-align: center;
  padding: 8px;
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.25);
}

/* CONTACTO */
main.contacto {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 24px;
}

main.contacto h1 {
  text-align: center;
  font-size: 2.6rem;
  color: #111;
}

.form-tarjeta {
  max-width: 420px;
  margin: 0 auto;
  background: linear-gradient(160deg, var(--grad-a), var(--grad-b));
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.form-tarjeta label {
  display: block;
  color: #fff;
  font-weight: 600;
  margin-bottom: 6px;
  margin-top: 16px;
}

.form-tarjeta label:first-child {
  margin-top: 0;
}

.form-tarjeta input,
.form-tarjeta textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid #111;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
}

.form-tarjeta button {
  display: block;
  margin: 26px auto 0;
  background: #8f8f8f;
  color: #fff;
  border: none;
  padding: 14px 40px;
  border-radius: 24px;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.form-tarjeta button:hover {
  background: #7a7a7a;
}

.envio-estado {
  text-align: center;
  color: #fff;
  font-weight: 600;
  margin-top: 14px;
  min-height: 1.2em;
}

/* LIGHTBOX (pop-up de imagen en grande) */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.87);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  cursor: zoom-out;
}

.lightbox-overlay.activo {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-overlay img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-cerrar {
  position: absolute;
  top: 18px;
  right: 28px;
  color: #fff;
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

footer {
  text-align: center;
  padding: 30px 16px 40px;
  color: #444;
  font-size: 0.85rem;
}

@media (max-width: 720px) {
  main.caja {
    padding: 28px 22px;
    margin: 16px;
  }
  main.caja h1 {
    font-size: 2rem;
  }
  header.navbar {
    padding: 10px 14px;
  }
}
