/* ==========================================================================
   FLOTA.CSS — solo para flota.html
   Requiere que base.css esté cargado antes.
   ========================================================================== */

/* --- Dos fotos de presentación --- */
.fleet-photos {
  background: var(--bg-page);
  padding-block: 8px 56px;
}
.fleet-photos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.fleet-photo {
  aspect-ratio: 4 / 3;
  border-radius: 16px;
}

/* --- Bloque de datos: cifras generales --- */
.fleet-stats {
  background: var(--navy);
  padding-block: 48px;
}
.fleet-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
.fleet-stat-number {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--orange);
  margin: 0 0 6px;
}
.fleet-stat-label {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  margin: 0;
}

/* --- Tipos de unidades --- */
.fleet-units {
  background: var(--bg-page);
  padding-block: 64px;
}
.fleet-units h2 {
  color: var(--maroon);
  font-size: 1.9rem;
  margin-bottom: 36px;
}
.fleet-units-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.unit-card {
  background: var(--bg-white);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(12, 33, 43, 0.08);
}
.unit-photo {
  aspect-ratio: 16 / 10;
  width: 100%;
  object-fit: cover;
  display: block;
}
.unit-body {
  padding: 22px 24px 26px;
}
.unit-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-block: 8px;
  border-bottom: 1px solid var(--line);
}
.unit-row:first-child { padding-top: 0; }
.unit-row dt {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--navy);
}
.unit-row dd {
  margin: 0;
  font-weight: 600;
  color: var(--maroon);
  text-align: right;
}
.unit-ideal {
  margin: 14px 0 0;
  font-size: 0.9rem;
  color: #4B5A66;
}
.unit-ideal span {
  font-weight: 700;
  color: var(--navy);
}

/* --- Tarjeta de Personal Capacitado: mismo formato, con acento naranja --- */
.unit-card--people {
  border-top: 4px solid var(--orange);
}
.unit-card--people .unit-body h3 {
  color: var(--navy);
  font-size: 1.2rem;
  margin-bottom: 10px;
}
.unit-card--people .unit-ideal {
  margin-top: 0;
  font-size: 0.95rem;
}

/* ==========================================================================
   ILUSTRACIONES VECTORIALES DE LAS UNIDADES
   Cada SVG vive dentro de .unit-vector. Quieto por defecto; al pasar el
   cursor (o al enfocar la tarjeta con teclado) el contenedor flota y
   cada uno anima su propio detalle.
   ========================================================================== */
.unit-vector {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 90% at 50% 100%, #E3EDF3 0%, #F4F8FA 55%, #FFFFFF 100%);
  border-bottom: 1px solid var(--line);
}
.unit-vector svg {
  width: 86%;
  max-height: 92%;
  height: auto;
  overflow: visible;
}

/* Todas las piezas animadas giran/escalan respecto a su propia caja */
.v-body, .v-shadow, .v-door, .v-tarp, .v-wall, .v-fan, .v-cold, .v-air {
  transform-box: fill-box;
}
.v-shadow { transform-origin: center; }
.v-door--l { transform-origin: left center; transition: transform 0.6s ease; }
.v-door--r { transform-origin: right center; transition: transform 0.6s ease; }
.v-tarp { transform-origin: 50% 100%; }
.v-wall { transform-origin: 50% 100%; transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.v-fan { transform-origin: center; }
.v-air { opacity: 0; }

/* Flotación general */
.unit-card:hover .v-body,
.unit-card:focus-within .v-body { animation: v-float 2.6s ease-in-out infinite; }
.unit-card:hover .v-shadow,
.unit-card:focus-within .v-shadow { animation: v-shadow 2.6s ease-in-out infinite; }

/* 1. Caja seca: las puertas se entreabren */
.unit-card:hover .v-door--l { transform: scaleX(0.78); }
.unit-card:hover .v-door--r { transform: scaleX(0.6); }

/* 2. Open top: la lona ondea */
.unit-card:hover .v-tarp { animation: v-tarp 1.8s ease-in-out infinite; }

/* 3. Refrigerado: gira el ventilador, parpadea el indicador y sale aire frío */
.unit-card:hover .v-fan { animation: v-spin 0.8s linear infinite; }
.unit-card:hover .v-cold { animation: v-blink 1.2s ease-in-out infinite; }
.unit-card:hover .v-air { animation: v-drift 1.6s ease-out infinite; }
.unit-card:hover .v-air--2 { animation-delay: 0.4s; }
.unit-card:hover .v-air--3 { animation-delay: 0.8s; }

/* 4. Plataforma: las cabeceras se abren hacia afuera */
.unit-card:hover .v-wall--l { transform: rotate(-7deg); }
.unit-card:hover .v-wall--r { transform: rotate(7deg); }

@keyframes v-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}
@keyframes v-shadow {
  0%, 100% { transform: scale(1);    opacity: 0.14; }
  50%      { transform: scale(0.88); opacity: 0.08; }
}
@keyframes v-tarp {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50%      { transform: translateY(-2px) scaleY(1.07); }
}
@keyframes v-spin {
  to { transform: rotate(360deg); }
}
@keyframes v-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}
@keyframes v-drift {
  0%   { opacity: 0; transform: translate(0, 0); }
  30%  { opacity: 1; }
  100% { opacity: 0; transform: translate(12px, -4px); }
}

/* --- Galería: dos líneas de fotos en movimiento continuo,
   cada una en sentido opuesto (marquee 100% CSS, sin JS) --- */
.fleet-gallery {
  background: var(--bg-white);
  padding-block: 64px 88px;
}
.fleet-gallery h2 {
  color: var(--maroon);
  font-size: 1.9rem;
  margin-bottom: 32px;
}
.marquee-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
}
.marquee-row {
  overflow: hidden;
  width: 100%;
}
.marquee-track {
  display: flex;
  gap: 20px;
  width: max-content;
}
.marquee-row--left .marquee-track {
  animation: marquee-left 32s linear infinite;
}
.marquee-row--right .marquee-track {
  animation: marquee-right 36s linear infinite;
}
.marquee-track img {
  flex: 0 0 auto;
  width: 220px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
}

@keyframes marquee-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes marquee-right {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

/* Pausa el movimiento al pasar el cursor, para quien quiera ver una foto fija */
.marquee-row:hover .marquee-track {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation-play-state: paused !important; }
  .unit-card:hover .v-body,
  .unit-card:hover .v-shadow,
  .unit-card:hover .v-tarp,
  .unit-card:hover .v-fan,
  .unit-card:hover .v-cold,
  .unit-card:hover .v-air,
  .unit-card:focus-within .v-body,
  .unit-card:focus-within .v-shadow { animation: none; }
  .unit-card:hover .v-door--l,
  .unit-card:hover .v-door--r,
  .unit-card:hover .v-wall--l,
  .unit-card:hover .v-wall--r { transform: none; }
}

/* ==========================================================================
   RESPONSIVE — Flota
   ========================================================================== */
@media (max-width: 880px) {
  .fleet-photos-grid { grid-template-columns: 1fr; }
  .fleet-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .fleet-units-grid { grid-template-columns: 1fr; }
  .marquee-track img { width: 160px; }
}