/* =========================================================
   F y G Servicios Constructivos — hoja de estilos principal
   Mobile-first. Sin frameworks externos (Bootstrap, etc.)
   ========================================================= */

/* ---------- 1. Variables de marca ---------- */
:root {
  /* Paleta basada en el logo nuevo (casco + engrane naranja sobre negro) */
  --color-ink: #1a1a1a;          /* negro/carbón — header, footer, secciones oscuras */
  --color-ink-soft: #262624;
  --color-orange: #f2921c;       /* naranja de marca (tomado del logo) */
  --color-orange-dark: #c96f0f;  /* hover / estados activos */
  --color-orange-tint: #fdf0dd;  /* fondos suaves de acento */
  --color-paper: #faf9f7;        /* fondo general de página */
  --color-white: #ffffff;
  --color-steel: #4a5560;        /* texto secundario */
  --color-steel-light: #8993a0;
  --color-border: #e6e2db;

  --font-heading: 'Poppins', 'Segoe UI', Arial, sans-serif;
  --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;

  --radius: 6px;
  --shadow-sm: 0 1px 3px rgba(26, 26, 26, 0.08);
  --shadow-md: 0 8px 24px rgba(26, 26, 26, 0.12);
  --container-w: 1160px;
}

/* ---------- 2. Reset básico ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
[id] { scroll-margin-top: 96px; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.2; margin: 0 0 0.6em; font-weight: 700; }
p { margin: 0 0 1em; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 1rem; }

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 20px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- 3. Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border: 2px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.btn-primary {
  background: var(--color-orange);
  color: var(--color-ink);
}
.btn-primary:hover { background: var(--color-orange-dark); color: var(--color-white); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border-color: var(--color-white);
  color: var(--color-white);
}
.btn-outline:hover { background: var(--color-white); color: var(--color-ink); }
.btn-dark {
  background: var(--color-ink);
  color: var(--color-white);
}
.btn-dark:hover { background: var(--color-orange); color: var(--color-ink); }
.btn-block { width: 100%; }

/* ---------- 4. Header / Navegación ---------- */
.site-header {
  background: var(--color-ink);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-white);
}
.brand img { height: 44px; width: auto; transition: height 0.3s ease; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-heading); font-size: 1.15rem; letter-spacing: 0.03em; }
.brand-text span { font-size: 0.68rem; color: var(--color-orange); letter-spacing: 0.12em; text-transform: uppercase; }

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  padding: 8px;
  z-index: 110;
}
.nav-toggle span {
  width: 26px; height: 2px; background: var(--color-white); border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.main-nav {
  position: fixed;
  inset: 0 0 0 30%;
  background: var(--color-ink);
  padding: 100px 32px 32px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}
.main-nav.is-open { transform: translateX(0); }
.main-nav ul { display: flex; flex-direction: column; gap: 4px; }
.main-nav a {
  display: block;
  color: var(--color-white);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  padding: 14px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.main-nav a:hover, .main-nav a.is-active { color: var(--color-orange); }
.main-nav .nav-cta { margin-top: 20px; }

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .main-nav {
    position: static;
    inset: auto;
    background: transparent;
    padding: 0;
    transform: none;
    overflow: visible;
  }
  .main-nav ul { flex-direction: row; align-items: center; gap: 4px; }
  .main-nav a { border-bottom: none; padding: 10px 14px; font-size: 0.92rem; }
  .main-nav .nav-cta { margin-top: 0; margin-left: 8px; }
}

/* ---------- 5. Hero ---------- */
.hero {
  position: relative;
  color: var(--color-white);
  background: linear-gradient(180deg, rgba(26,26,26,0.55), rgba(26,26,26,0.82)), var(--color-ink);
  background-size: cover;
  background-position: center;
}
.hero .container { padding-top: 90px; padding-bottom: 70px; }
.hero-eyebrow {
  display: inline-block;
  color: var(--color-orange);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-bottom: 14px;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); max-width: 16ch; }
.hero p.lead { font-size: 1.1rem; max-width: 55ch; color: #e7e5e1; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

.page-hero {
  background: var(--color-ink);
  color: var(--color-white);
  padding: 64px 0 44px;
}
.page-hero .hero-eyebrow { margin-bottom: 10px; }
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 10px; }
.page-hero p { color: #d9d6d0; max-width: 60ch; margin: 0; }

/* ---------- 6. Secciones genéricas ---------- */
.section { padding: 64px 0; }
.section-tight { padding: 40px 0; }
.section-alt { background: var(--color-white); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.section-dark { background: var(--color-ink); color: var(--color-white); }
.section-head { max-width: 62ch; margin-bottom: 40px; }
.section-head .hero-eyebrow { color: var(--color-orange-dark); }
.section-dark .section-head .hero-eyebrow { color: var(--color-orange); }
.section-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
.section-head p { color: var(--color-steel); }
.section-dark .section-head p { color: #d9d6d0; }

/* ---------- 7. Grids ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- 8. Tarjetas de servicio ---------- */
.card-service {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-service:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card-service .icon-badge {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-orange-tint);
  color: var(--color-orange-dark);
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 1.5rem;
}
.card-service h3 { font-size: 1.15rem; margin-bottom: 10px; }
.card-service p { color: var(--color-steel); font-size: 0.95rem; margin-bottom: 0; }
.card-service ul { margin-top: 10px; }
.card-service li { color: var(--color-steel); font-size: 0.92rem; padding-left: 18px; position: relative; margin-bottom: 6px; }
.card-service li::before {
  content: "";
  position: absolute; left: 0; top: 0.55em;
  width: 7px; height: 7px; background: var(--color-orange); border-radius: 2px;
}

/* ---------- 9. Galería de proyectos ---------- */
.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-ink);
  box-shadow: var(--shadow-sm);
}
.gallery-item img { width: 100%; height: 260px; object-fit: cover; transition: transform 0.35s ease; }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 16px 12px;
  background: linear-gradient(0deg, rgba(0,0,0,0.75), rgba(0,0,0,0));
  color: var(--color-white);
}
.gallery-caption strong { display: block; font-family: var(--font-heading); font-size: 0.95rem; }
.gallery-caption span { font-size: 0.72rem; color: var(--color-orange); text-transform: uppercase; letter-spacing: 0.08em; }

.filter-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.filter-tabs button {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  color: var(--color-steel);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}
.filter-tabs button.is-active,
.filter-tabs button:hover { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-white); }

/* ---------- 10. Franja de líneas de servicio ---------- */
.services-band {
  background: var(--color-ink);
  color: var(--color-white);
  border-radius: var(--radius);
  padding: 36px 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 32px;
}
.services-band-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-orange);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 4px;
}
.services-band-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
}
.services-band-chips a {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--color-white);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.services-band-chips a:hover {
  background: var(--color-orange);
  border-color: var(--color-orange);
  color: var(--color-ink);
}

/* ---------- 11. Formulario de contacto ---------- */
.form-grid { display: grid; gap: 18px; }
@media (min-width: 640px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 0.88rem; }
.field input, .field textarea {
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-white);
  color: var(--color-ink);
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--color-orange);
  box-shadow: 0 0 0 3px var(--color-orange-tint);
}
.field .field-error { color: #c0392b; font-size: 0.8rem; min-height: 1em; }
.form-note { font-size: 0.85rem; color: var(--color-steel-light); margin-top: 6px; }
.form-alert {
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  margin-bottom: 20px;
  display: none;
}
.form-alert.is-visible { display: block; }
.form-alert.success { background: #e6f4ea; color: #1e7a34; border: 1px solid #b7e0c3; }
.form-alert.error { background: #fdecea; color: #b3261e; border: 1px solid #f5c2be; }

.contact-info-card {
  background: var(--color-ink);
  color: var(--color-white);
  border-radius: var(--radius);
  padding: 32px 28px;
}
.contact-info-card h3 { color: var(--color-orange); font-size: 1rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.contact-info-card .info-block { margin-bottom: 22px; }
.contact-info-card .info-block:last-child { margin-bottom: 0; }
.contact-info-card a:hover { color: var(--color-orange); }
.whatsapp-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-weight: 600; color: #25D366; }

/* ---------- 12. CTA banda ---------- */
.cta-band {
  background: var(--color-orange);
  color: var(--color-ink);
  border-radius: var(--radius);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-start;
}
@media (min-width: 760px) {
  .cta-band { flex-direction: row; align-items: center; justify-content: space-between; }
}
.cta-band h2 { margin-bottom: 4px; font-size: 1.5rem; }
.cta-band p { margin: 0; }

/* ---------- 13. Footer ---------- */
.site-footer { background: var(--color-ink-soft); color: #cfcbc4; }
.footer-top { padding: 56px 0 32px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; } }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-brand img { height: 38px; }
.footer-brand strong { color: var(--color-white); font-family: var(--font-heading); }
.site-footer h4 { color: var(--color-white); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px; }
.site-footer ul li { margin-bottom: 10px; font-size: 0.92rem; }
.site-footer ul li a:hover { color: var(--color-orange); }
.footer-bottom { padding: 20px 0; font-size: 0.8rem; display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.footer-bottom a:hover { color: var(--color-orange); }

/* ---------- 14. Utilidades ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.badge-placeholder {
  display: inline-block;
  background: #fff3cd;
  color: #856404;
  border: 1px dashed #e0b23c;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.85rem;
}

/* Botón flotante de volver arriba */
.scroll-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--color-orange);
  color: var(--color-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 90;
}
.scroll-top.is-visible { opacity: 1; pointer-events: auto; }

/* ---------- 15. Animaciones (scroll-reveal + header compacto) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
/* Efecto escalonado para tarjetas dentro de una misma cuadrícula */
.grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.grid .reveal:nth-child(3) { transition-delay: 0.16s; }
.grid .reveal:nth-child(4) { transition-delay: 0.24s; }
.grid .reveal:nth-child(5) { transition-delay: 0.32s; }
.grid .reveal:nth-child(6) { transition-delay: 0.4s; }
.grid .reveal:nth-child(7) { transition-delay: 0.48s; }
.grid .reveal:nth-child(8) { transition-delay: 0.56s; }

/* Header que se compacta al hacer scroll */
.site-header { transition: box-shadow 0.3s ease; }
.site-header .container { transition: min-height 0.3s ease; }
.site-header.is-scrolled { box-shadow: var(--shadow-md); }
.site-header.is-scrolled .container { min-height: 60px; }
.site-header.is-scrolled .brand img { height: 34px; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .site-header .container,
  .site-header.is-scrolled .brand img,
  html { transition: none !important; scroll-behavior: auto; }
}

/* ---------- 16. Lightbox de galería ---------- */
.gallery-item[data-lightbox] { cursor: zoom-in; }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 12, 12, 0.94);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}
.lightbox-overlay.is-open { opacity: 1; visibility: visible; }
body.lightbox-open { overflow: hidden; }

.lightbox-figure {
  max-width: min(1100px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.lightbox-figure img {
  max-width: 100%;
  max-height: 74vh;
  width: auto;
  border-radius: 6px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.lightbox-figure img.is-loaded { opacity: 1; transform: scale(1); }

.lightbox-caption { color: var(--color-white); text-align: center; }
.lightbox-caption strong { display: block; font-family: var(--font-heading); font-size: 1rem; }
.lightbox-caption span { font-size: 0.75rem; color: var(--color-orange); text-transform: uppercase; letter-spacing: 0.08em; }

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--color-white);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  line-height: 1;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { background: var(--color-orange); border-color: var(--color-orange); color: var(--color-ink); }

.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); }

.lightbox-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #cfcbc4;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

@media (max-width: 640px) {
  .lightbox-prev, .lightbox-next { width: 38px; height: 38px; font-size: 1.1rem; }
  .lightbox-close { width: 38px; height: 38px; top: 12px; right: 12px; }
  .lightbox-overlay { padding: 48px 12px; }
}
