/* ====================================================
   MacroGesta — Acondicionamiento y Servicios
   Identidad: verde corporativo del logo (#164322) + azul acero
   Tipografía: Fraunces (display) + Inter Tight (body)
   ==================================================== */

:root {
  /* Verde derivado del logo oficial: #164322 (rgb 22,67,34) */
  --mg-green-900: #0e2c16;   /* más oscuro que el logo */
  --mg-green-800: #164322;   /* VERDE EXACTO DEL LOGO */
  --mg-green-700: #1d5630;   /* un paso más claro */
  --mg-green-600: #2a6b3f;
  --mg-green-50:  #e7efe9;

  /* Fondos claros, ligeramente fríos para armonizar con el azul */
  --mg-cream:     #eef1ee;
  --mg-cream-2:   #e2e8e4;
  --mg-paper:     #f7f9f7;

  --mg-ink:       #15201a;
  --mg-ink-2:     #45524b;
  --mg-ink-3:     #76837c;

  /* Acento azul acero (toque solicitado) */
  --mg-accent:    #3a7ca5;   /* azul acero */
  --mg-accent-2:  #5b9bc4;   /* azul claro hover */

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Inter Tight', -apple-system, sans-serif;

  --container-pad: clamp(1rem, 4vw, 3rem);
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  color: var(--mg-ink);
  background: var(--mg-paper);
  overflow-x: hidden;
}

p { color: var(--mg-ink-2); }

::selection { background: var(--mg-green-700); color: var(--mg-cream); }

/* ====================================================
   NAV
   ==================================================== */
.mg-nav {
  background: rgba(247, 249, 247, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 0.85rem 0;
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
}
.mg-nav.scrolled {
  border-bottom-color: rgba(14, 44, 22, 0.08);
  box-shadow: 0 4px 20px rgba(14, 44, 22, 0.05);
}

.mg-nav .navbar-brand { padding-top: 0; padding-bottom: 0; }

.mg-nav .navbar-brand .mg-logo-img,
.mg-logo-img {
  height: 58px !important;
  max-height: 58px !important;
  width: auto !important;
  max-width: 230px !important;
  display: block;
  object-fit: contain;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.mg-nav .navbar-brand:hover .mg-logo-img { transform: scale(1.03); }
.mg-nav.scrolled .navbar-brand .mg-logo-img { height: 50px !important; max-height: 50px !important; }

.mg-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background: var(--mg-green-800);
  border-radius: 8px;
  color: #fff;
}
.mg-logo-mark img { filter: brightness(0) invert(1); }

.mg-brand-text { display: flex; flex-direction: column; line-height: 1; }
.mg-brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--mg-green-900);
  letter-spacing: -0.01em;
}
.mg-brand-tag {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mg-ink-3);
  margin-top: 4px;
  font-weight: 500;
}

.mg-nav .nav-link {
  color: var(--mg-ink) !important;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 1rem !important;
  position: relative;
  transition: color 0.2s;
}
.mg-nav .nav-link:hover { color: var(--mg-green-700) !important; }
.mg-nav .nav-link::after {
  content: '';
  position: absolute;
  left: 1rem; right: 1rem;
  bottom: 0.3rem;
  height: 1px;
  background: var(--mg-green-700);
  transform: scaleX(0);
  transition: transform 0.25s;
}
.mg-nav .nav-link:hover::after { transform: scaleX(1); }

/* Botones */
.mg-btn-primary {
  background: var(--mg-green-800);
  color: #fff;
  border: 1px solid var(--mg-green-800);
  padding: 0.7rem 1.6rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 4px;
  transition: all 0.2s ease;
}
.mg-btn-primary:hover {
  background: var(--mg-green-900);
  border-color: var(--mg-green-900);
  color: #fff;
  transform: translateY(-1px);
}
.mg-btn-ghost {
  background: transparent;
  color: var(--mg-cream);
  border: 1px solid rgba(255,255,255,0.4);
  padding: 0.7rem 1.6rem;
  font-weight: 500;
  border-radius: 4px;
  transition: all 0.2s ease;
}
.mg-btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.7);
  color: #fff;
}

/* ====================================================
   HERO
   ==================================================== */
.mg-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}
.mg-hero-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: -2;
  transform: scale(1.05);
  animation: heroZoom 16s ease-out forwards;
}
@keyframes heroZoom {
  to { transform: scale(1); }
}
.mg-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(110deg, rgba(14,44,22,0.90) 0%, rgba(14,44,22,0.68) 45%, rgba(22,67,34,0.38) 100%),
    linear-gradient(to bottom, rgba(10,30,40,0.25), rgba(0,0,0,0.45));
  z-index: -1;
}
.mg-hero-content {
  position: relative;
  padding: 7rem 0 4rem;
  color: var(--mg-cream);
}

.mg-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--mg-cream);
  font-weight: 600;
  margin-bottom: 1rem;
  position: relative;
  padding-left: 2.5rem;
}
.mg-eyebrow::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 2rem;
  height: 1px;
  background: currentColor;
}
.mg-eyebrow-dark { color: var(--mg-green-700); }
.mg-eyebrow-light { color: var(--mg-cream); opacity: 0.85; }

.mg-hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.6vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  max-width: 22ch;
}
.mg-hero-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--mg-cream-2);
}

.mg-hero-lead {
  font-size: clamp(0.98rem, 1.15vw, 1.1rem);
  max-width: 58ch;
  line-height: 1.55;
  color: rgba(244, 239, 230, 0.88);
}

.mg-hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--mg-cream);
  opacity: 0.7;
}
.mg-hero-scroll span {
  width: 1px;
  height: 32px;
  background: currentColor;
  position: relative;
  overflow: hidden;
}
.mg-hero-scroll span::after {
  content: '';
  position: absolute;
  top: -32px;
  left: 0;
  width: 100%;
  height: 32px;
  background: linear-gradient(to bottom, transparent, var(--mg-cream));
  animation: scrollLine 2.2s ease-in-out infinite;
}
@keyframes scrollLine {
  to { top: 32px; }
}
.mg-hero-scroll small {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

/* ====================================================
   SECCIONES
   ==================================================== */
.mg-section {
  padding: clamp(4rem, 9vw, 8rem) 0;
}
.mg-section-dark {
  background: var(--mg-green-900);
  color: var(--mg-cream);
  position: relative;
  overflow: hidden;
}
.mg-section-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 0%, rgba(58,124,165,0.10), transparent 50%),
    radial-gradient(circle at 90% 100%, rgba(29,86,48,0.55), transparent 50%);
  pointer-events: none;
}
.mg-section-dark .container-xl { position: relative; }

.mg-section-cream { background: var(--mg-cream); }

.mg-h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 3.6vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--mg-green-900);
  margin-bottom: 1rem;
}
.mg-section-dark .mg-h2 { color: var(--mg-cream); }
.mg-h2 em {
  font-style: italic;
  font-weight: 300;
  color: var(--mg-green-700);
}
.mg-section-dark .mg-h2 em { color: var(--mg-accent); }

.mg-lead {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--mg-ink);
  font-weight: 400;
}
.mg-section-dark .mg-lead { color: var(--mg-cream); }

.mg-section-note {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 1.4rem;
  line-height: 1.5;
  color: var(--mg-cream-2);
  max-width: 60ch;
  border-left: 2px solid var(--mg-accent);
  padding-left: 1.5rem;
}

/* ====================================================
   STATS
   ==================================================== */
.mg-stats {
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(12, 46, 34, 0.12);
}
.mg-stat { text-align: left; }
.mg-stat-num {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.5rem, 4.5vw, 3.8rem);
  color: var(--mg-green-800);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}
.mg-stat-label {
  font-size: 0.88rem;
  color: var(--mg-ink-3);
  letter-spacing: 0.02em;
  max-width: 24ch;
}

/* ====================================================
   SERVICIOS
   ==================================================== */
.mg-service {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 2.5rem 2rem 2rem;
  height: 100%;
  position: relative;
  transition: all 0.3s ease;
  overflow: hidden;
}
.mg-service::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  background: var(--mg-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}
.mg-service:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(200,155,60,0.3);
  transform: translateY(-4px);
}
.mg-service:hover::before { transform: scaleX(1); }

.mg-service-num {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 0.95rem;
  color: var(--mg-accent);
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}
.mg-service-icon {
  font-size: 2rem;
  color: var(--mg-cream);
  margin-bottom: 1.5rem;
  display: block;
}
.mg-service h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.4rem;
  color: var(--mg-cream);
  margin-bottom: 0.8rem;
  letter-spacing: -0.01em;
}
.mg-service p {
  color: rgba(244,239,230,0.7);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0;
}

/* ====================================================
   GALERÍA
   ==================================================== */
.mg-gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}
.mg-gallery-item {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 4px;
  aspect-ratio: 4 / 3;
  grid-column: span 2;
  background: var(--mg-cream-2);
}
.mg-gallery-item.mg-gallery-large {
  grid-column: span 4;
  aspect-ratio: 16 / 9;
}
.mg-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(.22, 1, .36, 1);
}
.mg-gallery-item:hover img { transform: scale(1.05); }

.mg-gallery-item figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 1.25rem 1rem;
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  background: linear-gradient(to top, rgba(12,46,34,0.85), transparent);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}
.mg-gallery-item:hover figcaption {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .mg-gallery { grid-template-columns: repeat(2, 1fr); }
  .mg-gallery-item, .mg-gallery-item.mg-gallery-large {
    grid-column: span 2;
    aspect-ratio: 4 / 3;
  }
}

/* ====================================================
   EQUIPO
   ==================================================== */
.mg-people { display: flex; flex-direction: column; gap: 2.5rem; }
.mg-people-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
@media (max-width: 767px) {
  .mg-people-grid { grid-template-columns: 1fr; gap: 1.25rem; }
}
.mg-person {
  padding: 1.75rem 1.75rem;
  background: #fff;
  border-radius: 6px;
  border-left: 3px solid var(--mg-green-700);
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
}
.mg-person:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(12,46,34,0.08);
}
.mg-person-role {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mg-green-700);
  font-weight: 600;
  margin-bottom: 0.6rem;
  line-height: 1.4;
}
.mg-person-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.35rem;
  color: var(--mg-green-900);
  margin-bottom: 0.7rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.mg-person p { font-size: 0.92rem; margin: 0; line-height: 1.55; }

/* ====================================================
   CLIENTES
   ==================================================== */
.mg-img-frame {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 30px 30px 0 -8px var(--mg-green-700);
}
@media (max-width: 991px) { .mg-img-frame { box-shadow: 20px 20px 0 -6px var(--mg-green-700); aspect-ratio: 4/3; } }

.mg-client-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}
.mg-client-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(12,46,34,0.1);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--mg-green-900);
}
.mg-client-list li i {
  color: var(--mg-green-700);
  font-size: 1.4rem;
}

/* ====================================================
   CIERRE
   ==================================================== */
.mg-closing {
  background: var(--mg-green-900);
  color: var(--mg-cream);
  padding: clamp(4rem, 8vw, 7rem) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.mg-closing::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('img/galpon-grano.jpg') center/cover;
  opacity: 0.08;
  filter: grayscale(1);
}
.mg-closing-text {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.5rem, 2.8vw, 2.4rem);
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--mg-cream);
  position: relative;
  margin: 0;
}
.mg-closing-text em {
  font-style: italic;
  color: var(--mg-accent);
}
.mg-closing .mg-eyebrow { margin-bottom: 2rem; }

/* ====================================================
   CONTACTO
   ==================================================== */
.text-light-50 { color: rgba(244,239,230,0.7); }

.mg-contact-list {
  list-style: none;
  padding: 0;
  margin-top: 2.5rem;
}
.mg-contact-list li {
  padding: 1.1rem 0;
  border-bottom: 1px solid rgba(244,239,230,0.12);
  color: var(--mg-cream);
}
.mg-contact-list li,
.mg-contact-list li > a {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
}
.mg-contact-list li > a {
  color: var(--mg-cream);
  text-decoration: none;
  padding: 0;
  transition: color 0.2s;
}
.mg-contact-list li > a:hover { color: #fff; }
.mg-contact-list li > a:hover i { color: var(--mg-accent-2); }
.mg-contact-list li i {
  color: var(--mg-accent);
  font-size: 1.3rem;
  margin-top: 2px;
  transition: color 0.2s;
  flex-shrink: 0;
}
.mg-contact-list li strong { font-weight: 600; }

.mg-form .form-label {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mg-cream);
  font-weight: 500;
  margin-bottom: 0.4rem;
}
.mg-form .form-control,
.mg-form .form-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--mg-cream);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  font-size: 0.97rem;
}
.mg-form .form-control:focus,
.mg-form .form-select:focus {
  background: rgba(255,255,255,0.08);
  border-color: var(--mg-accent);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(200,155,60,0.15);
}
.mg-form .form-control::placeholder { color: rgba(244,239,230,0.4); }
.mg-form .form-select option { background: var(--mg-green-900); color: var(--mg-cream); }

/* ====================================================
   MAPA
   ==================================================== */
.mg-map-section {
  position: relative;
  background: var(--mg-green-900);
}
.mg-map-wrap {
  position: relative;
  width: 100%;
  height: 480px;
  overflow: hidden;
}
.mg-map-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  filter: grayscale(0.15) contrast(1.02);
}
.mg-map-link {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: rgba(14, 44, 22, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--mg-cream);
  text-decoration: none;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  border-left: 3px solid var(--mg-accent);
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  max-width: 340px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  z-index: 2;
}
.mg-map-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  color: #fff;
}
.mg-map-link > i.bi-geo-alt-fill {
  color: var(--mg-accent);
  font-size: 1.5rem;
  flex-shrink: 0;
}
.mg-map-link span {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  line-height: 1.35;
}
.mg-map-link strong {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 2px;
}
.mg-map-link-open {
  color: rgba(244, 239, 230, 0.55);
  font-size: 0.85rem;
  margin-left: 0.3rem;
  flex-shrink: 0;
}
@media (max-width: 575px) {
  .mg-map-wrap { height: 360px; }
  .mg-map-link {
    top: 1rem;
    left: 1rem;
    right: 1rem;
    max-width: none;
    padding: 0.85rem 1rem;
  }
  .mg-map-link strong { font-size: 0.98rem; }
  .mg-map-link span { font-size: 0.82rem; }
}

/* ====================================================
   FOOTER
   ==================================================== */
.mg-footer {
  background: var(--mg-green-900);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 2.5rem 0;
  color: rgba(244,239,230,0.7);
  font-size: 0.88rem;
}
.mg-footer-logo {
  height: 56px;
  width: auto;
  max-width: 240px;
  display: block;
  opacity: 0.95;
}
.mg-footer-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--mg-cream);
}
.mg-footer-tag {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ====================================================
   RESPONSIVE
   ==================================================== */
@media (max-width: 991px) {
  .mg-hero-content { padding: 7rem 0 5rem; }
  .navbar-collapse {
    background: var(--mg-paper);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-top: 0.75rem;
    box-shadow: 0 8px 30px rgba(12,46,34,0.1);
  }
  .mg-img-frame { margin-bottom: 2rem; }
}

@media (max-width: 575px) {
  .mg-brand-tag { display: none; }
  .mg-hero-scroll { display: none; }
  .mg-nav .navbar-brand .mg-logo-img,
  .mg-logo-img {
    height: 48px !important;
    max-height: 48px !important;
    max-width: 200px !important;
  }
}

/* Reveal animation */
.mg-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.mg-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
