/* ==============================================================
   Morrent — main.css
   Solo estilos personalizados. Las utilidades (grid, flex, spacing,
   colores, etc.) las genera Tailwind (CDN) a partir de js/tailwind-config.js.
   ============================================================== */

/* ---------- Títulos H1 de hero: vw con límites (clamp) ----------
   Antes usaban solo vw puro, sin techo. Eso hace que en pantallas
   angostas "grandes" (cerca de 767px, justo antes del breakpoint md)
   el texto crezca demasiado, y que en monitores muy anchos (>1600px)
   crezca sin límite. clamp(min, preferido-en-vw, max) resuelve ambos
   extremos sin perder el efecto tipográfico grande que ya tenía el sitio. */
.hero-h1-1 { font-size: clamp(2.75rem, 13vw, 6.5rem); }
@media (min-width: 768px) { .hero-h1-1 { font-size: clamp(4rem, 7.2vw, 8.5rem); } }

.hero-h1-2 { font-size: clamp(2.5rem, 12vw, 6rem); }
@media (min-width: 768px) { .hero-h1-2 { font-size: clamp(3.5rem, 6.5vw, 7.5rem); } }

.hero-h1-3 { font-size: clamp(2.25rem, 11vw, 5.5rem); }
@media (min-width: 768px) { .hero-h1-3 { font-size: clamp(3rem, 5.5vw, 6.5rem); } }

.hero-h1-4 { font-size: clamp(2.25rem, 10vw, 5rem); }
@media (min-width: 768px) { .hero-h1-4 { font-size: clamp(3rem, 5.5vw, 6.5rem); } }

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
  /* Evita que el header fijo tape el destino al navegar a un ancla
     (#servicios, #proceso, #gruas...). Suma la altura real del header
     (h-20/h-24 = 80px/96px) más su padding de safe-area. */
  scroll-padding-top: calc(5.5rem + env(safe-area-inset-top, 0px));
}
@media (min-width: 768px) {
  html { scroll-padding-top: calc(6.5rem + env(safe-area-inset-top, 0px)); }
}

body {
  background-color: #FFFFFF;
  font-family: 'Inter', sans-serif;
  color: #15130F;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: 'Big Shoulders Display', sans-serif;
}

::selection,
::-moz-selection {
  background-color: #F5B400;
  color: #15130F;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid #E0531F;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Entrada suave de la página ---------- */
body {
  animation: page-fade-in .6s ease both;
}
@keyframes page-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- Barra de progreso de scroll ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2.5px;
  width: 0%;
  background: linear-gradient(90deg, #E0531F, #F5B400);
  z-index: 60;
  transition: width .12s linear;
  pointer-events: none;
}

/* ---------- Tipografía de apoyo ---------- */
.eyebrow,
.section-label {
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  font-size: .875rem;
  letter-spacing: .2em;
}

.eyebrow { color: #e08f1f; }
.section-label { color: #6E675D; }

/* Eyebrow sobre imágenes: se agrega una "píldora" con fondo oscuro
   semitransparente + blur para que el texto siempre tenga contraste,
   sin importar la foto de fondo. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: .5rem 1rem;
  background: rgba(21, 19, 15, .55);
  border-left: 2px solid currentColor;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ---------- Textos pequeños: un poco más grandes, legibles y justificados ---------- */
.text-xs {
  font-size: .8125rem !important;
  line-height: 1.4 !important;
}
.text-sm {
  font-size: .95rem !important;
  line-height: 1.55 !important;
}
.text-\[10px\] {
  font-size: .75rem !important;
}
.text-xs,
.text-sm {
  text-align: justify;
  text-justify: inter-word;
}

/* ---------- Botones ---------- */
.btn-primary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 1rem 1.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: .875rem;
  text-transform: uppercase;
  letter-spacing: .025em;
  transition: all .3s cubic-bezier(.4, 0, .2, 1);
}

.btn-primary {
  background-color: #15130F;
  color: #FFFFFF;
  clip-path: polygon(0 0, 100% 0, 100% 92%, 92% 100%, 0 100%);
}
.btn-primary:hover { background-color: #E0531F; }

.btn-outline {
  border: 1px solid #15130F;
  color: #15130F;
}
.btn-outline:hover {
  background-color: #F5B400;
  border-color: #F5B400;
  color: #15130F;
}

.btn-primary:hover,
.btn-outline:hover {
  transform: translateY(-2px);
}
.btn-primary:active,
.btn-outline:active {
  transform: translateY(0);
}

.btn-whatsapp {
  position: fixed;
  bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  right: calc(1.5rem + env(safe-area-inset-right, 0px));
  z-index: 40;
  display: flex;
  height: 3.5rem;
  width: 3.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: #1FAE5C;
  color: #FFFFFF;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,.15), 0 4px 6px -4px rgba(0,0,0,.15);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
}
.btn-whatsapp:hover { transform: scale(1.1); }

.btn-whatsapp::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background-color: #1FAE5C;
  z-index: -1;
  animation: wa-pulse 2.6s cubic-bezier(.4, 0, .6, 1) infinite;
}
@keyframes wa-pulse {
  0%   { transform: scale(1);   opacity: .45; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* ==============================================================
   HEADER — dos estados: sobre imagen (transparente) y sólido.
   El JS solo alterna la clase; todo el look vive aquí.
   ============================================================== */
.site-header {
  transition: background-color .35s ease, box-shadow .35s ease,
              border-color .35s ease, backdrop-filter .35s ease;
  /* Empuja el contenido del header por debajo del notch / isla dinámica
     en iPhone y de la barra de estado en Android, sin afectar la altura
     del header en dispositivos sin recorte (el env() vale 0 ahí). */
  padding-top: env(safe-area-inset-top, 0px);
}

.site-header .brand-name,
.site-header .brand-tag,
.site-header .nav-link,
.site-header .contact-btn,
.site-header .burger-line {
  transition: color .3s ease, border-color .3s ease, background-color .3s ease;
}

.site-header .nav-link {
  position: relative;
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .25em;
}

/* Subrayado minimalista que crece desde el centro */
.site-header .nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 0%;
  height: 1px;
  background: currentColor;
  transform: translateX(-50%);
  transition: width .35s cubic-bezier(.4, 0, .2, 1);
}
.site-header .nav-link:hover::after,
.site-header .nav-link:focus-visible::after {
  width: 100%;
}

.brand-name {
  transition: opacity .3s ease, transform .3s ease;
}
.site-header a:hover .brand-name {
  opacity: .88;
}

/* --- Estado "transparente": header flotando sobre una foto --- */
.site-header.header-transparent {
  background-color: rgba(21, 19, 15, .30);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.site-header.header-transparent .brand-name { color: #FFFFFF; }
.site-header.header-transparent .brand-tag { color: rgba(255, 255, 255, .75); }
.site-header.header-transparent .nav-link { color: rgba(255, 255, 255, .92); }
.site-header.header-transparent .nav-link:hover { color: #F5B400; }
.site-header.header-transparent .contact-btn {
  border-color: rgba(255, 255, 255, .85);
  color: #FFFFFF;
}
.site-header.header-transparent .contact-btn:hover {
  background-color: #F5B400;
  border-color: #F5B400;
  color: #15130F;
}
.site-header.header-transparent .burger-line { background-color: #FFFFFF; }

/* --- Estado "sólido": al hacer scroll, o siempre en páginas internas --- */
.site-header.header-solid {
  background-color: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(21, 19, 15, .08);
  box-shadow: 0 1px 2px rgba(21, 19, 15, .04);
}
.site-header.header-solid .brand-name { color: #15130F; }
.site-header.header-solid .brand-tag { color: #6E675D; }
.site-header.header-solid .nav-link { color: rgba(21, 19, 15, .82); }
.site-header.header-solid .nav-link:hover { color: #E0531F; }
.site-header.header-solid .contact-btn {
  border-color: #15130F;
  color: #15130F;
}
.site-header.header-solid .contact-btn:hover {
  background-color: #F5B400;
  border-color: #F5B400;
  color: #15130F;
}
.site-header.header-solid .burger-line { background-color: #15130F; }

/* ---------- Menú móvil ---------- */
#mobile-menu a {
  font-family: 'Big Shoulders Display', sans-serif;
}

/* ---------- Cuadrícula de materiales (Agregados) ---------- */
.agg-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid rgba(21,19,15,.08);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(21,19,15,.06);
  transition: box-shadow .3s ease, transform .3s ease;
}

.agg-card:hover {
  box-shadow: 0 10px 24px rgba(21,19,15,.12);
  transform: translateY(-3px);
}

.agg-card-img {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #15130F;
}

.agg-card-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform .6s cubic-bezier(.25, 1, .5, 1), filter .6s ease;
}

.agg-card:hover .agg-card-img img {
  transform: scale(1.08);
}

.agg-card-body {
  padding: 1.1rem 1.2rem 1.4rem;
}

.agg-card-name {
  font-family: 'Big Shoulders Display', sans-serif;
  text-transform: uppercase;
  letter-spacing: -.01em;
  color: #15130F;
  font-size: 1.3rem;
  line-height: 1.1;
  position: relative;
  padding-bottom: .7rem;
  margin-bottom: .7rem;
}

.agg-card-name::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 2rem;
  height: 3px;
  background: #E0531F;
}

.agg-card-desc {
  font-size: .85rem;
  line-height: 1.45;
  color: #6E675D;
}

@media (min-width: 768px) {
  .agg-card-name { font-size: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  .agg-card-img img { transition: none; }
  .agg-card { transition: none; }
}

/* ---------- Animación de entrada (scroll reveal) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s cubic-bezier(.16, 1, .3, 1),
              transform .8s cubic-bezier(.16, 1, .3, 1);
  transition-delay: var(--stagger, 0ms);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Pequeño "pop" en las cifras destacadas al aparecer */
section.bg-ink .reveal.is-visible p.font-display {
  animation: pop-in .5s cubic-bezier(.34, 1.56, .64, 1) both;
}
@keyframes pop-in {
  from { transform: scale(.86); }
  to   { transform: scale(1); }
}

/* ---------- Marquee de clientes ---------- */
.marquee-track {
  animation: marquee 28s linear infinite;
}
.marquee-track:hover {
  animation-play-state: paused;
}
@keyframes marquee {
  0%  { transform: translateX(0); }
  to  { transform: translateX(-50%); }
}

/* ---------- Botón WhatsApp pequeño (tarjetas de catálogo) ---------- */
.btn-whatsapp-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: 100%;
  padding: .55rem .75rem;
  background-color: #1FAE5C;
  color: #FFFFFF;
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  transition: background-color .25s ease, transform .25s ease;
}
.btn-whatsapp-sm:hover {
  background-color: #178C49;
  transform: translateY(-1px);
}

/* ---------- Utilidades varias ---------- */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ---------- Carrusel de maquinaria: navegación funcional ---------- */
.carousel-track { -webkit-overflow-scrolling: touch; }
.carousel-track.is-dragging { scroll-snap-type: none; cursor: grabbing; }
.carousel-arrow[disabled] { pointer-events: none; }
.carousel-progress-fill { transition: width 0.15s ease-out; }

@media (prefers-reduced-motion: reduce) {
  .carousel-track { scroll-behavior: auto; }
}

/* ---------- Tarjetas de catálogo: elevación + sombra suave al pasar el cursor ---------- */
.group[data-card],
.group.card-hover {
  transition: transform .45s cubic-bezier(.16, 1, .3, 1), box-shadow .45s ease;
}
.group[data-card]:hover,
.group.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -20px rgba(21, 19, 15, .25);
}

/* ---------- Subrayado animado para enlaces de texto en párrafos ---------- */
.link-underline {
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  transition: background-size .35s cubic-bezier(.4, 0, .2, 1);
}
.link-underline:hover { background-size: 100% 1px; }

/* ---------- Números / cifras que "cuentan" al aparecer (activado por JS) ---------- */
.count-up {
  font-variant-numeric: tabular-nums;
}

/* ---------- Iconos: leve rebote al pasar el cursor ---------- */
.icon-bounce { transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.icon-bounce:hover,
.group:hover .icon-bounce { transform: translateY(-3px) scale(1.08); }

/* ---------- Imágenes: aparición con leve desenfoque (blur-up) ---------- */
img.reveal-img {
  filter: blur(8px);
  transform: scale(1.03);
  transition: filter .9s ease, transform .9s cubic-bezier(.16, 1, .3, 1);
}
img.reveal-img.is-loaded {
  filter: blur(0);
  transform: scale(1);
}

/* ==============================================================
   ANIMACIONES NUEVAS
   ============================================================== */

/* ---------- 1) Ken Burns sutil en la imagen del hero ----------
   Zoom lento y continuo, casi imperceptible, típico de sitios de
   servicios/turismo. Se pausa solo con reduced-motion.
   Uso: agregar la clase "ken-burns" al <img> del hero. */
.ken-burns {
  animation: ken-burns 22s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes ken-burns {
  from { transform: scale(1); }
  to   { transform: scale(1.08); }
}

/* ---------- 2) Barrido de luz (shine) en tarjetas con imagen ----------
   Un destello diagonal cruza la tarjeta al pasar el cursor, además
   del scale que ya tenían. Se ve premium en las tarjetas de
   "Servicios destacados" y en la galería.
   Uso: agregar la clase "shine-card" al contenedor <a>/<div> que
   ya tiene overflow-hidden (las tarjetas de imagen). */
.shine-card { position: relative; }
.shine-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.35) 50%, transparent 60%);
  background-size: 250% 250%;
  background-position: 120% 120%;
  opacity: 0;
  transition: opacity .3s ease;
}
.shine-card:hover::after {
  opacity: 1;
  animation: shine-sweep 1.1s ease forwards;
}
@keyframes shine-sweep {
  from { background-position: 120% 120%; }
  to   { background-position: -20% -20%; }
}

/* ---------- 3) Línea que se dibuja bajo los "eyebrow"/section-label ----------
   Un pequeño trazo naranja crece de 0 a su ancho final cuando el
   bloque entra en pantalla (se combina con .reveal existente).
   Uso: envolver o aplicar junto a .reveal en el <p class="eyebrow">
   o <p class="section-label"> agregando la clase "underline-draw". */
.underline-draw {
  position: relative;
  padding-bottom: .6rem;
}
.underline-draw::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: currentColor;
  transition: width .6s cubic-bezier(.16, 1, .3, 1) .15s;
}
.reveal.is-visible.underline-draw::after { width: 2.5rem; }

/* ---------- 4) Entrada con rebote del botón flotante de WhatsApp ----------
   En vez de aparecer estático, entra con un pequeño rebote al
   cargar la página. El pulso (wa-pulse) ya existente sigue igual. */
.btn-whatsapp {
  animation: wa-bounce-in .6s cubic-bezier(.34, 1.56, .64, 1) .8s both;
}
@keyframes wa-bounce-in {
  0%   { transform: scale(0) translateY(20px); opacity: 0; }
  70%  { transform: scale(1.08) translateY(-4px); opacity: 1; }
  100% { transform: scale(1) translateY(0); }
}

/* ---------- 5) Ripple (onda) al hacer clic en botones ----------
   Requiere el pequeño helper en main.js que agrega un <span
   class="ripple"> con la posición del clic. Funciona en
   .btn-primary, .btn-outline y .btn-whatsapp-sm. */
.btn-primary, .btn-outline, .btn-whatsapp-sm {
  position: relative;
  overflow: hidden;
}
.ripple {
  position: absolute;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .55);
  transform: scale(0);
  animation: ripple-effect .6s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple-effect {
  to { transform: scale(2.8); opacity: 0; }
}

/* ---------- 6) Shimmer de carga para imágenes con lazy-load ----------
   Mientras la imagen no ha terminado de cargar (antes de que
   main.js le agregue "is-loaded"), se ve un degradado animado
   tipo skeleton en vez de un hueco vacío o solo el blur.
   Uso: ya aplica automáticamente a toda <img class="reveal-img">. */
img.reveal-img {
  background: linear-gradient(100deg, #eceae5 30%, #f6f4f0 50%, #eceae5 70%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}
img.reveal-img.is-loaded {
  animation: none;
  background: none;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Respeto a "reducir movimiento" para todo lo nuevo ---------- */
@media (prefers-reduced-motion: reduce) {
  body { animation: none; opacity: 1; }
  .btn-whatsapp::before { animation: none; display: none; }
  section.bg-ink .reveal.is-visible p.font-display { animation: none; }
  .btn-primary:hover,
  .btn-outline:hover,
  .btn-primary:active,
  .btn-outline:active { transform: none; }
  .scroll-progress { transition: none; }
  .group[data-card]:hover,
  .group.card-hover:hover { transform: none; }
  .icon-bounce:hover,
  .group:hover .icon-bounce { transform: none; }
  img.reveal-img { filter: none; transform: none; transition: none; animation: none; background: none; }
  .ken-burns { animation: none; }
  .shine-card::after { display: none; }
  .underline-draw::after { transition: none; width: 2.5rem; }
  .btn-whatsapp { animation: none; }
  .ripple { display: none; }
}
/* ---------- Menú móvil: mejoras de UX (bloqueo scroll, animación burger) ---------- */
body.menu-open {
  overflow: hidden;
}

#menu-toggle .burger-line {
  transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .25s ease, width .25s ease;
  transform-origin: center;
}

/* Anima las 3 líneas del botón hamburguesa a una "X" cuando el menú está abierto */
#menu-toggle.is-open .burger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  width: 1.5rem;
}
#menu-toggle.is-open .burger-line:nth-child(2) {
  opacity: 0;
}
#menu-toggle.is-open .burger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  width: 1.5rem;
  align-self: center;
}

/* El botón hamburguesa siempre se ve blanco sobre el panel oscuro del menú abierto */
#menu-toggle.is-open .burger-line {
  background-color: #FFFFFF !important;
}

/* ---------- Menú móvil: panel y enlaces ---------- */
#mobile-menu {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: calc(1.5rem + env(safe-area-inset-top, 0px));
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
}

#mobile-menu a {
  font-family: 'Big Shoulders Display', sans-serif;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .4s ease, transform .4s ease;
}

/* Entrada escalonada de los enlaces cuando el menú está visible */
#mobile-menu.translate-x-0 a {
  opacity: 1;
  transform: translateY(0);
}
#mobile-menu.translate-x-0 a:nth-child(1) { transition-delay: .08s; }
#mobile-menu.translate-x-0 a:nth-child(2) { transition-delay: .13s; }
#mobile-menu.translate-x-0 a:nth-child(3) { transition-delay: .18s; }
#mobile-menu.translate-x-0 a:nth-child(4) { transition-delay: .23s; }
#mobile-menu.translate-x-0 a:nth-child(5) { transition-delay: .28s; }
#mobile-menu.translate-x-0 a:nth-child(6) { transition-delay: .33s; }
#mobile-menu.translate-x-0 a:nth-child(7) { transition-delay: .38s; }

/* Enlace de la página actual, resaltado dentro del menú móvil */
#mobile-menu a.is-current {
  color: #F5B400;
  position: relative;
}
#mobile-menu a.is-current::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 2.5rem;
  height: 3px;
  background: #F5B400;
}

@media (prefers-reduced-motion: reduce) {
  #mobile-menu a,
  #menu-toggle .burger-line {
    transition: none !important;
  }
}

/* Enlace activo en la navegación de escritorio (página actual) */
.site-header .nav-link.is-current::after {
  width: 100%;
}
.site-header.header-transparent .nav-link.is-current { color: #F5B400; }
.site-header.header-solid .nav-link.is-current { color: #E0531F; }

/* ---------- Footer: letras un poco más grandes y en negritas ---------- */
footer p,
footer li,
footer a,
footer span {
  font-weight: 700;
}
footer p,
footer li,
footer ul {
  font-size: 1rem !important;
  line-height: 1.6 !important;
}
footer .text-xs {
  font-size: .9rem !important;
}