/* IPEI Logística – maqueta estática (Figma: one scroll page 51:207) */

:root {
  --ipei-pink: #d6225f;
  --ipei-green: #1faf38;
  --ipei-yellow: #ffd609;
  --ipei-gray: #f9f9f9;
  --ipei-black: #000;
  --ipei-white: #fff;
  --ipei-radius: 15px;
  --ipei-shadow: 0 2px 4px rgba(0, 0, 0, .25);
  --ipei-ease: cubic-bezier(.22, .61, .36, 1);
  --bs-body-font-family: "DM Sans", sans-serif;
}

body {
  font-family: var(--bs-body-font-family);
  color: var(--ipei-black);
  background: var(--ipei-white);
}

img { max-width: 100%; }

/* Contenedor: el diseño trabaja sobre 1280px útiles (x 80–1360) */
@media (min-width: 1400px) {
  .container { max-width: 1304px; }
}

/* Tipografía */
.fw-black { font-weight: 900; }
.fw-extrabold { font-weight: 800; }
.fw-semibold { font-weight: 600; }

.text-pink { color: var(--ipei-pink); }
.bg-pink { background: var(--ipei-pink); }
.bg-ipei-gray { background: var(--ipei-gray); }

.title-xl { font-size: clamp(2.5rem, 4.9vw, 4.375rem); line-height: 1.3; }   /* 70px */
.title-lg { font-size: clamp(2.25rem, 4.4vw, 4rem); line-height: 1.3; }      /* 64px */
.title-md { font-size: clamp(2.25rem, 4.2vw, 3.75rem); line-height: 1.08; }  /* 60px */
.text-lead { font-size: clamp(1.125rem, 1.7vw, 1.5rem); line-height: 1.3; }  /* 24px */

/* Imágenes con recorte (object-position tomado del encuadre en Figma) */
.img-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-frame { overflow: hidden; border-radius: var(--ipei-radius); }

/* Botones pill */
.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  border-radius: 50px;
  color: var(--ipei-white);
  text-transform: uppercase;
  text-decoration: none;
  line-height: 18px;
  transition: transform .3s var(--ipei-ease), box-shadow .3s var(--ipei-ease), background-color .3s;
}

.btn-pill img { transition: transform .4s var(--ipei-ease); }

.btn-pill:hover,
.btn-pill:focus-visible {
  color: var(--ipei-white);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, .25);
}

.btn-pill:hover img { transform: rotate(-12deg) scale(1.1); }

.btn-pill-sm {
  background: var(--ipei-pink);
  padding: 8px 29px 8px 23px;
  font-size: 20px;
  font-weight: 700;
}

.btn-pill-sm:hover { background: #bf1b53; }

.btn-pill-lg {
  background: var(--ipei-green);
  padding: 8px 40px;
  font-size: clamp(1.25rem, 2.1vw, 1.875rem);
  font-weight: 800;
  box-shadow: var(--ipei-shadow);
}

.btn-pill-lg:hover { background: #22c13e; }

/* Header + hero */
.hero {
  position: relative;
  min-height: 622px;
  color: var(--ipei-white);
  overflow: hidden;
  background: #3b4148;
}

.hero-bg {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.hero-bg img { object-position: center 40%; }

.hero > *:not(.hero-bg) { position: relative; }

.hero-shadow { text-shadow: 0 4px 4px rgba(0, 0, 0, .25); }

/* Header sticky: oculto al bajar, visible al subir, siempre presente arriba de todo */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  padding: 28px 0 14px;
  transition: transform .45s var(--ipei-ease), background-color .35s, padding .35s var(--ipei-ease), box-shadow .35s;
}

.site-header.is-scrolled {
  padding: 12px 0;
  background: rgba(214, 34, 95, .96);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .15);
}

.site-header.is-hidden { transform: translateY(-100%); }

.site-header .site-logo { transition: height .35s var(--ipei-ease); }
.site-header.is-scrolled .site-logo { height: 46px; }

.site-logo { width: 213px; height: 58px; object-fit: contain; }

.site-nav {
  --bs-navbar-color: var(--ipei-white);
  --bs-navbar-hover-color: var(--ipei-white);
  --bs-navbar-active-color: var(--ipei-white);
}

.site-nav .nav-link {
  position: relative;
  font-size: 18px;
  font-weight: 500;
  padding: 0;
}

.site-nav .nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--ipei-pink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ipei-ease);
}

.site-nav .nav-link:hover::after,
.site-nav .nav-link.active::after { transform: scaleX(1); }

.site-nav .nav-link.active { font-weight: 900; }

.site-nav .navbar-nav { gap: 63px; }

.navbar-toggler { border-color: rgba(255, 255, 255, .6); padding: 10px 9px; }
/* Sin el anillo de foco de Bootstrap al hacer click; con teclado queda un contorno simple */
.navbar-toggler:focus { box-shadow: none; }
.navbar-toggler:focus-visible { outline: 2px solid var(--ipei-white); outline-offset: 2px; }

/* Burger: las tres líneas se convierten en una X al abrir el menú */
.burger { position: relative; display: block; width: 26px; height: 18px; }

.burger span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--ipei-white);
  transition: transform .35s var(--ipei-ease), opacity .2s, top .35s var(--ipei-ease);
}

.burger span:nth-child(1) { top: 0; }
.burger span:nth-child(2) { top: 8px; }
.burger span:nth-child(3) { top: 16px; }

.navbar-toggler[aria-expanded="true"] .burger span:nth-child(1) { top: 8px; transform: rotate(45deg); }
.navbar-toggler[aria-expanded="true"] .burger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.navbar-toggler[aria-expanded="true"] .burger span:nth-child(3) { top: 8px; transform: rotate(-45deg); }

.wa-float {
  display: block;
  filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, .25));
  transition: transform .3s var(--ipei-ease);
}

.wa-float:hover { transform: scale(1.12); }

.hero-content { padding-top: 100px; }

.hero-title {
  font-size: clamp(2.75rem, 4.9vw, 4.375rem);
  font-weight: 800;
  line-height: 1;
  margin-top: 96px;
}

.hero-text {
  font-size: clamp(1.25rem, 1.8vw, 1.625rem);
  font-weight: 500;
  line-height: 30px;
}

@media (max-width: 991.98px) {
  .site-nav .navbar-nav { gap: 1rem; padding: 1rem 0; }
  .site-header:has(.navbar-collapse.show),
  .site-header:has(.navbar-collapse.collapsing) { background: rgba(214, 34, 95, .96); }
  .site-nav .navbar-collapse { margin-top: .5rem; }
  .site-nav .nav-link::after { right: auto; width: 40px; }
  .hero-title { margin-top: 48px; }
}

/* Quiénes somos */
.section-about { padding: 60px 0 100px; }

/* Lienzo original de 1065×1004 centrado en la caja de 608×498 del diseño */
.about-visual { position: relative; aspect-ratio: 608 / 498; width: 100%; }

.about-stage {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  aspect-ratio: 1065 / 1004;
  transform: translateX(-50%);
}

/* Píldora fucsia: mismas medidas que en la composición original */
.about-bg {
  position: absolute;
  left: 20.751%;
  width: 59.437%;
  top: 1.793%;
  height: 96.215%;
  border-radius: 9999px;
  background: var(--ipei-pink);
  will-change: transform;
}

.about-figure {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  will-change: transform;
}

.stat-number { font-size: clamp(3rem, 4.4vw, 4rem); font-weight: 900; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 24px; font-weight: 600; line-height: 1.3; max-width: 255px; }

@media (min-width: 768px) {
  .stats > .col + .col { border-left: 1px solid var(--ipei-black); }
}

/* Servicios */
.section-services { padding-top: 83px; }

.service-card {
  background: var(--ipei-gray);
  border-radius: var(--ipei-radius);
  padding: 23px 20px 40px 27px;
  height: 100%;
  min-height: 360px;
  transition: transform .35s var(--ipei-ease), box-shadow .35s var(--ipei-ease);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, .12);
}

.service-icon {
  height: 67px;
  display: flex;
  align-items: flex-end;
}

.service-icon img { transition: transform .4s var(--ipei-ease); transform-origin: left bottom; }
.service-card:hover .service-icon img { transform: scale(1.1); }

.service-card h3 { font-size: 30px; font-weight: 700; line-height: 32px; margin: 8px 0 7px; }
.service-card p { font-size: 20px; line-height: 24px; margin: 0; }

.fleet-img { aspect-ratio: 606 / 412; width: 100%; object-fit: cover; }

.gallery-item { aspect-ratio: 348 / 238; }
.gallery-item img { transition: transform .6s var(--ipei-ease); }
.gallery-item:hover img { transform: scale(1.06); }

.section-security {
  position: relative;
  color: var(--ipei-white);
  padding: 139px 0 120px;
  margin-top: 118px;
  overflow: hidden;
  background: #222;
}

.security-bg {
  position: absolute;
  inset: -15% 0;
  will-change: transform;
}

.section-security > .container { position: relative; }

.security-item { font-size: 20px; line-height: 24px; }

.check-icon { transition: transform .4s var(--ipei-ease); }
.security-items .col:hover .check-icon { transform: scale(1.15) rotate(-8deg); }

@media (min-width: 768px) {
  .security-items > .col + .col { border-left: 1px solid var(--ipei-white); }
}

.section-warehouse { padding: 80px 0 147px; }

.warehouse-icon { margin: 10px; }
.warehouse-img-1 { aspect-ratio: 562 / 404; }
.warehouse-img-1 img { object-position: center 61.5%; }
.warehouse-img-2 { aspect-ratio: 562 / 290; }
.warehouse-img-1 img,
.warehouse-img-2 img { transition: transform .6s var(--ipei-ease); }
.warehouse-img-1:hover img,
.warehouse-img-2:hover img { transform: scale(1.05); }

.gallery-item.flota-1 img { object-position: center 11.5%; }
.gallery-item.flota-2 img { object-position: center 66.7%; }

/* Clientes */
.section-clients { padding: 24px 0 100px; }

.clients-box {
  background: var(--ipei-gray);
  border-radius: var(--ipei-radius);
  padding: 103px 30px 125px;
}

.clients-logos { column-gap: 23px; row-gap: 50px; }

.client-logo {
  display: block;
  width: 225px;
  height: 94px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
  transition: transform .35s var(--ipei-ease), box-shadow .35s var(--ipei-ease);
}

.client-logo:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, .2);
}

/* Main por encima del footer fijo */
/* El clip evita que los elementos que entran desde el costado ensanchen la página en mobile */
.site-main {
  position: relative;
  z-index: 1;
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--ipei-white);
  box-shadow: 0 24px 40px rgba(0, 0, 0, .25);
}

/* Contacto */
.section-contact { color: var(--ipei-white); padding: 103px 0 110px; }

/* Footer fijo que se descubre por debajo del contenido */
.site-footer {
  color: var(--ipei-white);
  padding: 80px 0 50px;
  overflow: hidden;
}

.site-footer.is-fixed {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
}

.js .site-footer.is-fixed [data-footer-reveal] { opacity: 0; will-change: opacity, transform; }

/* WhatsApp flotante */
.wa-sticky {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1020;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  opacity: 0;
  transform: scale(.4) translateY(20px);
  pointer-events: none;
  transition: opacity .4s var(--ipei-ease), transform .4s var(--ipei-ease);
}

.wa-sticky img { width: 60px; height: 60px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .3)); }

.wa-sticky::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--ipei-green);
  z-index: -1;
  animation: wa-pulse 2.4s ease-out infinite;
}

.wa-sticky.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.wa-sticky.is-visible:hover { transform: scale(1.08); }

@keyframes wa-pulse {
  0% { transform: scale(1); opacity: .45; }
  70%, 100% { transform: scale(1.7); opacity: 0; }
}

@media (max-width: 575.98px) {
  .wa-sticky { right: 16px; bottom: 16px; width: 52px; height: 52px; }
  .wa-sticky img { width: 52px; height: 52px; }
}

.contact-text {
  font-size: clamp(1.5rem, 2.8vw, 2.5rem);
  font-weight: 300;
  line-height: 1.1;
}

/* Logo del footer: camión e isotipo separados para animar la llegada */
.footer-logo {
  display: inline-flex;
  width: 100%;
  max-width: 392px;
  vertical-align: middle;
}

.footer-logo img { display: block; height: auto; }
.footer-logo-truck { width: 48.68%; transform-origin: 70% 100%; }
.footer-logo-word { width: 51.32%; }

.js .footer-logo-truck { translate: -110vw 0; }
.js .footer-logo-word { opacity: 0; }

/* Llega con una única desaceleración larga y, al detenerse, la suspensión cede apenas y vuelve */
.js .footer-logo.is-driving .footer-logo-truck {
  animation:
    truck-drive 2.2s cubic-bezier(.19, 1, .22, 1) both,
    truck-settle 1.1s 1.05s cubic-bezier(.37, 0, .63, 1) both;
}

.js .footer-logo.is-driving .footer-logo-word { animation: word-in 1s 1.6s ease both; }

@keyframes truck-drive {
  from { translate: -110vw 0; }
  to { translate: 0 0; }
}

@keyframes truck-settle {
  0%, 100% { rotate: 0deg; }
  45% { rotate: .8deg; }
}

@keyframes word-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.footer-contact a { color: var(--ipei-white); text-decoration: none; transition: opacity .25s; }
.footer-contact a:hover { opacity: .75; }

.footer-contact .ig-link { transition: transform .3s var(--ipei-ease); }
.footer-contact .ig-link:hover { transform: scale(1.15); opacity: 1; }

.footer-nav { gap: 14px; }

.footer-nav a {
  color: var(--ipei-white);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  background: linear-gradient(currentColor, currentColor) no-repeat 50% 100% / 0 1px;
  transition: background-size .3s var(--ipei-ease);
}

.footer-nav a:hover { background-size: 100% 1px; }

.copyright { font-size: 10px; }

/* Carruseles con scroll-snap (solo mobile; en desktop la fila vuelve a ser grilla) */
@media (max-width: 767.98px) {
  .snap-carousel {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 1rem;
  }

  .snap-carousel::-webkit-scrollbar { display: none; }

  .snap-carousel > * {
    flex: 0 0 82%;
    max-width: 82%;
    scroll-snap-align: center;
  }

  /* .flex-wrap de Bootstrap usa !important y anulaba el nowrap del carrusel */
  .clients-logos.snap-carousel { flex-wrap: nowrap !important; justify-content: flex-start !important; padding: 0 1rem 1rem; }
  .clients-logos.snap-carousel > * { flex: 0 0 225px; max-width: none; }
  .clients-box { padding: 60px 0 70px; }
  .clients-box h2 { padding: 0 20px; }

  .service-card { text-align: center; }
  .service-icon { justify-content: center; }
  .service-icon img { transform-origin: center bottom; }
  .service-card:hover { transform: none; }

  .fleet-img { aspect-ratio: auto; height: auto; }
}

.carousel-dots { display: flex; justify-content: center; gap: 8px; margin-top: .5rem; }

.carousel-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .2);
  transition: width .3s var(--ipei-ease), background-color .3s;
}

.carousel-dots button.active { width: 24px; border-radius: 4px; background: var(--ipei-pink); }

@media (min-width: 768px) {
  .carousel-dots { display: none; }
}

/* Aparición al entrar en viewport */
.js [data-reveal] {
  opacity: 0;
  transition: opacity .8s var(--ipei-ease), transform .8s var(--ipei-ease);
  transition-delay: var(--reveal-delay, 0s);
}

.js [data-reveal="up"] { transform: translateY(40px); }
.js [data-reveal="left"] { transform: translateX(-50px); }
.js [data-reveal="right"] { transform: translateX(50px); }
.js [data-reveal="zoom"] { transform: scale(.92); }

.js [data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal],
  .js .site-footer.is-fixed [data-footer-reveal] { opacity: 1 !important; transform: none !important; transition: none; }
  .wa-sticky::before { animation: none; }
  .js .footer-logo-truck, .js .footer-logo-word { translate: none; opacity: 1; animation: none !important; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
