/* ALFA Transporte */
:root {
  --red: #a0000e;
  --red-dark: #7d000b;
  --ink: #16181a;
  --steel: #596065;
  --line: #cfd3d6;
  --paper: #f3f4f5;
  --white: #fff;
  --header-h: 84px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --space: clamp(4.5rem, 9vw, 8.5rem);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 68px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 1.0625rem/1.65 'Archivo', system-ui, sans-serif;
  color: var(--ink);
  background: var(--white);
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; border: 0; padding: 0; background: none; cursor: pointer; }
h1, h2, h3 { font-stretch: 115%; font-weight: 800; line-height: 1.08; letter-spacing: -.015em; text-wrap: balance; }
:focus-visible { outline: 3px solid #ff8a92; outline-offset: 3px; }

.container { width: min(100%, 1320px); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; z-index: 100; top: -5rem; left: 1rem; padding: .75rem 1.25rem; background: var(--white); color: var(--ink); }
.skip-link:focus { top: 1rem; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .65rem;
  min-height: 54px; padding: 0 2rem; border-radius: 4px;
  font-weight: 700; text-decoration: none;
  transition: background-color .2s, color .2s;
}
.btn--white { background: var(--white); color: var(--ink); }
.btn--white:hover { background: var(--red); color: var(--white); }
.btn--red { background: var(--red); color: var(--white); }
.btn--red:hover { background: var(--red-dark); }
.btn__loader { display: none; }
.btn[disabled] { cursor: progress; opacity: .8; }
.btn[disabled] .btn__loader { display: block; }
.icon-btn {
  position: relative; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 4px;
  border: 1px solid rgb(255 255 255 / .45); transition: background-color .2s, opacity .2s;
}
.icon-btn:hover { background: rgb(255 255 255 / .16); }
.icon-btn[disabled] { opacity: .35; cursor: default; }

/* Encabezado */
.header { position: fixed; z-index: 20; inset: 0 0 auto; color: var(--white); transition: background-color .25s, color .25s; }
.header__inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); transition: height .25s; }
.header.is-solid { --header-h: 68px; background: var(--white); color: var(--ink); box-shadow: 0 1px 0 var(--line); }
.brand { font-weight: 800; text-decoration: none; }
.brand img { height: 48px; width: auto; }
.brand__color, .header.is-solid .brand__white { display: none; }
.header.is-solid .brand__color { display: block; }
.nav ul { display: flex; gap: clamp(1.5rem, 3vw, 2.75rem); }
.nav a {
  display: block; padding: .6rem 0; font-size: 1rem; font-weight: 600; text-decoration: none;
  background: linear-gradient(currentColor 0 0) 0 88% / 0 2px no-repeat;
  transition: background-size .25s var(--ease);
}
.nav a:hover, .nav a[aria-current] { background-size: 100% 2px; }
.header.is-solid .nav a[aria-current] { color: var(--red); }
.nav-toggle { position: relative; display: none; width: 48px; height: 48px; place-content: center; gap: 8px; }
.nav-toggle__bar { display: block; width: 26px; height: 2px; background: currentColor; transition: transform .25s var(--ease); }

/* Portada */
.hero {
  position: relative; display: flex; align-items: flex-end; overflow: hidden;
  min-height: 100vh; min-height: 100svh; background: var(--ink); color: var(--white);
}
.hero__img, .about__img, .contact__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__img { object-position: 62% 45%; }
.hero::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(rgb(12 14 16 / .6), rgb(12 14 16 / 0) 30%),
    linear-gradient(to top, rgb(12 14 16 / .92), rgb(12 14 16 / .5) 45%, rgb(12 14 16 / .05) 85%);
}
.hero__content { position: relative; z-index: 1; padding-block: 9rem clamp(3rem, 8vh, 6rem); }
.hero h1 { font-size: clamp(2.5rem, 6.6vw, 6rem); letter-spacing: -.025em; }
.hero h1 span {
  display: inline-block; padding: .04em .42em .06em .38em; background: var(--red);
  clip-path: polygon(.22em 0, 100% 0, calc(100% - .22em) 100%, 0 100%);
}
.hero__company { margin: 1.5rem 0 2.25rem; font-size: clamp(1.05rem, 2vw, 1.6rem); font-weight: 500; line-height: 1.35; text-wrap: balance; }

/* Visión y misión */
.about { position: relative; overflow: hidden; padding-block: var(--space); background: var(--ink); color: var(--white); }
.about__img { opacity: .28; }
.about__grid { position: relative; display: grid; grid-template-columns: 1fr 1fr; }
.principle { padding-inline: clamp(1.5rem, 5vw, 5rem); }
.principle:first-child { padding-left: 0; }
.principle + .principle { border-left: 1px solid rgb(255 255 255 / .3); padding-right: 0; }
.principle h2 { margin: 1.75rem 0 1.25rem; font-size: clamp(2rem, 3.6vw, 3.25rem); }
.principle p { max-width: 34em; font-size: 1.125rem; }

/* Política de calidad */
.quality { padding-top: var(--space); background: var(--red); color: var(--white); }
.quality__grid { display: grid; grid-template-columns: 5fr 7fr; gap: 2rem clamp(2rem, 6vw, 6rem); }
.quality h2 { font-size: clamp(2rem, 3.8vw, 3.5rem); }
.quality__text p { max-width: 40em; margin-bottom: 1.5rem; font-size: 1.125rem; }
.segments { margin-top: 2.5rem; }
.segments li {
  padding: 1rem 0; border-top: 1px solid rgb(255 255 255 / .4);
  font-size: clamp(1.35rem, 2.3vw, 2rem); font-weight: 700; font-stretch: 110%; line-height: 1.2;
}
.segments li:last-child { border-bottom: 1px solid rgb(255 255 255 / .4); }

/* Carrusel */
.carousel { padding-block: clamp(3rem, 6vw, 5rem); }
.carousel__track {
  --edge: max(var(--gutter), calc((100% - 1320px) / 2 + var(--gutter)));
  position: relative; display: flex; gap: 1rem;
  padding-inline: var(--edge); scroll-padding-inline: var(--edge);
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track li { flex: 0 0 min(760px, 80vw); scroll-snap-align: start; }
.slide { display: block; width: 100%; overflow: hidden; border-radius: 4px; background: var(--red-dark); cursor: zoom-in; }
.slide img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .6s var(--ease); }
.slide:hover img { transform: scale(1.03); }
.slide:focus-visible { outline-offset: -4px; outline-color: var(--white); }
.carousel__controls { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; margin-top: 1.5rem; }
.carousel__count { margin-right: auto; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Contacto */
.contact { display: grid; grid-template-columns: 5fr 7fr; }
.contact__intro { position: relative; display: flex; align-items: flex-end; min-height: 440px; background: var(--ink); color: var(--white); }
.contact__intro::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgb(12 14 16 / .9), rgb(12 14 16 / .25)); }
.contact__img { object-position: 62% 50%; }
.contact__copy { position: relative; z-index: 1; padding: clamp(2rem, 5vw, 5rem) var(--gutter); max-width: 36em; }
.contact__copy h2 { margin-bottom: 1.25rem; font-size: clamp(2.25rem, 4vw, 3.75rem); }
.contact__copy p + p { margin-top: .9rem; }
.contact__panel { padding: clamp(3.5rem, 7vw, 6.5rem) clamp(1.25rem, 6vw, 6.5rem); background: var(--paper); }
.form { position: relative; max-width: 720px; }
.form h3 { margin-bottom: 2rem; font-size: clamp(1.5rem, 2.2vw, 2rem); }
.form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem 1.25rem; margin-bottom: 1.75rem; }
.field--wide { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: .4rem; font-size: 1rem; font-weight: 600; }
.field input, .field textarea {
  width: 100%; min-height: 54px; padding: .8rem 1rem; border: 1px solid #868c91; border-radius: 4px;
  background: var(--white); color: var(--ink); font: inherit;
}
.field textarea { display: block; resize: vertical; }
.field :is(input, textarea):focus { outline: 2px solid var(--red); outline-offset: 0; border-color: var(--red); }
.field :is(input, textarea):user-invalid { border-color: var(--red); }
.trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.form__message:not(:empty) { margin-top: 1.5rem; padding: 1.1rem 1.25rem; border-radius: 4px; background: #fbe3e5; color: var(--red-dark); overflow-wrap: anywhere; }
.form__message.is-ok:not(:empty) { background: #dff1e5; color: #0d4a25; }
.form__message strong { display: block; font-size: 1.15rem; }

/* Pie */
.footer { padding-block: 3.5rem; background: var(--ink); color: #d7dadc; }
.footer__grid { display: grid; grid-template-columns: 1fr 2fr 1fr; align-items: center; gap: 2rem; font-size: 1rem; }
.footer__logo { justify-self: start; color: var(--white); font-weight: 800; }
.footer p { text-align: center; }
.footer p a { color: var(--white); text-underline-offset: 3px; }
.social { justify-self: end; }
.social h2 { margin-bottom: .75rem; color: var(--white); font-size: 1rem; letter-spacing: 0; }
.social ul { display: flex; gap: .6rem; }
.social a { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--steel); border-radius: 4px; transition: background-color .2s; }
.social a[href]:hover { background: var(--red); border-color: var(--red); }

/* Visor */
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; color: var(--white);
  background: rgb(10 11 12 / .95) url('https://api.iconify.design/svg-spinners/ring-resize.svg?color=white') center / 44px no-repeat;
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox__img { width: auto; max-width: min(92vw, 1500px); max-height: 84vh; }
.lightbox .icon-btn { position: absolute; background: rgb(10 11 12 / .75); }
.lightbox .icon-btn:hover { background: var(--red); }
.lightbox__close { top: 1rem; right: 1rem; }
.lightbox__prev { left: 1rem; top: calc(50% - 26px); }
.lightbox__next { right: 1rem; top: calc(50% - 26px); }

/* Aparición al desplazar (sólo con JS) */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .hero__img { object-position: 30% 45%; }
  .nav-toggle { display: grid; }
  .nav { position: absolute; inset: 100% 0 auto; display: none; background: var(--white); color: var(--ink); border-bottom: 1px solid var(--line); }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; gap: 0; padding: .5rem var(--gutter) 1.25rem; }
  .nav li + li { border-top: 1px solid var(--line); }
  .nav a { padding: 1rem 0; background: none; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-of-type(2) { transform: translateY(5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-of-type(3) { transform: translateY(-5px) rotate(-45deg); }
  .about__grid, .quality__grid, .contact, .footer__grid { grid-template-columns: 1fr; }
  .principle, .principle + .principle { padding-inline: 0; }
  .principle + .principle { margin-top: 3rem; padding-top: 3rem; border-left: 0; border-top: 1px solid rgb(255 255 255 / .3); }
  .footer p { text-align: left; }
  .social { justify-self: start; }
}
@media (max-width: 560px) {
  .form__grid { grid-template-columns: 1fr; }
  .form .btn { width: 100%; }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
@media print { .js .reveal { opacity: 1; transform: none; } }
