/* --- FONT IMPORTS (GOOGLE FONTS) --- */
@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;600;700&family=Open+Sans:wght@400;600&display=swap');

/* --- THEME & COLOR PALETTE --- */
:root {
  --primario: #0D1B2A;      /* Dark Navy Blue */
  --secundario: #3E5A80;    /* Steel Blue */
  --fondo: #F7F9FB;         /* Off-White / Very Light Gray-Blue */
  --acento: #C9A227;        /* Gold Accent */
  --texto: #1B263B;         /* Dark Text Color */
  --texto-claro: #E0E1DD;   /* Light text for dark backgrounds */
  --borde: #DDE4ED;         /* Light border color */
  --sombra: rgba(27, 38, 59, 0.08);
  --container: 1140px;
  --font-serif: 'Lora', serif;
  --font-sans: 'Open Sans', sans-serif;
}

/* --- GLOBAL RESETS & BASE STYLES --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body { height: 100%; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: var(--fondo);
}

body {
  margin: 0;
  padding: 0;
  min-height: 100svh;            /* Usa 100svh para móviles modernos */
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  color: var(--texto);
  background-color: var(--fondo);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

main { flex: 1 0 auto; }          /* El main ocupa el alto disponible */

main > section:last-of-type{
  margin-bottom: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--primario);
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
h3 { font-size: 1.5rem; }

p {
  margin-bottom: 1rem;
  text-align: justify;
  text-justify: inter-word;
}

a {
  color: var(--secundario);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--acento);
}

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

.container {
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding: 0 1.5rem;
}

/* --- HEADER & NAVIGATION --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--borde);
  transition: top 0.3s ease, box-shadow 0.3s ease;
}

.site-header.nav--hidden {
  top: -120px;
}

.site-header.nav--scrolled {
  box-shadow: 0 4px 12px var(--sombra);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primario);
}

.logo {
  background-color: var(--primario);
  color: #fff;
  font-weight: 700;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 1rem;
}

#main-nav ul {
  display: flex;
  list-style: none;
  gap: 0.5rem;
}

#main-nav a {
  color: var(--texto);
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  position: relative;
  transition: color 0.2s ease;
}

#main-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: var(--acento);
  transition: width 0.3s ease;
}

#main-nav a:hover,
#main-nav a.active {
  color: var(--primario);
}

#main-nav a:hover::after,
#main-nav a.active::after {
  width: 60%;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--primario);
  cursor: pointer;
}

/* --- HERO SECTION --- */
.hero {
  background-color: var(--primario);
  color: var(--texto-claro);
  padding: 160px 0 100px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('https://www.transparenttextures.com/patterns/concrete-wall.png');
  opacity: 0.05;
}

.hero h1 {
  color: #fff;
  margin-bottom: 1rem;
}

.hero .lead {
  font-size: 1.25rem;
  max-width: 70ch;
  margin: 0 auto 2rem auto;
  opacity: 0.9;
}

/* --- CALL TO ACTION (CTA) BUTTON --- */
.cta-button {
  display: inline-block;
  background-color: var(--acento);
  color: var(--primario);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.9rem 2rem;
  border-radius: 8px;
  border: 2px solid var(--acento);
  transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.cta-button:hover {
  background-color: transparent;
  color: var(--acento);
  transform: translateY(-3px);
}

/* --- GENERAL SECTION STYLING --- */
section {
  padding: 6rem 0;
}

section:nth-of-type(even) {
  background-color: #fff;
}

.section-title {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title .eyebrow {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--secundario);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.section-title h2 {
  margin: 0;
}

/* --- GRID SYSTEM --- */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* --- CARD STYLING --- */
.card {
  background-color: #fff;
  border: 1px solid var(--borde);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 12px var(--sombra);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(27, 38, 59, 0.12);
}

.card .icon {
  font-size: 2.5rem;
  color: var(--acento);
  margin-bottom: 1rem;
}

.card h3 {
  margin-bottom: 0.5rem;
}

/* --- ABOUT SECTION --- */
#nosotros .grid {
  align-items: center;
}

#nosotros .about-grid{
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
  margin-bottom: 1.5rem;
}

#nosotros .about-grid > *{
  height: 100%;
}

#nosotros .about-grid .card{
  display: flex;
  flex-direction: column;
  height: 100%;
}

#nosotros .about-mision-vision{
  display: grid;
  gap: 1.25rem;
}

#nosotros .about-grid .card .card-body{
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#nosotros .valores-card{
  margin-top: 2rem;
}

/* --- TESTIMONIALS SECTION --- */
.testimonial-card {
  text-align: center;
}

.testimonial-card blockquote {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-style: italic;
  border: none;
  padding: 0;
  margin: 0 0 1rem 0;
}

.testimonial-card .author {
  font-weight: 700;
  color: var(--primario);
}

.testimonial-card .author span {
  display: block;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--secundario);
}

/* --- CONTACT SECTION --- */
#contacto{
  background: linear-gradient(180deg,
              rgba(39, 64, 96, 0.04),
              rgba(110, 166, 200, 0.04));
}

#contacto .grid {
  align-items: center;
}

.contact-info p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.contact-info strong {
  display: block;
  color: var(--primario);
  font-family: var(--font-serif);
}

.contact-form label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.875rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--borde);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 1rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--secundario);
  box-shadow: 0 0 0 3px rgba(62, 90, 128, 0.2);
}

/* === CONTACTO: dos columnas iguales y alineadas === */
#contacto .contact-grid{
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.25rem;
  align-items: stretch;
}

#contacto .contact-grid > .contact-info,
#contacto .contact-grid > .contact-form{
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Ajustes finos del formulario */
.contact-form.card.tinted,
.contact-form.card-tinted{
  padding: 1.25rem;
}
#contacto .contact-form{
  display: flex;
  flex-direction: column;
}
#contacto .contact-form .form-group{
  margin-bottom: 0.85rem;
}
#contacto .contact-form .form-group:last-of-type{
  margin-bottom: 0.75rem;
}
#contacto .contact-form label{
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}
#contacto .contact-form input,
#contacto .contact-form textarea{
  padding: 0.6rem;
  font-size: 0.95rem;
  margin-bottom: 0;
}
#contacto .contact-form textarea{
  min-height: clamp(120px, 18vh, 220px);
  resize: vertical;
}
#contacto .contact-form .cta-button{
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  margin-top: auto;
}

/* --- FOOTER --- */
.site-footer {
  background-color: var(--primario);
  color: #fff;
  padding: 2.25rem 0;
  text-align: center;
  margin-top: auto;
}

.footer-content .brand {
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
}

.footer-content{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-nav {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin: 0;
}

.footer-nav a {
  color: var(--texto-claro);
  font-weight: 600;
}

.footer-nav a:hover {
  color: var(--acento);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.social-links a {
  color: var(--texto-claro);
  font-size: 1.5rem;
}

.copyright {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* --- REVEAL ON SCROLL ANIMATION --- */

/* Initial state for all animated elements. They start invisible and slightly offset. */
.reveal {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), 
              transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform: translateY(30px);
}

/* Final, visible state. The 'reveal--in' class is added by JavaScript. */
.reveal.reveal--in {
  opacity: 1;
  /* Reset all transforms to their default state */
  transform: translateY(0) translateX(0) scale(1);
}

.reveal.from-left {
  transform: translateX(-36px);
}

.reveal.from-right {
  transform: translateX(36px);
}

.reveal.from-top {
  transform: translateY(-36px);
}

.reveal.from-bottom {
  transform: translateY(36px);
}

.reveal.from-left.reveal--in,
.reveal.from-right.reveal--in {
  transform: translateX(0);
}

.reveal.from-top.reveal--in,
.reveal.from-bottom.reveal--in {
  transform: translateY(0);
}

.valores-lista {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.valores-lista li {
  background: rgba(39,64,96,0.05);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(39,64,96,0.08);
}

/* ====== Valores en grid 3x2 ====== */
.valores-lista.valores-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.valores-lista.valores-grid li{
  display: grid;
  grid-template-columns: 56px auto;
  align-items: center;
  gap: .75rem;
  background: #fff;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(11,31,59,.06);
  padding: .85rem .95rem;
}

.valores-lista.valores-grid li:nth-last-child(2){
  grid-column: 1 / span 1;
}

.valores-lista.valores-grid li:last-child{
  grid-column: 3 / span 1;
}

.valores-lista.valores-grid li:nth-last-child(-n+2){
  justify-self: center;
}

.valores-lista .icon-3d{
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: radial-gradient(100% 100% at 30% 20%, rgba(110,166,200,.30) 0%, rgba(39,64,96,.22) 100%);
  box-shadow: 0 10px 22px rgba(7,17,51,.12), inset 0 1px 0 rgba(255,255,255,.45);
  color:#fff;
}

.valores-lista .icon-3d > span,
.valores-lista .icon-3d > svg{
  display:block;
  width:24px;
  height:24px;
  font-size:24px;
  line-height:1;
}

.card ul li,
.valores-lista li div{
  text-align: justify;
  text-justify: inter-word;
}

/* --- Animation Variations (apply these classes in HTML) --- */

/* Default animation: slide up */
.reveal {
  transform: translateY(30px);
}

/* Slide in from the left */
.reveal.from-left {
  transform: translateX(-40px);
}

/* Slide in from the right */
.reveal.from-right {
  transform: translateX(40px);
}

/* Zoom in effect */
.reveal.zoom-in {
  transform: scale(0.95);
}

/* Just fade in, no movement */
.reveal.fade-only {
  transform: none;
}

/* --- CORPORATE SURFACES & TINTS (subtle) --- */
:root{
  --surface-1: #FFFFFF;
  --surface-2: #F3F6FA; /* alternativa fría al blanco */
  --surface-grad: linear-gradient(180deg, rgba(39,64,96,.06), rgba(110,166,200,.06));
}

.section.alt,
#servicios.alt, #valores.alt, #clientes.alt {
  background: var(--surface-2);
}

.section.alt-grad { background: var(--surface-grad); }

/* Tinted cards */
.card.tinted, .card-tinted{
  background: var(--surface-1);
  border:1px solid var(--borde);
  box-shadow: 0 6px 18px rgba(7,17,51,.06);
}
.card.tinted .card-head, .card-tinted .card-head{
  border-bottom:1px solid rgba(39,64,96,.08);
  background: linear-gradient(90deg, rgba(110,166,200,.10), rgba(39,64,96,.06));
  padding:.5rem .75rem;
  border-radius:12px 12px 0 0;
}
.card.tinted.line-left, .card-tinted.line-left{ border-left:4px solid var(--acento); }

/* Icon backplate */
.icon-3d{
  display:inline-grid; place-items:center;
  width:56px; height:56px; border-radius:14px;
  background: radial-gradient(100% 100% at 30% 20%, rgba(110,166,200,.28) 0%, rgba(39,64,96,.22) 100%);
  box-shadow: 0 10px 20px rgba(7,17,51,.10), inset 0 1px 0 rgba(255,255,255,.35);
}

/* Hero overlay subtle */
.hero{ position:relative; }
.hero::after{
  content: ""; position:absolute; inset:0; pointer-events:none;
  background: linear-gradient(180deg, rgba(11,19,32,.06), rgba(11,19,32,0));
}

@media (max-width: 1024px){
  #nosotros .about-grid{
    grid-template-columns: 1fr;
  }

  #nosotros .about-mision-vision{
    grid-template-columns: 1fr;
  }

  .valores-lista.valores-grid{
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .valores-lista.valores-grid li:nth-last-child(-n+2){
    grid-column: auto;
    justify-self: stretch;
  }
}

@media (max-width: 640px){
  .valores-lista.valores-grid{
    grid-template-columns: 1fr;
  }

  .valores-lista.valores-grid li{
    grid-template-columns: 48px auto;
  }
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 992px) {
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
  
  #main-nav {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background-color: #fff;
    box-shadow: 0 8px 16px var(--sombra);
    border-top: 1px solid var(--borde);
  }

  #main-nav.show {
    display: block;
  }

  #main-nav ul {
    flex-direction: column;
    padding: 1rem;
    gap: 0;
  }

  #main-nav a {
    display: block;
    padding: 1rem;
    border-radius: 0;
  }
  
  #main-nav a::after {
    display: none;
  }

  .nav-toggle {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

/* --- SCROLL TO TOP BUTTON --- */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--primario);
  color: white;
  padding: 0.8rem 1.2rem;
  border-radius: 50%;
  text-decoration: none;
  font-size: 1.5rem;
  line-height: 1;
  transition: opacity 0.3s, transform 0.3s;
  opacity: 0;
  transform: translateY(100px);
  z-index: 1000;
  display: none; /* Oculto por defecto */
}

.scroll-to-top.visible {
  display: block; /* Mostrar cuando sea visible */
  opacity: 1;
  transform: translateY(0);
}

/* Responsivo: una sola columna en pantallas chicas */
@media (max-width: 900px){
  #contacto .contact-grid{
    grid-template-columns: 1fr;
  }
}

/* Mejor presencia (reutiliza tu sistema de tarjetas) */
.card.tinted{
  background: #fff;
  border: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 8px 24px rgba(11,31,59,.06);
  border-radius: 12px;
  padding: 1rem;
}

/* Línea de marca sutil a la izquierda */
.card.tinted.line-left{
  border-left: 4px solid var(--acento);
}

/* Links de contacto legibles y sin quiebres feos */
#contacto .contact-info a{
  text-decoration: none;
  word-break: break-word;
}
#contacto .contact-info a:hover{
  text-decoration: underline;
}

/* Utilidad accesible */
.sr-only{
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Visión corta */
.vision-short{
  margin-top: .25rem;
  font-size: clamp(.95rem, 2vw, 1.05rem);
  opacity: .95;
}

/* Contacto: filas flex centradas */
#contacto .contact-row{
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 56px;
  margin: .5rem 0;
}

#contacto .icon-3d-link{
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

#contacto .icon-3d{
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: radial-gradient(100% 100% at 30% 20%, rgba(110, 166, 200, .30) 0%, rgba(39, 64, 96, .22) 100%);
  box-shadow: 0 10px 22px rgba(7, 17, 51, .12), inset 0 1px 0 rgba(255, 255, 255, .45);
  color: #fff;
}

#contacto .icon-3d > svg{
  display: block;
  width: 24px;
  height: 24px;
}

#contacto .icon-3d--wa{
  background: radial-gradient(100% 100% at 30% 20%, rgba(37, 211, 102, .34) 0%, rgba(16, 129, 67, .28) 100%);
}

#contacto .icon-3d--map{
  background: radial-gradient(100% 100% at 30% 20%, rgba(201, 162, 39, .32) 0%, rgba(114, 84, 6, .28) 100%);
}

#contacto .contact-line{
  margin: 0;
  display: flex;
  align-items: center;
  line-height: 1.35;
  font-size: 1rem;
}

#contacto .contact-line a{
  font-weight: 600;
  color: var(--secundario);
  word-break: break-word;
}

#contacto .contact-line a:hover{
  color: var(--acento);
  text-decoration: underline;
}

#contacto .mini-map{
  margin: .75rem 0 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(11, 31, 59, .08);
}

#contacto .mini-map iframe{
  display: block;
  width: 100%;
  height: 240px;
  border: 0;
}

/* Sticky footer sin franja blanca */
html, body { height:100%; }
body{ min-height:100svh; display:flex; flex-direction:column; margin:0; padding:0; overflow-x:hidden; }
main{ flex:1 0 auto; }
footer{ margin-top:auto; }
main > section:last-of-type{ margin-bottom:0; }

/* Responsivo */
@media (max-width:700px){
  #contacto .contact-row{ min-height: 48px; gap: 10px; }
  #contacto .icon-3d{ width: 48px; height: 48px; border-radius: 12px; }
}

