/* =====================================================================
   Mega Latino - Web informativa
   Colores tomados del logo: índigo #304890 y rosa #e82860
   ===================================================================== */

:root {
  --primary: #304890;
  --primary-600: #283d7c;
  --primary-400: #4860b0;
  --primary-50: #eef1fa;
  --accent: #e82860;
  --accent-600: #cf1f52;
  --accent-50: #fdeef3;

  --text: #1c2340;
  --text-soft: #5a6180;
  --bg: #ffffff;
  --bg-soft: #f6f7fb;
  --border: #e4e7f0;
  --dark: #141b38;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 8px rgba(28, 35, 64, .06);
  --shadow: 0 10px 30px rgba(28, 35, 64, .08);
  --shadow-lg: 0 20px 50px rgba(48, 72, 144, .18);

  --header-h: 72px;
  --container: 1180px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

svg {
  width: 24px; height: 24px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 200;
  background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip-link:focus { left: 8px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.text-accent { color: var(--accent); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-weight: 600; font-size: .95rem;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s, color .25s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn--primary { background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(48, 72, 144, .28); }
.btn--primary:hover { background: var(--primary-600); box-shadow: 0 12px 26px rgba(48, 72, 144, .35); }

.btn--accent { background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(232, 40, 96, .28); }
.btn--accent:hover { background: var(--accent-600); }

.btn--ghost { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn--ghost:hover { background: var(--primary-50); }

/* ---------- Encabezado ---------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  transition: box-shadow .3s, background-color .3s;
}
.header.is-scrolled { box-shadow: 0 4px 20px rgba(28, 35, 64, .08); background: rgba(255, 255, 255, .95); }

.header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.header__logo img { height: 40px; width: auto; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav__list { display: flex; gap: 26px; }
.nav__link {
  position: relative; font-weight: 500; font-size: .95rem; color: var(--text-soft);
  padding: 6px 0; transition: color .2s;
}
.nav__link::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--accent); border-radius: 2px; transition: width .3s var(--ease);
}
.nav__link:hover, .nav__link.is-active { color: var(--primary); }
.nav__link:hover::after, .nav__link.is-active::after { width: 100%; }
.nav__cta { padding: 10px 22px; }

.nav-toggle {
  display: none; width: 44px; height: 44px; border: 0; border-radius: 12px;
  background: var(--primary-50); position: relative;
}
.nav-toggle span {
  position: absolute; left: 12px; right: 12px; height: 2px; border-radius: 2px;
  background: var(--primary); transition: transform .3s var(--ease), opacity .2s;
}
.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 27px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Portada ---------- */
.hero {
  position: relative;
  padding: calc(var(--header-h) + 56px) 0 80px;
  overflow: hidden;
}
.hero__bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 400px at 85% 15%, rgba(232, 40, 96, .12), transparent 70%),
    radial-gradient(700px 500px at 10% 90%, rgba(48, 72, 144, .14), transparent 70%),
    linear-gradient(180deg, #f8f9fe 0%, #fff 100%);
}
.hero__inner { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--accent-50); color: var(--accent);
  font-size: .85rem; font-weight: 600; margin-bottom: 18px;
}
.badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 800; letter-spacing: -.02em; color: var(--primary); }
.hero__text > p { font-size: 1.1rem; color: var(--text-soft); max-width: 520px; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 36px; }

.hero__stats { display: flex; gap: 32px; }
.hero__stats li { display: flex; flex-direction: column; }
.hero__stats strong { font-size: 1.5rem; color: var(--primary); font-weight: 700; line-height: 1.2; }
.hero__stats span { font-size: .85rem; color: var(--text-soft); }

/* Tarjeta con el logo en la portada */
.hero__card {
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: 40px;
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.hero__card::before, .hero__card::after {
  content: ''; position: absolute; border-radius: 50%; z-index: 0;
}
.hero__card::before { width: 260px; height: 260px; right: -90px; top: -90px; background: radial-gradient(circle, rgba(232, 40, 96, .14), transparent 70%); }
.hero__card::after { width: 300px; height: 300px; left: -110px; bottom: -120px; background: radial-gradient(circle, rgba(48, 72, 144, .14), transparent 70%); }
.hero__card img { position: relative; z-index: 1; width: 85%; height: auto; }
.hero__card-text {
  position: relative; z-index: 1; margin: 0;
  font-size: .9rem; font-weight: 500; color: var(--text-soft); text-align: center;
}

/* ---------- Placeholders de imagen ---------- */
.ph {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 100%;
  border: 2px dashed #c8cfe6;
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(45deg, rgba(48, 72, 144, .035) 0 12px, transparent 12px 24px),
    linear-gradient(135deg, var(--primary-50), #fff);
  color: var(--primary-400);
  text-align: center; padding: 20px;
}
.ph svg { width: 44px; height: 44px; stroke-width: 1.4; opacity: .8; }
.ph span { font-weight: 600; font-size: .95rem; }
.ph small { font-size: .8rem; color: var(--text-soft); }

.ph--about { aspect-ratio: 4 / 5; border-radius: 24px; }
.ph--map {
  height: 100%; min-height: 340px;
  border-color: rgba(255, 255, 255, .25);
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .04) 0 12px, transparent 12px 24px),
    rgba(255, 255, 255, .06);
  color: #c9d2f5;
}
.ph--map small { color: #9aa4cc; }

/* ---------- Secciones ---------- */
.section { padding: 96px 0; }
.section--soft { background: var(--bg-soft); }
.section--dark { background: var(--dark); color: #e8ebf7; position: relative; overflow: hidden; }
.section--dark::before {
  content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%;
  right: -160px; top: -200px; background: radial-gradient(circle, rgba(232, 40, 96, .22), transparent 70%);
}

.section__head { text-align: center; max-width: 620px; margin: 0 auto 48px; }
.section__head h2, .about__text h2, .contact h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); letter-spacing: -.01em; color: var(--primary); }
.section__head p { color: var(--text-soft); margin: 0; }
.section--dark h2 { color: #fff; }

.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.eyebrow--light { color: #ff7aa2; }

/* ---------- Tarjetas ---------- */
.cards { display: grid; gap: 24px; }
.cards--cat { grid-template-columns: repeat(3, 1fr); }
.cards--prod { grid-template-columns: repeat(4, 1fr); }

.cat {
  padding: 30px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.cat:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.cat__icon {
  width: 58px; height: 58px; border-radius: 16px;
  display: grid; place-items: center; margin-bottom: 18px;
  background: var(--primary-50); color: var(--primary);
  transition: background-color .3s, color .3s;
}
.cat__icon svg { width: 30px; height: 30px; }
.cat:hover .cat__icon { background: var(--accent); color: #fff; }
.cat h3 { font-size: 1.15rem; color: var(--text); }
.cat p { color: var(--text-soft); margin: 0; font-size: .95rem; }

/* Filtros */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 36px; }
.chip {
  padding: 9px 18px; border-radius: 999px;
  border: 1px solid var(--border); background: #fff; color: var(--text-soft);
  font-size: .9rem; font-weight: 500;
  transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s;
}
.chip:hover { border-color: var(--primary-400); color: var(--primary); }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(48, 72, 144, .25); }

/* Productos */
.prod {
  position: relative;
  background: #fff; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.prod::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(.25); transform-origin: left; transition: transform .4s var(--ease);
}
.prod:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.prod:hover::before { transform: scaleX(1); }
.prod.is-hidden { display: none; }
.prod__body { padding: 24px 22px 24px; }
.prod__tag {
  display: inline-block; font-size: .75rem; font-weight: 600; color: var(--accent);
  background: var(--accent-50); padding: 3px 10px; border-radius: 999px; margin-bottom: 10px;
}
.prod h3 { font-size: 1.02rem; color: var(--text); margin-bottom: 6px; }
.prod p { font-size: .9rem; color: var(--text-soft); margin: 0; }

/* ---------- Marcas ---------- */
.brands { padding: 56px 0; border-block: 1px solid var(--border); }
.brands__title { text-align: center; color: var(--text-soft); font-weight: 500; margin-bottom: 26px; }
.brands__track {
  display: flex; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.brands__list {
  display: flex; flex-shrink: 0; gap: 64px; padding-right: 64px;
  animation: marquee 32s linear infinite;
}
.brands__list li {
  font-size: 1.45rem; font-weight: 700; color: #b3bad3; letter-spacing: .02em;
  white-space: nowrap; transition: color .2s;
}
.brands__list li:hover { color: var(--primary); }
.brands__track:hover .brands__list { animation-play-state: paused; }

@keyframes marquee { to { transform: translateX(-100%); } }

/* ---------- Nosotros ---------- */
.about { display: grid; grid-template-columns: .9fr 1.1fr; gap: 64px; align-items: center; }
.about__text > p { color: var(--text-soft); font-size: 1.05rem; }

.features { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 30px; }
.features li { display: flex; gap: 14px; align-items: flex-start; }
.features__icon {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; background: var(--accent-50); color: var(--accent);
}
.features strong { display: block; margin-bottom: 2px; }
.features p { margin: 0; font-size: .9rem; color: var(--text-soft); }

/* ---------- Contacto ---------- */
.contact { position: relative; display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: stretch; }
.contact__lead { color: #aeb6d6; font-size: 1.05rem; }

.contact__list { display: grid; gap: 18px; margin: 28px 0 34px; }
.contact__list li { display: flex; gap: 16px; align-items: center; }
.contact__icon {
  flex-shrink: 0; width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .08); color: #ff7aa2;
}
.contact__list strong { display: block; font-size: .85rem; font-weight: 500; color: #9aa4cc; }
.contact__list span { color: #fff; font-weight: 500; }
.contact__list .pending { color: #7f89b3; font-style: italic; font-weight: 400; }

.social { display: flex; align-items: center; gap: 12px; }
.social__label { font-size: .9rem; color: #9aa4cc; margin-right: 6px; }
.social__item {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .18); color: #c9d2f5;
}
.social__item svg { width: 20px; height: 20px; }

/* ---------- Pie ---------- */
.footer { background: #0e1430; color: #8f98be; padding: 40px 0 34px; text-align: center; font-size: .9rem; }
.footer__inner p { margin: 0 0 4px; }
.footer__logo {
  height: 38px; width: auto; margin: 0 auto 16px;
  background: #fff; padding: 6px 12px; border-radius: 10px;
}
.footer__copy { margin-top: 14px !important; font-size: .82rem; color: #6c7499; }

/* ---------- Botón volver arriba ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  width: 48px; height: 48px; border-radius: 50%; border: 0;
  display: grid; place-items: center;
  background: var(--primary); color: #fff; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .3s, transform .3s var(--ease), visibility .3s, background-color .2s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--accent); }

/* ---------- Animación al hacer scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1024px) {
  .cards--prod { grid-template-columns: repeat(3, 1fr); }
  .hero__inner { gap: 36px; }
  .about { gap: 40px; }
}

@media (max-width: 860px) {
  :root { --header-h: 64px; }

  /* Menú móvil */
  .nav-toggle { display: block; }
  .nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 12px 20px 24px;
    background: #fff;
    box-shadow: 0 16px 30px rgba(28, 35, 64, .12);
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: transform .3s var(--ease), opacity .3s, visibility .3s;
  }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav__list { flex-direction: column; gap: 0; }
  .nav__link { display: block; padding: 14px 4px; border-bottom: 1px solid var(--border); font-size: 1rem; }
  .nav__link::after { display: none; }
  .nav__cta { margin-top: 18px; }
  .header__logo img { height: 34px; }

  .hero { padding: calc(var(--header-h) + 36px) 0 64px; text-align: center; }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__text > p { margin-inline: auto; }
  .hero__actions, .hero__stats { justify-content: center; }
  .badge { margin-inline: auto; }

  .section { padding: 72px 0; }
  .cards--cat { grid-template-columns: repeat(2, 1fr); }
  .cards--prod { grid-template-columns: repeat(2, 1fr); }

  .about, .contact { grid-template-columns: 1fr; }
  .about__media { max-width: 420px; margin: 0 auto; width: 100%; }
  .ph--map { min-height: 260px; }
}

@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .hero__actions .btn { flex: 1 1 100%; }
  .hero__stats { gap: 22px; }
  .hero__stats strong { font-size: 1.25rem; }

  .cards { gap: 16px; }
  .cards--cat { grid-template-columns: 1fr 1fr; }
  .cat { padding: 22px 16px; text-align: center; }
  .cat__icon { margin: 0 auto 14px; width: 52px; height: 52px; }
  .cat h3 { font-size: 1rem; }
  .cat p { font-size: .85rem; }

  .cards--prod { grid-template-columns: 1fr; gap: 12px; }
  .prod__body { padding: 18px 18px 20px; }
  .hero__card { padding: 28px; gap: 16px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 6px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .chip { flex-shrink: 0; }

  .features { grid-template-columns: 1fr; }
  .brands__list li { font-size: 1.2rem; }
  .brands__list { gap: 40px; padding-right: 40px; }
}

/* Respeta a quien prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
