/* Este archivo define los estilos para la tercera sección de fleet */
.s-fleet{
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: clip;
  --join: var(--stitch, 6px);
  margin-top: calc(-1 * var(--join));
  margin-bottom: calc(-1 * var(--join));
  position: relative;
  z-index: 1;
}

/* Define el lienzo donde está el fondo y su contenido */
.fleet__stage{
  position: relative;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  aspect-ratio: 1920 / 560;
  min-height: clamp(340px, 32vw, 560px);
  max-height: 620px;
  overflow: hidden;
  isolation: isolate;
  background: #fff;
  /* “Safe area” para colocar texto sin chocar con el camión ni con bordes */
  --safe-top: 22%;
  --safe-bot: 24%;
  --safe-x: clamp(16px, 2.2vw, 48px);
  --truck-space: clamp(240px, 36vw, 720px);
  --text-shift: clamp(18px, 3.0vw, 84px);
  --mark-w: clamp(140px, 18vw, 320px);
  --mark-opacity: 0.16;
}

/* Fondo */
.fleet__bg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  z-index: 1;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Camión */
.fleet__truck{
  position: absolute;
  left: clamp(12px, 2.2vw, 30px);
  bottom: clamp(12px, 2.0vw, 30px);
  width: clamp(260px, 32vw, 620px);
  height: auto;
  z-index: 2;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Logo*/
.fleet__mark{
  position: absolute;
  right: clamp(12px, 2.2vw, 30px);
  top: clamp(14px, 2.0vw, 38px);
  width: var(--mark-w);
  height: auto;
  opacity: var(--mark-opacity);
  z-index: 2;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Contenido */
.fleet__content{
  position: absolute;
  inset: 0;
  z-index: 3;
}

.fleet__content.container{
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Texto principal */
.fleet__text{
  position: absolute;
  left: calc(var(--safe-x) + var(--truck-space) + var(--text-shift));
  right: var(--safe-x);
  top: var(--safe-top);
  bottom: var(--safe-bot);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  max-width: min(920px, 100%);
}

/* Título principal */
.fleet__title{
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: var(--brand-red);

  font-size: clamp(30px, 4.4vw, 86px);
  line-height: 1.04;
}

/* Texto secundario */
.fleet__subtitle{
  margin: clamp(10px, 1.2vw, 14px) 0 0;
  max-width: 54ch;
  font-weight: 500;
  color: #222;
  font-size: clamp(13.5px, 1.7vw, 24px);
  line-height: 1.26;
  text-wrap: balance;
}

.fleet__rule{
  margin: clamp(12px, 1.6vw, 18px) 0 0;
  height: 4px;
  width: min(54ch, 100%);
  background: rgba(0,0,0,0.18);
  border-radius: 999px;
}

/* Responsive */
@media (max-width: 1180px){
  .fleet__stage{
    --safe-top: 20%;
    --safe-bot: 26%;
    --truck-space: clamp(210px, 34vw, 640px);
    --text-shift: clamp(14px, 2.4vw, 56px);
    min-height: clamp(360px, 34vw, 580px);
    max-height: 640px;
    --mark-w: clamp(130px, 20vw, 300px);
    --mark-opacity: 0.15;
  }
  .fleet__truck{ width: clamp(240px, 34vw, 560px); }
  .fleet__title{ font-size: clamp(28px, 4.8vw, 74px); }
  .fleet__subtitle{
    font-size: clamp(13px, 1.9vw, 20px);
    max-width: 50ch;
  }
  .fleet__rule{ width: min(50ch, 100%); }
}

@media (max-width: 900px){
  .fleet__stage{
    --safe-top: 18%;
    --safe-bot: 28%;
    --safe-x: 18px;
    --truck-space: clamp(180px, 32vw, 520px);
    --text-shift: clamp(8px, 1.8vw, 28px);
    min-height: clamp(380px, 44vw, 620px);
    max-height: 700px;
    --mark-w: clamp(120px, 22vw, 280px);
    --mark-opacity: 0.14;
  }
  .fleet__truck{
    width: clamp(220px, 36vw, 500px);
    bottom: 14px;
  }
  .fleet__title{ font-size: clamp(26px, 5.6vw, 58px); }
  .fleet__subtitle{
    font-size: clamp(12.8px, 2.2vw, 18px);
    max-width: 46ch;
  }
  .fleet__rule{ width: min(46ch, 100%); }
}

/* Modificación: sube el camión aún más en pantallas muy pequeñas */
@media (max-width: 640px){
  .fleet__stage{
    aspect-ratio: 1920 / 820;
    min-height: 500px;
    max-height: none;
    --safe-top: 14%;
    --safe-bot: 32%;
    --safe-x: 16px;
    --truck-space: clamp(160px, 26vw, 320px);
    --text-shift: 0px;
    --mark-w: clamp(120px, 28vw, 220px);
    --mark-opacity: 0.12;
  }
  .fleet__bg{ object-position: 50% 8%; }
  .fleet__truck{
    width: clamp(210px, 52vw, 440px);
    left: 12px;
    bottom: clamp(90px, 14vw, 150px);
  }
  .fleet__title{ font-size: clamp(26px, 8.0vw, 46px); }
  .fleet__subtitle{
    font-size: clamp(13px, 3.8vw, 16px);
    max-width: 40ch;
  }
  .fleet__subtitle br{ display: none; }
  .fleet__rule{ width: min(40ch, 100%); }
}

@media (max-width: 520px){
  .fleet__stage{
    aspect-ratio: 1920 / 980;
    min-height: 560px;
    --safe-top: 9%;
    --safe-x: 16px;
    --mark-w: clamp(110px, 30vw, 200px);
    --mark-opacity: 0.11;
  }
  .fleet__bg{ object-position: 50% 10%; }
  .fleet__text{
    left: var(--safe-x);
    right: var(--safe-x);
    top: var(--safe-top);
    bottom: auto;
    text-align: center;
    justify-content: flex-start;
    max-width: none;
  }
  .fleet__title{
    font-size: clamp(24px, 9.2vw, 38px);
    line-height: 1.05;
  }
  .fleet__subtitle{
    font-size: clamp(12.8px, 4.1vw, 15px);
    line-height: 1.24;
    max-width: 34ch;
    margin-left: auto;
    margin-right: auto;
  }
  .fleet__rule{
    width: min(34ch, 100%);
    margin-left: auto;
    margin-right: auto;
    margin-top: 12px;
  }
  .fleet__truck{
    left: 50%;
    transform: translateX(-50%);
    width: min(94vw, 460px);
    bottom: clamp(120px, 22vw, 200px);
  }
  .fleet__mark{
    right: 10px;
    top: 10px;
  }
}

@media (max-width: 420px){
  .fleet__stage{
    aspect-ratio: 1920 / 1120;
    min-height: 600px;
    --safe-top: 8.5%;
    --mark-w: clamp(105px, 34vw, 190px);
    --mark-opacity: 0.10;
  }
  .fleet__bg{ object-position: 50% 12%; }
  .fleet__title{ font-size: clamp(22px, 9.8vw, 34px); }
  .fleet__subtitle{
    font-size: 12.6px;
    max-width: 32ch;
  }
  .fleet__rule{ width: min(32ch, 100%); }
  .fleet__truck{
    width: min(96vw, 440px);
    bottom: clamp(140px, 26vw, 220px);
  }
}
