/* ==========================================================================
   EDIMEX GRÚAS · SECCIÓN 02: MAQUINARIA (maquinaria.css)
   Réplica exacta de referencia-secc-02.png (1491 x 1055 px)
   ========================================================================== */

@font-face {
  font-family: 'Tektur';
  src: url('../assets/Tektur-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: block;
}

:root {
  --maq-black: #0A0A0F;
  --maq-blue: #1E28FF;
  --maq-text: #2B2F3A;
  --maq-bg: #F7F8FB;
  --maq-bar: #ECEEF4;
  --maq-sep: #D5D9E2;
  --maq-cross: #CBD0DA;
}

.maq {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--maq-bg);
}

.maq .stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1491px;
  height: 1055px;
  transform-origin: center center;
  transform: translate(-50%, -50%) scale(var(--s, 1));
}

/* Capas */
.maq .layer {
  position: absolute;
  left: calc(var(--x) * 1px);
  top: calc(var(--y) * 1px);
  width: calc(var(--w) * 1px);
  height: calc(var(--h) * 1px);
  transform: rotate(var(--r, 0deg));
  z-index: var(--z, 1);
  opacity: var(--o, 1);
  box-sizing: border-box;
}

.maq .layer[data-hidden="true"] {
  visibility: hidden;
}

.maq img {
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* 5.2 Fondo técnico: Cuadrícula y Cruces */
.maq .grid {
  background-image:
    linear-gradient(to right, rgba(15, 23, 42, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.045) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: linear-gradient(to left, #000 20%, transparent 95%), linear-gradient(to bottom, #000 40%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
  mask-image: linear-gradient(to left, #000 20%, transparent 95%), linear-gradient(to bottom, #000 40%, transparent 100%);
  pointer-events: none;
}

.maq .cross {
  pointer-events: none;
}

.maq .cross::before,
.maq .cross::after {
  content: "";
  position: absolute;
  background: #CBD0DA;
}

.maq .cross::before {
  left: 50%;
  top: 0;
  width: 1.5px;
  height: 100%;
  transform: translateX(-50%);
}

.maq .cross::after {
  top: 50%;
  left: 0;
  height: 1.5px;
  width: 100%;
  transform: translateY(-50%);
}

/* 5.3 Eyebrow, Titular y Párrafo */
.maq .eyebrow {
  pointer-events: none;
}

.maq .eyebrow-text {
  font: 800 14px/1 'Montserrat', sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1E28FF;
  border-bottom: 2px solid #1E28FF;
  padding-bottom: 5px;
  display: inline-block;
}

/* Titular Vectorial Maquinaria (Misma tipografía Tektur-Black que el Hero) */
.maq .maq-title {
  margin: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  user-select: none;
  pointer-events: none;
}

.maq-title-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  pointer-events: auto;
}

.maq-title-svg .t-black {
  fill: #0A0A0F;
}

.maq-title-svg .t-blue {
  fill: #1E28FF;
}

.maq .parrafo {
  margin: 0;
  font: 400 17px/25px 'Inter', sans-serif;
  color: #2B2F3A;
  white-space: nowrap;
  pointer-events: none;
}

/* 6. Separador "NUESTRA MAQUINARIA" */
.maq .sep-maq {
  overflow: visible;
  pointer-events: none;
}

.maq .sep-titulo {
  margin: 0;
  text-align: center;
  font: 800 16px/24px 'Montserrat', sans-serif;
  letter-spacing: 0.08em;
  color: #1E28FF;
  pointer-events: none;
}

/* ==========================================================================
   ANIMACIONES DE APARICIÓN (SCROLL REVEAL) Y TRANSICIONES
   ========================================================================== */
.maq-anim {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.js-reveal .maq-anim {
  opacity: 0;
  transform: translateY(28px);
}

.js-reveal .maq-in-view .maq-anim {
  opacity: 1;
  transform: translateY(0);
}

.js-reveal .maq-in-view [data-layer="maq-eyebrow"] { transition-delay: 0.05s; }
.js-reveal .maq-in-view [data-layer="maq-parrafo"] { transition-delay: 0.22s; }
.js-reveal .maq-in-view [data-layer="maq-separador"] { transition-delay: 0.28s; }
.js-reveal .maq-in-view [data-layer="maq-separador-texto"] { transition-delay: 0.28s; }
.js-reveal .maq-in-view [data-layer="maq-beneficios"] { transition-delay: 0.65s; }

/* --------------------------------------------------------------------------
   Animación de aparición específica para el Titular Vectorial (.maq-title-svg)
   -------------------------------------------------------------------------- */
.maq-title-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  pointer-events: auto;
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.js-reveal .maq-title-svg {
  opacity: 0;
  transform: translateY(32px);
}

.js-reveal .maq-in-view .maq-title-svg {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.12s;
}

/* --------------------------------------------------------------------------
   Animación de aparición específica para las Tarjetas (.card-shape)
   -------------------------------------------------------------------------- */
.maq .card {
  pointer-events: auto;
  cursor: pointer;
}

/* Las capas externas de las tarjetas se mantienen estables mientras .card-shape anima */
.js-reveal .maq .card.maq-anim {
  opacity: 1;
  transform: translateY(0);
}

.maq .card-shape {
  position: absolute;
  inset: 0;
  background: #ffffff;
  clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% calc(100% - 28px), calc(100% - 28px) 100%, 0 100%);
  filter: drop-shadow(0 12px 28px rgba(20, 30, 70, 0.09));
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              background-color 0.25s ease;
  will-change: transform, opacity, filter;
}

/* Estado inicial oculto previo al scroll */
.js-reveal .maq .card .card-shape {
  opacity: 0;
  transform: translateY(42px) scale(0.96);
  filter: drop-shadow(0 4px 12px rgba(20, 30, 70, 0.03));
}

/* Aparición al scrollear hacia abajo (stagger tarjeta por tarjeta) */
.js-reveal .maq-in-view .card .card-shape {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: drop-shadow(0 12px 28px rgba(20, 30, 70, 0.09));
}

.js-reveal .maq-in-view [data-layer="maq-card-1"] .card-shape {
  transition-delay: 0.16s;
}
.js-reveal .maq-in-view [data-layer="maq-card-2"] .card-shape {
  transition-delay: 0.28s;
}
.js-reveal .maq-in-view [data-layer="maq-card-3"] .card-shape {
  transition-delay: 0.40s;
}
.js-reveal .maq-in-view [data-layer="maq-card-4"] .card-shape {
  transition-delay: 0.52s;
}

/* Micro-interacción Hover sobre .card-shape una vez visible */
.maq .card:hover .card-shape,
.maq-in-view .card:hover .card-shape {
  transform: translateY(-10px) scale(1.015) !important;
  filter: drop-shadow(0 24px 44px rgba(20, 30, 70, 0.18)) !important;
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1),
              filter 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

/* Aparición sincronizada de la foto de maquinaria dentro de la tarjeta */
.js-reveal .maq .card .card-img {
  opacity: 0;
  transform: translateY(16px) scale(0.92);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.js-reveal .maq-in-view .card .card-img {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.js-reveal .maq-in-view [data-layer="maq-card-1"] .card-img { transition-delay: 0.24s; }
.js-reveal .maq-in-view [data-layer="maq-card-2"] .card-img { transition-delay: 0.36s; }
.js-reveal .maq-in-view [data-layer="maq-card-3"] .card-img { transition-delay: 0.48s; }
.js-reveal .maq-in-view [data-layer="maq-card-4"] .card-img { transition-delay: 0.60s; }

.maq .card:hover .card-img {
  transform: translateY(-8px) scale(1.05) !important;
}

.maq .card-icon-slot {
  position: absolute;
  left: 41px;
  top: 28px;
  width: 38px;
  height: 38px;
  pointer-events: none;
}

.maq .card-label {
  position: absolute;
  left: calc(var(--tx, 43) * 1px);
  top: 27px;
  margin: 0;
  font: 700 13px/18px 'Montserrat', sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1E28FF;
}

.maq .card-name {
  position: absolute;
  left: calc(var(--tx, 43) * 1px);
  top: 45px;
  margin: 0;
  font: 800 20px/26px 'Montserrat', sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #1E28FF;
}

.maq .card-img {
  position: absolute;
  left: calc(var(--ix, 50) * 1px);
  bottom: 125px; /* base uniforme y=260 */
  width: calc(var(--iw, 230) * 1px);
  height: 172px;
  max-height: 172px;
  object-fit: contain;
  object-position: center bottom;
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.maq .card:hover .card-img {
  transform: translateY(-8px) scale(1.045);
}

.maq .card-desc {
  position: absolute;
  left: 43px;
  top: 272px;
  margin: 0;
  white-space: nowrap;
  font: 400 14.5px/22px 'Inter', sans-serif;
  color: #2B2F3A;
}

.maq .card-link {
  position: absolute;
  left: 43px;
  top: 348px;
  display: flex;
  align-items: center;
  gap: 20px;
  font: 800 13px/18px 'Montserrat', sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0A0A0F;
  text-decoration: none;
  pointer-events: auto;
  transition: color 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.maq .card:hover .card-link {
  color: #1E28FF;
}

.maq .card-link svg {
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.maq .card:hover .card-link svg {
  transform: translateX(7px);
}

.maq .card-line {
  position: absolute;
  left: 0;
  bottom: 0;
  width: calc(100% - 28px);
  height: 3px;
  background: #1E28FF;
  transition: height 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.maq .card:hover .card-line {
  height: 4.5px;
  box-shadow: 0 0 16px rgba(30, 40, 255, 0.85);
}

/* 8. Barra Inferior de Beneficios con Micro-interacciones */
.maq .beneficios {
  background: #ECEEF4;
  border-radius: 26px;
  pointer-events: auto;
}

.maq .ben {
  position: static;
  cursor: default;
}

.maq .ben-icon {
  position: absolute;
  left: calc(var(--ix) * 1px);
  top: 30px;
  width: 56px;
  height: 56px;
  object-fit: contain;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
              filter 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.maq .ben:hover .ben-icon {
  transform: translateY(-5px) scale(1.08);
  filter: drop-shadow(0 6px 14px rgba(30, 40, 255, 0.3));
}

.maq .ben-text {
  position: absolute;
  left: calc(var(--tx) * 1px);
  top: 31px;
  white-space: nowrap;
}

.maq .ben-text h4 {
  margin: 0;
  font: 800 14px/20px 'Montserrat', sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #0A0A0F;
  transition: color 0.25s ease;
}

.maq .ben:hover .ben-text h4 {
  color: #1E28FF;
}

.maq .ben-text p {
  margin: 1px 0 0;
  font: 400 13px/21px 'Inter', sans-serif;
  color: #3A3F4B;
}

.maq .ben-sep {
  position: absolute;
  top: 28px;
  width: 1px;
  height: 60px;
  background: #D5D9E2;
}

