/* ==========================================================
   Avant — Distribuidora de productos para la construcción
   ========================================================== */

:root {
  --blue: #002db8;
  --blue-dark: #00218a;
  --orange: #f48122;
  --orange-dark: #db6c10;
  --cream: #f9f2ef;
  --ink: #111827;
  --navy: #0f1d3d;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #d9d4d1;
  --white: #ffffff;

  --container: 1180px;
  --container-wide: 1600px;           /* barra superior, cabecera, hero y pie */
  --gutter: clamp(24px, 4vw, 72px);   /* margen lateral del contenedor ancho */
  --topbar-h: 38px;
  --radius: 6px;
  --header-h: 84px;
  --font: "Inter", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.container--wide {
  max-width: var(--container-wide);
  padding: 0 var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.icon {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}
.icon .fill { fill: currentColor; stroke: none; }

section[id] { scroll-margin-top: calc(var(--topbar-h) + var(--header-h)); }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color .2s, color .2s, transform .2s, box-shadow .2s;
}
.btn--orange { background: var(--orange); color: var(--white); }
.btn--orange:hover { background: var(--orange-dark); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(244, 129, 34, .35); }
.btn--outlined { border-color: var(--ink); color: var(--ink); }
.btn--outlined:hover { color: var(--ink); }
.btn--ghost {
  padding: 8px 12px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  white-space: nowrap;
}
.btn--ghost:hover { background: var(--ink); color: var(--white); }

/* ---------- Títulos de sección ---------- */
.section { padding: 96px 0; }
.section--cream { background: var(--cream); }

.accent-bar {
  display: block;
  width: 100px; height: 4px;
  background: var(--orange);
  border-radius: 2px;
  margin-bottom: 18px;
}
.accent-bar--center { margin-left: auto; margin-right: auto; }

.section-title {
  color: var(--blue);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -.02em;
}

/* ==========================================================
   Barra superior
   ========================================================== */
.topbar {
  background: var(--blue);
  color: var(--white);
  font-size: 15px;
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(28px, 3.5vw, 64px);
  height: var(--topbar-h);
}
.topbar__item { display: inline-flex; align-items: center; gap: 8px; opacity: .95; }
.topbar__item:hover { opacity: 1; text-decoration: underline; }

/* ==========================================================
   Cabecera
   ========================================================== */
/* Barra azul + cabecera quedan fijas arriba al hacer scroll */
.site-top {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: box-shadow .25s;
}
.site-top.is-scrolled { box-shadow: 0 4px 18px rgba(0, 0, 0, .1); }

.header {
  position: relative;
  background: var(--cream);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}
.header__logo img { height: 46px; width: auto; }

.nav { display: flex; align-items: center; gap: clamp(32px, 4.5vw, 80px); }
.nav__link {
  position: relative;
  color: var(--blue);
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: .02em;
  padding: 6px 0;
}
.nav__link::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s;
}
.nav__link:hover::after,
.nav__link.is-active::after { transform: scaleX(1); }

.nav__cta { padding: 9px 22px; text-transform: uppercase; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  padding: 10px;
  background: none; border: 0; cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 3px; margin: 4px 0;
  background: var(--blue);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================
   Hero / carrusel
   ========================================================== */
.hero {
  position: relative;
  height: clamp(560px, calc(100vh - 120px), 760px);
  overflow: hidden;
  background: var(--blue-dark);
  color: var(--white);
}

.hero__slides { position: absolute; inset: 0; }
.hero__slide {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.2s ease, transform 7s ease-out;
}
.hero__slide.is-active { opacity: 1; transform: scale(1); }

/* Panel azul translúcido sobre la mitad izquierda */
.hero__panel {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  width: 53%;
  height: 100%;
  /* Alinea el texto con el logo de la cabecera (el % se calcula sobre el ancho del hero) */
  padding-left: max(var(--gutter), calc((100% - var(--container-wide)) / 2 + var(--gutter)));
  background: linear-gradient(180deg, rgba(0, 45, 184, .72) 0%, rgba(0, 45, 184, .62) 100%);
}
.hero__content { width: 100%; padding-right: 32px; }

.hero__title { display: flex; flex-direction: column; text-transform: uppercase; }
.hero__title-sm {
  font-size: clamp(1.4rem, 2.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: .005em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}
.hero__title-lg {
  margin: 6px 0 10px;
  color: var(--orange);
  font-size: clamp(2.2rem, 4.1vw, 4.4rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.01em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .2);
}
.hero__text {
  max-width: 520px;
  margin-top: 24px;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  opacity: .95;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 40px; }
.hero__actions .btn { padding: 14px 24px; font-size: 17px; }

.hero__controls {
  position: absolute;
  z-index: 3;
  left: 76.5%; bottom: 28px;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
}
.hero__arrow {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  color: var(--blue);
  cursor: pointer;
  transition: background-color .2s, transform .2s;
}
.hero__arrow:hover { background: var(--white); transform: scale(1.08); }
.hero__arrow svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.hero__dots { display: flex; gap: 8px; }
.hero__dot {
  width: 10px; height: 10px;
  padding: 0;
  border: 2px solid var(--white);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: width .3s, background-color .3s;
}
.hero__dot[aria-selected="true"] { width: 28px; background: var(--orange); border-color: var(--orange); }

/* ==========================================================
   Nosotros
   ========================================================== */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: start;
}
.about__intro { padding-top: 16px; }
.about__lead {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 56px;
  max-width: 460px;
}
.about__icon {
  display: grid; place-items: center;
  flex-shrink: 0;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--white);
}
.about__icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.about__lead p { font-size: 17px; text-align: justify; }

.about__pillars { border-left: 1.5px solid var(--ink); }
.pillar { padding: 36px 0 36px 40px; }
.pillar + .pillar { border-top: 1.5px solid var(--ink); }
.pillar h3 { color: var(--blue); font-size: 22px; font-weight: 700; margin-bottom: 14px; }
.pillar p { text-align: justify; }

/* ==========================================================
   Productos
   ========================================================== */
.products__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  margin-top: 48px;
}
.category__image {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: 50% 70%;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 29, 61, .12);
}
.category__title {
  margin-top: 40px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--blue);
  color: var(--ink);
  font-size: 30px;
  font-weight: 700;
}
.product-list { list-style: none; margin: 0; padding: 0; }
.product {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.product:last-child { border-bottom: 0; }
.product__thumb {
  width: 92px; height: 92px;
  object-fit: cover;
  border-radius: 6px;
  background: #e5e7eb;
}
.product__info h4 { color: var(--ink); font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.product__info p { color: var(--text); font-size: 15px; line-height: 1.45; }

/* ==========================================================
   Preguntas frecuentes
   ========================================================== */
.faq__list { max-width: 940px; margin: 56px auto 0; }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 0;
  color: var(--navy);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::before {
  content: "";
  flex-shrink: 0;
  border-style: solid;
  border-width: 7px 0 7px 11px;
  border-color: transparent transparent transparent var(--navy);
  transition: transform .25s;
}
.faq__item[open] summary::before { transform: rotate(90deg); }
.faq__item summary:hover { color: var(--blue); }
.faq__item p { padding: 0 0 22px 25px; color: var(--text); font-size: 17px; max-width: 820px; }

/* ==========================================================
   Contacto
   ========================================================== */
.contact__inner { text-align: center; }
.contact__subtitle { max-width: 320px; margin: 14px auto 0; font-size: 15px; color: var(--ink); }

.form { max-width: 820px; margin: 36px auto 0; text-align: left; }
.form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 40px; }
.field--full { grid-column: 1 / -1; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 22px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 17px;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 180px; }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111827' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 20px;
  cursor: pointer;
}
.field select:invalid { color: #9ca3af; }
.field select option { color: var(--ink); }
.field input::placeholder,
.field textarea::placeholder { color: #9ca3af; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 45, 184, .15); }
.form.was-validated .field :invalid { border-color: #dc2626; }

.checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}
.checkbox input { width: 16px; height: 16px; accent-color: var(--orange); cursor: pointer; }
.form.was-validated .checkbox input:invalid { outline: 2px solid #dc2626; outline-offset: 2px; }

.form__status { min-height: 1.5em; margin-top: 12px; text-align: center; font-size: 15px; font-weight: 500; }
.form__status.is-error { color: #dc2626; }
.form__status.is-success { color: #15803d; }

.btn--submit { display: flex; margin: 8px auto 0; padding: 12px 34px; font-size: 18px; }

/* ==========================================================
   Pie de página
   ========================================================== */
.footer { background: var(--blue); color: var(--white); }
.footer__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
  padding-top: 40px;
  padding-bottom: 40px;
}
.footer__logo img { height: 48px; width: auto; }

.footer__social { display: flex; gap: 40px; }
.social {
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border-radius: 8px;
  background: var(--white);
  color: var(--blue);
  transition: transform .2s, background-color .2s;
}
.social:hover { transform: translateY(-3px); background: var(--orange); color: var(--white); }
.social svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.footer__contact { justify-self: end; display: flex; flex-direction: column; gap: 10px; }
.footer__contact h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.footer__contact a { display: inline-flex; align-items: center; gap: 12px; }
.footer__contact a:hover { text-decoration: underline; }
.footer__contact .icon { width: 22px; height: 22px; }

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, .18);
  padding: 14px 0;
  font-size: 13px;
  text-align: center;
  opacity: .85;
}

/* ---------- Botón flotante de WhatsApp ---------- */
.wa-float {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 60;
  display: grid; place-items: center;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: #25d366;
  color: var(--white);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  transition: transform .2s;
}
.wa-float:hover { transform: scale(1.08); }
.wa-float svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.wa-float svg .fill { fill: currentColor; stroke: none; }

/* ---------- Animación al hacer scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 1024px) {
  .hero__panel { width: 62%; }
  .hero__controls { left: 81%; }
  .about__grid { gap: 48px; }
  .products__grid { gap: 40px; }
}

@media (max-width: 860px) {
  :root { --header-h: 70px; --topbar-h: 34px; }

  .section { padding: 72px 0; }

  .topbar { font-size: 13px; }
  .topbar__inner { justify-content: center; gap: 24px; }

  .header__logo img { height: 36px; }
  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 24px 24px;
    background: var(--cream);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .08);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav.is-open { visibility: visible; opacity: 1; transform: none; }
  .nav__link { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav__link::after { display: none; }
  .nav__cta { margin-top: 18px; }

  .hero { height: auto; min-height: 600px; }
  .hero__panel {
    width: 100%;
    min-height: 600px;
    padding-left: 0;
    background: linear-gradient(180deg, rgba(0, 45, 184, .78) 0%, rgba(0, 45, 184, .55) 100%);
  }
  .hero__content { padding: 64px 24px 110px; }
  .hero__actions { gap: 14px; }
  .hero__controls { left: 50%; bottom: 24px; }

  .about__grid { grid-template-columns: 1fr; }
  .about__lead { margin-top: 32px; max-width: none; }
  .about__pillars { border-left: 0; border-top: 1.5px solid var(--ink); }
  .pillar { padding: 28px 0; }

  .products__grid { grid-template-columns: 1fr; gap: 56px; }

  .faq__item summary { font-size: 17px; }
  .faq__item p { font-size: 16px; }

  .form__grid { grid-template-columns: 1fr; }
  .checkbox { justify-content: flex-start; align-items: flex-start; text-align: left; }
  .checkbox input { margin-top: 3px; flex-shrink: 0; }

  .footer__inner { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 28px; }
  .footer__contact { justify-self: center; align-items: center; }
}

@media (max-width: 480px) {
  .topbar__item { font-size: 12px; gap: 6px; }
  .topbar .icon { width: 15px; height: 15px; }
  .hero__actions .btn { flex: 1 1 100%; }
  .about__lead { flex-direction: column; align-items: flex-start; gap: 16px; }
  .product { grid-template-columns: 72px 1fr; }
  .product__thumb { width: 72px; height: 72px; }
  .product .btn--ghost { grid-column: 2; justify-self: start; }
  .footer__social { gap: 24px; }
  .wa-float { width: 52px; height: 52px; right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .hero__slide { transform: none; }
}
