/* =========================================================
   TERRA HOLDING — styles.css
   Paleta oficial:  Azul oscuro #0F172A · Dorado #D4AF37 · Blanco #FFFFFF
   Tipografía: Display serif (Cormorant Garamond) + UI sans (Montserrat)
   Las fuentes se cargan vía Google Fonts (CDN) desde index.html.
   Si no hay conexión, los fallback del sistema declarados en las
   variables --font-display / --font-sans mantienen el diseño.
   ========================================================= */

/* ----------------------------------------------------------
   1. TOKENS DE MARCA
   ---------------------------------------------------------- */
:root {
  /* Paleta oficial */
  --navy: #0F172A;          /* azul oscuro principal */
  --navy-900: #0B1120;      /* variación más profunda (fondos/footer) */
  --navy-800: #131C30;      /* superficie elevada */
  --navy-700: #1B2640;      /* tarjetas sobre navy */
  --gold: #D4AF37;          /* dorado */
  --gold-soft: #E6CC73;     /* dorado claro para hover */
  --white: #FFFFFF;

  /* Texto */
  --ink: #0F172A;
  --text: #475569;          /* gris azulado para cuerpo sobre blanco */
  --text-light: #C7CEDB;    /* texto secundario sobre navy */
  --muted: #8A93A6;

  /* Líneas y sombras */
  --line: #E4E7EE;                          /* hairline sobre blanco */
  --line-gold: rgba(212, 175, 55, 0.35);    /* hairline dorado */
  --line-soft: rgba(255, 255, 255, 0.10);   /* hairline sobre navy */
  --shadow-soft: 0 24px 60px rgba(15, 23, 42, 0.10);
  --shadow-card: 0 18px 50px rgba(15, 23, 42, 0.12);

  /* Tipografía */
  --font-display: "Cormorant Garamond", "Libre Baskerville", Georgia, "Times New Roman", serif;
  --font-sans: "Montserrat", "Helvetica Neue", Arial, system-ui, -apple-system, sans-serif;

  /* Ritmo */
  --radius: 14px;
  --radius-sm: 8px;
  --section-y: 110px;
  --container-max: 1200px;
}

/* ----------------------------------------------------------
   3. BASE
   ---------------------------------------------------------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--white);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
}

p { margin: 0; }

.container { max-width: var(--container-max); }

/* Secciones */
.section { padding-block: var(--section-y); }
.section--navy { background: var(--navy); color: var(--text-light); }
.section--navy-deep { background: var(--navy-900); color: var(--text-light); }
.section--tint { background: #F7F8FB; }

.section--navy h1, .section--navy h2, .section--navy h3, .section--navy h4,
.section--navy-deep h1, .section--navy-deep h2, .section--navy-deep h3, .section--navy-deep h4 {
  color: var(--white);
}

/* Foco accesible visible */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ----------------------------------------------------------
   4. ELEMENTOS DE FIRMA (eyebrow + título + línea dorada)
   ---------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--gold);
  display: inline-block;
}

.section-title {
  font-size: clamp(2rem, 3.6vw, 3.1rem);
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}

.section-text {
  font-size: 1.02rem;
  color: var(--text);
  max-width: 680px;
}
.section--navy .section-text,
.section--navy-deep .section-text { color: var(--text-light); }

/* Regla dorada decorativa */
.rule-gold {
  width: 56px;
  height: 2px;
  background: var(--gold);
  border: 0;
  margin: 0 0 22px;
}

/* ----------------------------------------------------------
   5. BOTONES
   ---------------------------------------------------------- */
.btn-terra {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  padding: 14px 26px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  text-transform: uppercase;
}
.btn-gold {
  background: var(--gold);
  color: var(--navy);
}
.btn-gold:hover {
  background: var(--gold-soft);
  color: var(--navy);
  transform: translateY(-2px);
}
.btn-outline-gold {
  background: transparent;
  color: var(--gold);
  border-color: var(--line-gold);
}
.btn-outline-gold:hover {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}
.btn-outline-navy {
  background: transparent;
  color: var(--navy);
  border-color: var(--line);
}
.btn-outline-navy:hover {
  border-color: var(--gold);
  color: var(--navy);
}
.btn-whatsapp {
  background: transparent;
  color: var(--navy);
  border-color: var(--line);
}
.btn-whatsapp:hover {
  border-color: var(--gold);
}
.section--navy .btn-whatsapp,
.section--navy-deep .btn-whatsapp {
  color: var(--white);
  border-color: var(--line-soft);
}
.section--navy .btn-whatsapp:hover { border-color: var(--gold); color: var(--gold); }

/* ----------------------------------------------------------
   6. NAVBAR
   ---------------------------------------------------------- */
.terra-navbar {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
  padding-block: 12px;
}
.terra-brand { display: inline-flex; align-items: center; }
.terra-logo { height: 46px; width: auto; }

.terra-navbar .navbar-nav .nav-link {
  color: var(--text-light);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 8px 14px;
  position: relative;
  transition: color 0.2s ease;
}
.terra-navbar .navbar-nav .nav-link:hover,
.terra-navbar .navbar-nav .nav-link:focus,
.terra-navbar .navbar-nav .nav-link.active {
  color: var(--gold);
}
.terra-navbar .navbar-nav .nav-link::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.terra-navbar .navbar-nav .nav-link:hover::after,
.terra-navbar .navbar-nav .nav-link.active::after { transform: scaleX(1); }

.terra-navbar .navbar-toggler {
  border: 1px solid var(--line-soft);
  padding: 6px 10px;
}
.terra-navbar .navbar-toggler:focus { box-shadow: none; }
.terra-navbar .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23D4AF37' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ----------------------------------------------------------
   7. HERO
   ---------------------------------------------------------- */
.hero {
  position: relative;
  background:
    radial-gradient(1100px 520px at 78% -8%, rgba(212, 175, 55, 0.12), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-900) 100%);
  color: var(--white);
  padding-top: 140px;
  padding-bottom: 130px;
  overflow: hidden;
}
.hero::before { /* hairline dorada superior */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--white);
  margin-bottom: 24px;
}
.hero h1 .accent { color: var(--gold); font-style: italic; }
.hero .lead-text {
  font-size: 1.12rem;
  color: var(--text-light);
  max-width: 620px;
  margin-bottom: 36px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* Panel lateral del hero */
.hero-panel {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  padding: 30px;
}
.hero-panel .panel-title {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 22px;
}
.hero-stat { padding-block: 16px; border-top: 1px solid var(--line-soft); }
.hero-stat:first-of-type { border-top: 0; padding-top: 0; }
.hero-stat .stat-icon {
  color: var(--gold);
  font-size: 1.05rem;
  width: 30px;
}
.hero-stat strong {
  display: block;
  font-family: var(--font-display);
  color: var(--white);
  font-size: 1.25rem;
  line-height: 1.2;
}
.hero-stat span { font-size: 0.82rem; color: var(--text-light); }

/* ----------------------------------------------------------
   8. SECCIÓN HOLDING (pilares numerados)
   ---------------------------------------------------------- */
.pillar {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  height: 100%;
}
.pillar .pillar-num {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--gold);
  letter-spacing: 0.05em;
}
.pillar h3 { font-size: 1.45rem; margin: 10px 0 8px; }
.pillar p { font-size: 0.95rem; color: var(--text); }

/* ----------------------------------------------------------
   9. EMPRESAS DEL GRUPO (cards sobre navy)
   ---------------------------------------------------------- */
.company-card {
  background: var(--navy-700);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 38px 34px;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.company-card:hover {
  transform: translateY(-5px);
  border-color: var(--line-gold);
  background: var(--navy-800);
}
.company-logo {
  width: 100%;
  height: 124px;
  border-radius: 14px;
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  padding: 16px 22px;
  margin-bottom: 24px;
  overflow: hidden;
}
.company-logo img { max-height: 100%; max-width: 100%; width: auto; object-fit: contain; }
.company-card h3 { color: var(--white); font-size: 1.6rem; margin-bottom: 12px; }
.company-card p { color: var(--text-light); font-size: 0.95rem; margin: 0; }

/* ----------------------------------------------------------
   10. UNIDADES DE NEGOCIO / SERVICIOS
   ---------------------------------------------------------- */
.unit-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  height: 100%;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.unit-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card);
  border-color: var(--line-gold);
}
.unit-icon {
  width: 54px; height: 54px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold);
  font-size: 1.3rem;
  margin-bottom: 20px;
}
.unit-card h3 { font-size: 1.35rem; margin-bottom: 8px; }
.unit-card p { font-size: 0.92rem; color: var(--text); margin: 0; }

/* ----------------------------------------------------------
   11. SOPORTE TÉCNICO (lista sobre navy)
   ---------------------------------------------------------- */
.service-list { list-style: none; margin: 0; padding: 0; }
.service-list li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-light);
  font-size: 0.95rem;
}
.service-list li i { color: var(--gold); margin-top: 4px; }

/* ----------------------------------------------------------
   12. SUMINISTRO Y LOGÍSTICA
   ---------------------------------------------------------- */
.supply-mini {
  border-left: 2px solid var(--gold);
  padding-left: 18px;
  margin-bottom: 22px;
}
.supply-mini i { color: var(--gold); font-size: 1.1rem; margin-bottom: 8px; display: block; }
.supply-mini h4 { font-family: var(--font-sans); font-weight: 600; font-size: 1rem; color: var(--ink); margin-bottom: 4px; }
.supply-mini p { font-size: 0.9rem; color: var(--text); margin: 0; }
/* El PNG image_de.png ya incluye su marco hexagonal dorado y fondo claro:
   se presenta limpio (sin recorte ni doble marco) con una sombra suave. */
.supply-visual {
  position: relative;
  display: flex;
  justify-content: center;
}
.supply-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 26px 55px rgba(15, 23, 42, 0.14));
}
@media (max-width: 991.98px) {
  .supply-visual { margin-top: 1.5rem; }
}

/* ----------------------------------------------------------
   13. MARCAS DISTRIBUIDAS
   ---------------------------------------------------------- */
.brand-tile {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 22px 14px;
  text-align: center;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--text-light);
  transition: all 0.25s ease;
  height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.brand-tile:hover { border-color: var(--line-gold); color: var(--gold); }

/* ----------------------------------------------------------
   14. SECTORES
   ---------------------------------------------------------- */
.sector-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  background: var(--white);
  height: 100%;
  transition: all 0.25s ease;
}
.sector-card:hover { border-color: var(--line-gold); box-shadow: var(--shadow-card); transform: translateY(-4px); }
.sector-card i { color: var(--gold); font-size: 1.6rem; margin-bottom: 14px; }
.sector-card strong {
  display: block;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
}

/* ----------------------------------------------------------
   15. POR QUÉ TERRA HOLDING
   ---------------------------------------------------------- */
.reason {
  display: flex; gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line-soft);
}
.reason-icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold);
  font-size: 1.1rem;
}
.reason h4 { font-family: var(--font-sans); font-weight: 600; color: var(--white); font-size: 1.02rem; margin-bottom: 4px; }
.reason p { font-size: 0.9rem; color: var(--text-light); margin: 0; }

/* ----------------------------------------------------------
   16. PORTAFOLIO (galería)
   ---------------------------------------------------------- */
.portfolio-shot {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  height: 260px;
}
.portfolio-shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.portfolio-shot:hover img { transform: scale(1.05); }
.portfolio-shot figcaption {
  position: absolute; left: 14px; bottom: 14px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--line-gold);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
}

/* ----------------------------------------------------------
   17. CONTACTO + FORMULARIO
   ---------------------------------------------------------- */
.contact-bullets div {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
  color: var(--text-light);
  font-size: 0.95rem;
}
.contact-bullets i { color: var(--gold); }

.terra-form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-card);
}
.terra-form label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: 6px;
  display: block;
}
.terra-form .form-control,
.terra-form .form-select {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--ink);
}
.terra-form .form-control:focus,
.terra-form .form-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}
.terra-form .form-control::placeholder { color: var(--muted); }

/* Mensaje de confirmación (lo controla main.js) */
.form-feedback {
  display: none;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  border: 1px solid var(--line-gold);
  background: rgba(212, 175, 55, 0.10);
  color: var(--ink);
}
.form-feedback.is-error {
  border-color: #E0B4B4;
  background: rgba(200, 60, 60, 0.08);
  color: #8A2B2B;
}
.form-feedback.is-visible { display: block; }

.field-invalid { border-color: #E0B4B4 !important; }

/* ----------------------------------------------------------
   18. FOOTER
   ---------------------------------------------------------- */
.terra-footer {
  background: var(--navy-900);
  border-top: 1px solid var(--line-soft);
  padding-block: 56px 32px;
  color: var(--text-light);
}
.footer-logo { height: 50px; width: auto; margin-bottom: 18px; }
.terra-footer h5 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}
.terra-footer a { color: var(--text-light); transition: color 0.2s ease; }
.terra-footer a:hover { color: var(--gold); }
.terra-footer p, .terra-footer li { font-size: 0.9rem; }
.terra-footer ul { list-style: none; padding: 0; margin: 0; }
.terra-footer ul li { margin-bottom: 10px; }
.footer-bottom {
  border-top: 1px solid var(--line-soft);
  margin-top: 40px;
  padding-top: 24px;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ----------------------------------------------------------
   19. WHATSAPP FLOTANTE
   ---------------------------------------------------------- */
.wa-float {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 1030;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 14px 34px rgba(212, 175, 55, 0.40);
  transition: transform 0.25s ease, background 0.25s ease;
}
.wa-float:hover { transform: translateY(-3px) scale(1.05); background: var(--gold-soft); color: var(--navy); }

/* ----------------------------------------------------------
   20. UTILIDADES Y ANIMACIÓN
   ---------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* Respeta usuarios que prefieren menos movimiento */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .portfolio-shot img, .btn-terra, .company-card, .unit-card, .sector-card { transition: none; }
}

/* ----------------------------------------------------------
   21. RESPONSIVE
   ---------------------------------------------------------- */
@media (max-width: 991.98px) {
  :root { --section-y: 80px; }
  .terra-navbar .navbar-nav { padding-top: 12px; }
  .terra-navbar .navbar-nav .nav-link { padding: 10px 4px; }
  .hero { padding-top: 110px; padding-bottom: 90px; }
  .hero-panel { margin-top: 40px; }
}

@media (max-width: 575.98px) {
  :root { --section-y: 64px; }
  .terra-form { padding: 22px; }
  .hero-actions .btn-terra { width: 100%; justify-content: center; }
}
/* ── Company card: variante enlace ─────────────────────── */
a.company-card--link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

a.company-card--link:hover,
a.company-card--link:focus {
  color: inherit;
  text-decoration: none;
}

a.company-card--link:focus-visible {
  outline: 2px solid #C9A84C;
  outline-offset: 3px;
  border-radius: inherit;
}