/* ==========================================================================
   ESTILOS · Carbones Lada SAS  (mobile-first: lo base es para celular,
   los @media del final amplían para pantallas más grandes)
   Índice:  1 Tokens · 2 Base · 3 Layout · 4 Componentes · 5 Responsive
   ========================================================================== */

/* ---------- 1. TOKENS (colores, tipografías y medidas reutilizables) ---------- */
:root {
  /* Paleta: base blanca + verde del logo.
     --accent = detalles (íconos, cifras) · --accent-dark = texto y botones (mejor contraste sobre blanco) */
  color-scheme: light;
  --bg: #FFFFFF;
  --surface: #F3F8F2;          /* verde muy suave para tarjetas */
  --ink: #142019;
  --muted: #56635A;
  --accent: #4C9A4A;
  --accent-dark: #2E6B36;
  --on-accent: #FFFFFF;
  --line: #E0E8DF;
  --header-bg: rgba(255, 255, 255, .92);

  --font-body: 'Inter', system-ui, sans-serif;
  --font-display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;

  --gutter: clamp(22px, 6vw, 44px);   /* margen lateral */
  --space: clamp(48px, 11vw, 80px);   /* espacio vertical entre secciones */
  --header-h: 68px;                   /* alto del header (para los anclajes) */
  --max-w: 1080px;

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- 2. BASE (reset y estilos globales) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(env(safe-area-inset-top, 0px) + var(--header-h));
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 var(--font-body);
  overflow-x: hidden;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }

/* Estilo de títulos grandes (se aplica con class="display") */
.display {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: .01em;
  line-height: .95;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- 3. LAYOUT ---------- */
/* Contenedor: el margen lateral va en padding-inline y el vertical en
   padding-block (.section), así nunca se pisan entre sí. */
.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)) max(var(--gutter), env(safe-area-inset-right, 0px));
}
.section { padding-block: var(--space); border-top: 1px solid var(--line); }

/* Encabezado de sección (etiqueta + título + texto) */
.kicker { margin-bottom: 12px; color: var(--accent-dark); font-size: 13px; font-weight: 600; }
.section-title { margin-bottom: 20px; font-size: clamp(34px, 9.5vw, 52px); }
.lead { max-width: 680px; color: var(--muted); font-size: 16px; }

/* ---------- 4. COMPONENTES ---------- */

/* 4.1 Logo (imagen definida una sola vez en --logo-img, al final de este archivo) */
.logo {
  display: block;
  aspect-ratio: 900 / 603;
  background: var(--logo-img) center / contain no-repeat;
}
.logo--header { width: 45px; }
.logo--hero { width: 84px; margin-bottom: 24px; opacity: .95; }

/* 4.1b Marca en el header: logo + nombre (CARBONES en negro, LADA en verde) */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: .02em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
}
.brand__name span { color: var(--accent); }

/* 4.2 Header y navegación */
.site-header {
  position: sticky;
  top: 0;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s;
}
.site-header.is-scrolled { box-shadow: 0 6px 18px rgba(20, 32, 25, .08); }  /* lo activa el JS */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-block: 12px;
  padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)) max(var(--gutter), env(safe-area-inset-right, 0px));
}
/* Menú: en celular es un desplegable (botón .nav__toggle abre/cierra con .is-open) */
.nav__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
}
.nav__bars,
.nav__bars::before,
.nav__bars::after {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .2s, background .2s;
}
.nav__bars { position: relative; }
.nav__bars::before, .nav__bars::after { content: ""; position: absolute; left: 0; }
.nav__bars::before { top: -7px; }
.nav__bars::after { top: 7px; }
.nav__toggle[aria-expanded="true"] .nav__bars { background: transparent; }
.nav__toggle[aria-expanded="true"] .nav__bars::before { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__bars::after { transform: translateY(-7px) rotate(-45deg); }

.nav__menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 4px var(--gutter) 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 24px rgba(20, 32, 25, .08);
}
.nav__menu.is-open { display: block; }
.nav__list { display: flex; flex-direction: column; font-size: 16px; }
.nav__link {
  display: flex;
  align-items: center;
  min-height: 52px;            /* zona táctil cómoda */
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}
.nav__link:hover,
.nav__link[aria-current="true"] { color: var(--ink); }  /* aria-current lo pone el JS */

/* 4.3 Botones */
.btn-row { display: flex; flex-direction: column; gap: 12px; }
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 2px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
.btn--primary { background: var(--accent-dark); color: var(--on-accent); }
.btn--ghost { border: 1px solid var(--accent-dark); color: var(--accent-dark); }

/* 4.4 Portada (hero) */
.section--hero { padding-block: calc(var(--space) * .9) var(--space); border-top: none; }
.hero__title { max-width: 820px; margin-bottom: 20px; font-size: clamp(46px, 13vw, 104px); }
.hero__text { max-width: 480px; margin-bottom: 28px; color: var(--muted); }

/* 4.4b Fotografías (las imágenes viven en --img-* al final de este archivo) */
.photo {
  background-color: var(--surface);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.photo--hero {
  margin-top: 36px;
  aspect-ratio: 4 / 3;
  background-image: var(--img-hero);
  background-position: center 60%;     /* mantiene el camión completo al recortar */
  border: 1px solid var(--line);
}
.product__photo { aspect-ratio: 3 / 2; }
.product__photo--todo-mina { background-image: var(--img-todo-mina); }
.product__photo--granulado { background-image: var(--img-granulado); }

/* 4.5 Productos */
.products {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  margin-top: 32px;
  background: var(--line);          /* las separaciones son el fondo visible entre tarjetas */
  border: 1px solid var(--line);
}
.product { background: var(--surface); }
.product__body { padding: 24px 22px 28px; }
.product__title { margin-bottom: 10px; color: var(--accent-dark); font-size: 26px; }
.product__text { color: var(--muted); font-size: 15px; }

/* 4.5c Industrias, cifras y fuentes (sección "Importancia del carbón") */
.subtitle { margin-top: 40px; font-size: 20px; font-weight: 600; line-height: 1.3; }
.industries { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 20px; }
.industry { padding: 22px; border: 1px solid var(--line); }
.industry .icon { display: block; margin-bottom: 14px; }
.industry__title { margin: 0 0 6px; font-size: 17px; font-weight: 600; line-height: 1.35; }
.industry__text { color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.stats { display: grid; grid-template-columns: 1fr; gap: 1px; margin-top: 20px; background: var(--line); border: 1px solid var(--line); }
.stat { padding: 22px; background: var(--surface); }
.stat__figure { color: var(--accent); font-size: 48px; }
.stat__text { margin-top: 6px; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.impact__text { margin-top: 24px; }
.cite { color: var(--accent-dark); font-size: .7em; font-weight: 600; text-decoration: none; vertical-align: super; }
.sources { margin: 12px 0 0; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.sources li { margin-bottom: 6px; padding-left: 4px; }
.sources a { color: var(--accent-dark); }
.sources__note { margin-top: 10px; color: var(--muted); font-size: 12.5px; }

/* 4.5b Experiencia (cifra destacada + texto) */
.experience { display: flex; flex-direction: column; gap: 10px; padding: 24px 22px; border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--surface); }
.experience__figure { color: var(--accent); font-size: 56px; }
.experience__text { color: var(--muted); font-size: 15px; }
.experience__text strong { color: var(--ink); font-weight: 600; }

/* 4.6 Valores (íconos tomados del sprite SVG del <body>) */
.values { margin-top: 32px; border-top: 1px solid var(--line); }
.value { display: flex; align-items: flex-start; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.icon {
  flex: none;
  width: 26px;
  height: 26px;
  padding: 9px;
  box-sizing: content-box;
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent-dark);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}
.value__title { margin-bottom: 4px; font-size: 16px; font-weight: 600; line-height: 1.35; }
.value__text { max-width: 560px; color: var(--muted); font-size: 14.5px; line-height: 1.6; }

/* 4.7 Misión (dentro de "Nosotros") */
.mission { max-width: 680px; margin-top: 32px; padding-left: 18px; border-left: 3px solid var(--accent); }
.mission__title { margin-bottom: 8px; color: var(--accent-dark); font-size: 20px; font-weight: 600; line-height: 1.3; }
.mission__text { color: var(--muted); font-size: 15px; }

/* 4.8 Contacto */
.contact { display: flex; flex-direction: column; gap: 28px; }
.contact__title { font-size: clamp(40px, 12vw, 60px); }
.contact__list { color: var(--muted); font-size: 15px; }
.contact__list li { padding: 8px 0; overflow-wrap: anywhere; }  /* evita que el correo se salga */
.contact__list a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* 4.9 Pie de página */
.footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-block: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

/* 4.10 Animaciones y efectos (se desactivan si el usuario pidió "reducir movimiento") */
@media (prefers-reduced-motion: no-preference) {
  /* Entrada de la portada: cada elemento sube y aparece en cascada */
  @keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
  .section--hero > * { animation: rise .8s ease both; }
  .section--hero > :nth-child(2) { animation-delay: .1s; }
  .section--hero > :nth-child(3) { animation-delay: .2s; }
  .section--hero > :nth-child(4) { animation-delay: .3s; }
  .section--hero > :nth-child(5) { animation-delay: .4s; }
  .section--hero > :nth-child(6) { animation-delay: .5s; }

  /* Aparición al hacer scroll (el JS agrega data-reveal y luego is-visible) */
  [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s ease var(--delay, 0ms), transform .7s ease var(--delay, 0ms),
                border-color .25s ease, box-shadow .25s ease;
  }
  [data-reveal].is-visible { opacity: 1; transform: none; }

  /* Microinteracciones */
  .btn { transition: transform .2s, box-shadow .2s; }
  .btn:active { transform: scale(.98); }
  .product { overflow: hidden; }
  .product__photo { transition: transform .6s ease; }

  /* Efectos al pasar el mouse (solo en dispositivos con mouse) */
  @media (hover: hover) {
    .btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(46, 107, 54, .25); }
    .product:hover .product__photo { transform: scale(1.05); }
    .industry:hover { border-color: var(--accent); box-shadow: 0 8px 24px rgba(20, 32, 25, .08); }
  }
}

/* ---------- 5. RESPONSIVE (de menor a mayor) ---------- */
@media (min-width: 480px) {
  .btn-row { flex-direction: row; flex-wrap: wrap; gap: 14px; }
  .btn { display: inline-flex; }
}

@media (min-width: 720px) {
  body { font-size: 16.5px; }
  .logo--header { width: 51px; }
  .brand__name { font-size: 24px; }
  .logo--hero { width: 110px; margin-bottom: 28px; }
  .nav__toggle { display: none; }
  .nav__menu { display: block; position: static; padding: 0; border: 0; background: none; box-shadow: none; }
  .nav__list { flex-direction: row; gap: 22px; font-size: 14px; }
  .nav__link { min-height: 44px; border-bottom: 0; }
  .lead, .hero__text { font-size: 17px; }
  .products { grid-template-columns: 1fr 1fr; margin-top: 40px; }
  .product__body { padding: 28px 30px 32px; }
  .photo--hero { aspect-ratio: 16 / 9; margin-top: 44px; }
  .experience { flex-direction: row; align-items: center; gap: 32px; padding: 30px; }
  .experience__figure { flex: none; font-size: 72px; }
  .subtitle { font-size: 22px; }
  .industries { grid-template-columns: 1fr 1fr; gap: 16px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat__figure { font-size: 52px; }
  .values { margin-top: 40px; }
  .value { gap: 22px; padding: 22px 0; }
  .contact { flex-direction: row; justify-content: space-between; align-items: flex-end; gap: 40px; }
  .footer { flex-direction: row; justify-content: space-between; }
}

/* ---------- 6. IMÁGENES (rutas relativas a este archivo) ---------- */
:root {
  --logo-img: url("../images/logo.png");
  --img-hero: url("../images/hero.jpg");
  --img-todo-mina: url("../images/todo-mina.jpg");
  --img-granulado: url("../images/granulado.jpg");
}
