/* ===== Fuentes (alojadas en assets/fonts, subconjunto latino) ===== */
@font-face { font-family: "Lato"; font-weight: 400; font-style: normal; font-display: swap; src: url(../assets/fonts/lato-400.woff2) format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 700; font-style: normal; font-display: swap; src: url(../assets/fonts/lato-700.woff2) format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 100 900; font-style: normal; font-display: swap; src: url(../assets/fonts/montserrat-variable.woff2) format("woff2"); }

/* ===== Variables: cambia aquí colores y tipografía ===== */
:root {
  --navy: #070a37;
  --navy-tint: rgba(7, 10, 55, 0.14);
  --accent: #1e9bb6;
  --active: #ff4b00;
  --text: #333;
  --muted: #555;
  --white: #fff;
  --radius: 20px;
  --font-body: "Lato", Arial, sans-serif;
  --font-heading: "Montserrat", Arial, sans-serif;
  --max-width: 1200px;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-heading); color: var(--navy); line-height: 1.2; margin: 0 0 1rem; }
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(2rem, 4vw, 2.5rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1rem; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 5%; }
.section { padding: 5rem 0; }
.section--tint { background: var(--navy-tint); }
.center { text-align: center; }
.lead { font-size: 1.25rem; }

/* Títulos que aparecen con fundido al hacer scroll (la clase .js la pone main.js) */
.js .section h2 { opacity: 0; transform: translateY(16px); transition: opacity 0.8s ease, transform 0.8s ease; }
.js .section h2.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .carousel__track { scroll-behavior: auto; }
  .js .section h2 { opacity: 1; transform: none; transition: none; }
}

/* ===== Botones ===== */
.button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--navy);
  border-radius: var(--radius);
  background: var(--navy);
  color: var(--white);
  font: 700 0.9rem var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.button:hover { opacity: 0.85; }
.button--ghost { background: rgba(75, 115, 112, 0.2); border-color: var(--white); }
.button--outline { border-color: var(--accent); }
.button-group { display: flex; flex-wrap: wrap; gap: 1rem; }

/* ===== Navegación ===== */
.navbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--white);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.navbar__inner { display: flex; align-items: center; gap: 2rem; height: 72px; }
.navbar__logo img { height: 44px; width: auto; }
.navbar__menu { display: flex; gap: 2rem; margin-left: auto; }
.navbar__menu a { color: var(--navy); font-weight: 700; text-decoration: none; }
.navbar__menu a:hover { text-decoration: underline; text-underline-offset: 4px; }
.navbar__menu a.is-active { color: var(--active); }
.navbar__cta { margin-left: 2rem; }
.navbar__toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.navbar__toggle span { display: block; width: 24px; height: 2px; margin: 5px 0; background: var(--navy); }

/* ===== Hero ===== */
.hero { position: relative; min-height: 80vh; display: flex; align-items: center; overflow: hidden; }
.hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right top; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0.3) 45%, rgba(255,255,255,0) 70%);
}
.hero__content { position: relative; z-index: 2; width: 100%; padding-top: 4rem; padding-bottom: 4rem; }
.hero__content > * { max-width: 560px; }
.hero h1 { color: #0e3143; }
.typed::after { content: "|"; font-weight: 400; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero .button--ghost { color: var(--navy); border-color: var(--navy); background: rgba(255,255,255,0.6); }

/* ===== Nosotros ===== */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.about__image { border-radius: var(--radius); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* ===== Servicios ===== */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin: 3rem 0; }
.service { text-align: center; }
.service img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; margin-bottom: 1.5rem; }

/* ===== Productos ===== */
/* Carrusel: --per-view = tarjetas visibles a la vez (cambia en los media queries de abajo) */
.carousel { --per-view: 3; --gap: 2rem; position: relative; margin-top: 3rem; }
.carousel__track {
  display: flex; gap: var(--gap);
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 0.5rem 0.25rem 1rem;
  scrollbar-width: none;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track > * {
  flex: 0 0 calc((100% - (var(--per-view) - 1) * var(--gap)) / var(--per-view));
  scroll-snap-align: start;
}
.carousel__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 1;
  width: 44px; height: 44px; padding: 8px;
  border: 0; background: none; color: #4b6370; cursor: pointer;
}
.carousel__arrow:hover { color: var(--navy); }
.carousel__arrow svg { width: 100%; height: 100%; }
.carousel__arrow--prev { left: -52px; }
.carousel__arrow--next { right: -52px; }
.carousel__track:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--radius); }
.carousel__dots { display: flex; justify-content: center; margin-top: 0.5rem; }
.carousel__dots button { width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; }
.carousel__dots button::before {
  content: ""; display: block; width: 10px; height: 10px; margin: auto; border-radius: 50%;
  background: rgba(7, 10, 55, 0.25);
}
.carousel__dots button[aria-current="true"]::before { background: var(--navy); }

.product {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  text-align: center;
}
.product img { height: 40px; width: auto; margin: 0 auto 1rem; }
.product h3 { margin-bottom: 0.25rem; }
.product__tagline { font-weight: 700; }
.product p:not(.product__tagline), .product ul { color: var(--muted); }
.product ul { list-style: none; padding: 0; margin: 0; }

/* ===== Contacto ===== */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; }
.contact__list { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1rem; }
.contact__list li { display: flex; gap: 1rem; align-items: flex-start; }
.contact__list svg { width: 24px; height: 24px; flex: none; color: var(--navy); }
.contact__form { display: grid; gap: 1.25rem; }
.contact__form label { display: grid; gap: 0.5rem; font-size: 0.9rem; }
.contact__form input, .contact__form textarea {
  font: inherit; padding: 0.6rem 0.75rem;
  border: 1.6px solid #ccc; border-radius: 8px;
}
.contact__form input:focus, .contact__form textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.contact__form .button { justify-self: start; }
.contact__form .button:disabled { opacity: 0.6; cursor: wait; }
.form-status { margin: 0; padding: 0.75rem 1rem; border-radius: 8px; }
.form-status.is-success { background: #e6f4ea; color: #1e5631; }
.form-status.is-error { background: #fdecea; color: #8a1c1c; }

/* ===== Footer ===== */
.footer { background: rgba(7, 10, 55, 0.25); padding: 4rem 0 2rem; }
.footer__top { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.footer__top img { height: 44px; width: auto; }
.footer__links { display: flex; gap: 2rem; }
.footer__links a { font-weight: 700; text-decoration: none; color: var(--navy); }
.footer hr { border: 0; border-top: 1px solid rgba(0, 0, 0, 0.2); margin: 3rem 0 2rem; }
.footer__credit { font-size: 0.9rem; margin: 0; }

/* ===== Responsive ===== */
@media (max-width: 991px) {
  .navbar__menu {
    display: none;
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--white); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
  .navbar__menu.is-open { display: flex; }
  .navbar__menu a { padding: 1rem 5%; }
  .navbar__cta { margin-left: auto; }
  .navbar__toggle { display: block; }
  .services { grid-template-columns: repeat(2, 1fr); }
  .carousel { --per-view: 2; }
}
@media (max-width: 1320px) {
  /* Sin espacio fuera del contenedor: las flechas van sobre el borde de las tarjetas */
  .carousel__arrow { background: rgba(255, 255, 255, 0.9); border-radius: 50%; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); }
  .carousel__arrow--prev { left: -12px; }
  .carousel__arrow--next { right: -12px; }
}
@media (max-width: 767px) {
  .section { padding: 3.5rem 0; }
  .about, .contact { grid-template-columns: 1fr; gap: 2rem; }
  .services { grid-template-columns: 1fr; }
  .carousel { --per-view: 1; --gap: 1rem; }
  .carousel .product { padding: 1.5rem 2.5rem; }
  .carousel__arrow { width: 36px; height: 36px; padding: 6px; }
  .carousel__arrow--prev { left: -14px; }
  .carousel__arrow--next { right: -14px; }
  .hero::before { background: rgba(255, 255, 255, 0.75); }
  .navbar__cta { display: none; }
  .navbar__toggle { margin-left: auto; }
}
