/* =========================================================
   Alamar Cargo — Design tokens
   Palette: Logistics/Delivery (trust blue + cargo orange)
   Type: Lexend (display) + Source Sans 3 (body)
   ========================================================= */
:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1e40af;
  --color-secondary: #3b82f6;
  --color-accent: #ea580c;
  --color-accent-dark: #c2410c;

  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;
  --color-bg-blue: #eff6ff;
  --color-foreground: #0f172a;
  --color-muted: #64748b;
  --color-border: #e2e8f0;
  --color-border-blue: #bfdbfe;

  --font-display: "Lexend", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 5rem;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 24px 64px rgba(15, 23, 42, 0.16);

  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-emphasized: cubic-bezier(0.05, 0.7, 0.1, 1);
  --duration-fast: 150ms;
  --duration-standard: 250ms;
  --duration-slow: 400ms;

  --header-h: 88px;
}

/* =========================================================
   Reset
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body, h1, h2, h3, h4, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font: inherit; }

body {
  font-family: var(--font-body);
  color: var(--color-foreground);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; font-weight: 700; }
h2 { font-size: clamp(1.8rem, 1.4rem + 2vw, 2.75rem); letter-spacing: -0.02em; }
h3 { font-size: 1.15rem; font-weight: 600; }

.container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 999;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.icon { width: 22px; height: 22px; fill: currentColor; flex-shrink: 0; }
.icon--accent { width: 30px; height: 30px; fill: var(--color-accent); color: var(--color-accent); }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.8rem 1.6rem;
  transition: transform var(--duration-standard) var(--ease-standard),
              box-shadow var(--duration-standard) var(--ease-standard),
              background-color var(--duration-standard) var(--ease-standard);
  white-space: nowrap;
}
.btn--primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--color-accent-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn--ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(6px);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.22); transform: translateY(-2px); }
.btn--sm { padding: 0.55rem 1.2rem; font-size: 0.9rem; }
.btn--lg { padding: 1rem 2rem; font-size: 1.02rem; }
.btn--block { width: 100%; }
.btn:active { transform: translateY(0) scale(0.97); }

/* =========================================================
   Topbar + Header
   ========================================================= */
.topbar {
  background: var(--color-foreground);
  color: #cbd5e1;
  font-size: 0.85rem;
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-block: 0.5rem;
}
.topbar__contact { display: flex; gap: var(--space-3); }
.topbar__link { display: inline-flex; align-items: center; gap: 0.4rem; transition: color var(--duration-fast) var(--ease-standard); }
.topbar__link .icon { width: 15px; height: 15px; }
.topbar__link:hover { color: #fff; }
.topbar__note { opacity: 0.85; }

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-h);
  display: flex;
  align-items: center;
}
.header__inner { display: flex; align-items: center; gap: var(--space-4); }

.brand { display: inline-flex; align-items: center; gap: 0.6rem; margin-right: auto; }
.brand__mark { width: 40px; height: 40px; }
.brand__text { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--color-foreground); }
.brand__text em { font-style: normal; color: var(--color-primary); }

.nav { display: flex; align-items: center; gap: var(--space-3); }
.nav a {
  font-weight: 500;
  color: var(--color-muted);
  position: relative;
  padding-block: 0.4rem;
  transition: color var(--duration-fast) var(--ease-standard);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--color-accent);
  transition: right var(--duration-standard) var(--ease-standard);
}
.nav a:hover { color: var(--color-foreground); }
.nav a:hover::after { right: 0; }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
}
.nav__toggle span { width: 24px; height: 2px; background: var(--color-foreground); border-radius: 2px; transition: transform var(--duration-standard) var(--ease-standard), opacity var(--duration-standard) var(--ease-standard); }
.nav__toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.is-active span:nth-child(2) { opacity: 0; }
.nav__toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  padding-top: calc(var(--space-6) + 2rem);
  padding-bottom: 0;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
.hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: -2;
  transform: scale(1.05);
  will-change: transform;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.72) 45%, rgba(15, 23, 42, 0.92) 100%);
}
.hero__inner { max-width: 780px; padding-bottom: var(--space-6); }

.eyebrow {
  display: inline-block;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
}
.eyebrow--light { color: #fdba74; }

.hero__title { font-size: clamp(2.2rem, 1.7rem + 2.8vw, 3.6rem); margin-bottom: var(--space-2); }
.hero__subtitle { font-size: 1.1rem; color: #e2e8f0; max-width: 640px; margin-bottom: var(--space-4); }
.hero__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

.stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  background: var(--color-bg);
  color: var(--color-foreground);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-4) var(--space-3);
  box-shadow: var(--shadow-lg);
}
.stat { text-align: center; }
.stat__number, .stat__suffix {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.4rem);
  font-weight: 700;
  color: var(--color-primary);
}
.stat__label { color: var(--color-muted); font-size: 0.92rem; margin-top: 0.2rem; }

/* =========================================================
   Sections
   ========================================================= */
.section { padding-block: var(--space-6); }
.section--alt { background: var(--color-bg-alt); }
.section__head { max-width: 680px; margin-inline: auto; text-align: center; margin-bottom: var(--space-5); }
.section__lead { color: var(--color-muted); font-size: 1.05rem; margin-top: var(--space-1); }

.grid { display: grid; gap: var(--space-3); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* About */
.about { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: var(--space-5); align-items: center; }
.about__media { position: relative; }
.about__media img { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); aspect-ratio: 4/3; object-fit: cover; }
.about__badge {
  position: absolute;
  bottom: -1.5rem;
  right: -1rem;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 240px;
}
.about__badge .icon { color: var(--color-primary); fill: var(--color-primary); }
.about__badge strong { display: block; font-family: var(--font-display); font-size: 0.95rem; }
.about__badge span { color: var(--color-muted); font-size: 0.82rem; }

.about__content h2 { margin-bottom: var(--space-2); }
.about__content > p { color: var(--color-muted); margin-bottom: var(--space-4); }

.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.feature { display: flex; gap: 0.9rem; align-items: flex-start; }
.feature h3 { margin-bottom: 0.2rem; }
.feature p { color: var(--color-muted); font-size: 0.92rem; }

/* Cards / Services */
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transition: transform var(--duration-standard) var(--ease-standard),
              box-shadow var(--duration-standard) var(--ease-standard),
              border-color var(--duration-standard) var(--ease-standard);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--color-border-blue); }
.card__icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--color-bg-blue);
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}
.card__icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { margin-bottom: 0.4rem; }
.card p { color: var(--color-muted); font-size: 0.94rem; }

/* Products */
.product-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-standard) var(--ease-standard), box-shadow var(--duration-standard) var(--ease-standard);
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.product-card img { aspect-ratio: 4/3; object-fit: cover; transition: transform var(--duration-slow) var(--ease-standard); }
.product-card:hover img { transform: scale(1.06); }
.product-card__body { padding: var(--space-3); }
.product-card__body h3 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.product-card__body p { color: var(--color-muted); font-size: 0.9rem; }

/* Coverage */
.coverage { position: relative; padding-block: var(--space-6); color: #fff; isolation: isolate; }
.coverage__bg { position: absolute; inset: 0; background-size: cover; background-position: center; z-index: -2; will-change: transform; }
.coverage__overlay { position: absolute; inset: 0; z-index: -1; background: linear-gradient(120deg, rgba(15,23,42,0.88) 20%, rgba(30,64,175,0.55) 100%); }
.coverage__inner { max-width: 720px; }
.coverage__title { margin-bottom: var(--space-2); }
.coverage__lead { color: #e2e8f0; margin-bottom: var(--space-4); }
.coverage__list { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.coverage__list li {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  backdrop-filter: blur(4px);
  transition: background var(--duration-standard) var(--ease-standard), transform var(--duration-standard) var(--ease-standard);
}
.coverage__list li:hover { background: var(--color-accent); transform: translateY(-2px); }

/* Trust bar */
.trust { padding-block: var(--space-5); border-bottom: 1px solid var(--color-border); }
.trust__item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.6rem; }
.trust__item p { font-weight: 600; font-size: 0.95rem; }

/* Contact */
.contact { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: var(--space-5); }
.contact__info { display: flex; flex-direction: column; gap: var(--space-3); }
.contact__item { display: flex; gap: 0.9rem; align-items: flex-start; background: var(--color-bg); border: 1px solid var(--color-border); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); }
.contact__item strong { display: block; font-family: var(--font-display); font-size: 0.95rem; margin-bottom: 0.15rem; }
.contact__item a:hover { color: var(--color-primary); }
.contact__item span { color: var(--color-muted); }

.contact__form { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-4); box-shadow: var(--shadow-sm); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.field { margin-bottom: var(--space-2); }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; }
.field input, .field textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-alt);
  transition: border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}
.form-note { margin-top: var(--space-2); font-size: 0.9rem; min-height: 1.2em; color: var(--color-primary); }

/* Footer */
.footer { background: var(--color-foreground); color: #cbd5e1; padding-top: var(--space-6); }
.footer__inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--space-4); padding-bottom: var(--space-5); }
.footer__brand p { margin-top: var(--space-2); font-size: 0.92rem; color: #94a3b8; max-width: 320px; }
.brand--footer .brand__text { color: #fff; }
.footer__col { display: flex; flex-direction: column; gap: 0.7rem; }
.footer__col h4 { color: #fff; font-family: var(--font-display); margin-bottom: 0.3rem; font-size: 1rem; }
.footer__col a, .footer__col span { color: #94a3b8; font-size: 0.92rem; transition: color var(--duration-fast) var(--ease-standard); }
.footer__col a:hover { color: #fff; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-block: var(--space-2); text-align: center; font-size: 0.85rem; color: #64748b; }

/* Floating buttons */
.whatsapp-btn {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  width: 56px; height: 56px;
  background: #25d366;
  border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: var(--shadow-lg);
  z-index: 90;
  will-change: transform;
}
.whatsapp-btn svg { width: 30px; height: 30px; fill: #fff; }

.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 48px; height: 48px;
  background: var(--color-foreground);
  color: #fff;
  border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: var(--shadow-md);
  z-index: 90;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity var(--duration-standard) var(--ease-standard), transform var(--duration-standard) var(--ease-standard);
}
.back-to-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top svg { width: 22px; height: 22px; fill: currentColor; }

/* =========================================================
   Scroll reveal & motion — owned entirely by GSAP + ScrollTrigger
   (see js/main.js). Deliberately no base hidden state here: if the
   GSAP CDN ever fails to load, .reveal content must stay visible
   instead of being permanently hidden by CSS. The WhatsApp button's
   ambient pulse is likewise driven by GSAP (transform-only, so it
   stays on the compositor instead of animating box-shadow).
   ========================================================= */

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .nav { display: none; }
  .nav__toggle { display: flex; }
  .nav__cta { display: none; }

  .nav.is-open {
    display: flex;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: #fff;
    flex-direction: column;
    padding: var(--space-3);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    gap: var(--space-1);
  }

  .about, .contact { grid-template-columns: 1fr; }
  .about__media { order: -1; }
  .about__badge { position: static; margin-top: -2rem; margin-inline: 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .grid--3 { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .topbar__note { display: none; }
}

@media (max-width: 640px) {
  .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero { padding-top: calc(var(--header-h) + 2rem); }
  .footer__inner { grid-template-columns: 1fr; }
  .whatsapp-btn { width: 48px; height: 48px; bottom: 1rem; left: 1rem; }
  .back-to-top { width: 42px; height: 42px; bottom: 1rem; right: 1rem; }
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* GSAP's own animations (hero timeline, parallax, scroll reveal, WhatsApp
     pulse) are disabled in js/main.js via gsap.matchMedia() — this query
     only needs to cover the plain CSS transitions below (buttons, cards,
     nav toggle, hover states). */
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
