/* ===========================================================
   RV Hidráulica Móvil Industrial — estilos
   Mobile-first. Tokens, layout, componentes.
   =========================================================== */

/* ---------- Tokens ---------- */
:root {
  --c-dark: #0e1b24;
  --c-dark-2: #13232e;
  --c-dark-3: #1b2e3a;
  --c-yellow: #f5b50a;
  --c-yellow-600: #e0a400;
  --c-white: #ffffff;
  --c-bg: #ffffff;
  --c-bg-alt: #f1f3f5;
  --c-text: #1b2730;
  --c-text-muted: #5b6b76;
  --c-border: #e3e7ea;

  --font-head: "Oswald", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --maxw: 1240px;
  --radius: 6px;
  --shadow-sm: 0 1px 3px rgba(14,27,36,.08), 0 1px 2px rgba(14,27,36,.06);
  --shadow-md: 0 6px 18px rgba(14,27,36,.12);
  --header-h: 80px;
}

/* ---------- Reset base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.55;
  font-size: 16px;
}
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.1; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }

/* ---------- Accesibilidad ---------- */
.skip-link {
  position: absolute; left: 8px; top: -48px;
  background: var(--c-yellow); color: var(--c-dark);
  padding: 10px 16px; border-radius: var(--radius); font-weight: 700; z-index: 200;
  transition: top .2s;
}
.skip-link:focus { top: 8px; }

:focus-visible { outline: 3px solid var(--c-yellow); outline-offset: 2px; border-radius: 3px; }

/* ---------- Botones ---------- */
.btn {
  --btn-bg: var(--c-yellow);
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  padding: 12px 20px; border-radius: var(--radius);
  border: 2px solid transparent; cursor: pointer;
  background: var(--btn-bg); color: var(--c-dark);
  transition: transform .12s ease, background .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { flex: none; }

.btn--cta { background: var(--c-yellow); color: var(--c-dark); }
.btn--cta:hover { background: var(--c-yellow-600); }
.btn--primary { background: var(--c-yellow); color: var(--c-dark); }
.btn--primary:hover { background: var(--c-yellow-600); }
.btn--ghost { background: transparent; color: var(--c-white); border-color: rgba(255,255,255,.55); }
.btn--ghost:hover { background: rgba(255,255,255,.1); border-color: #fff; }
.btn--dark { background: var(--c-dark); color: var(--c-white); }
.btn--dark:hover { background: #000; }

/* ===========================================================
   HEADER
   =========================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--c-white);
  border-bottom: 1px solid var(--c-border);
}
.header__inner {
  display: flex; align-items: center; gap: 16px;
  min-height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand__logo { width: auto; height: 64px; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__text strong { font-family: var(--font-head); font-size: 1.05rem; letter-spacing: .3px; color: var(--c-dark); }
.brand__text small { font-size: .62rem; letter-spacing: 2px; color: var(--c-text-muted); }

.main-nav { margin-left: auto; }
.main-nav__list { display: flex; gap: 6px; }
.main-nav__list a {
  display: block; padding: 10px 12px; font-weight: 500; font-size: .95rem;
  color: var(--c-text); border-bottom: 3px solid transparent; border-radius: 3px;
}
.main-nav__list a:hover { color: #000; }
.main-nav__list a.is-active { color: #000; font-weight: 700; border-bottom-color: var(--c-yellow); border-radius: 0; }

.header__actions { display: flex; align-items: center; gap: 10px; }

/* Buscador */
.search { display: flex; align-items: center; position: relative; }
.search__toggle {
  display: grid; place-items: center; width: 40px; height: 40px;
  background: transparent; border: 0; color: var(--c-dark); cursor: pointer; border-radius: 50%;
}
.search__toggle:hover { background: var(--c-bg-alt); }
.search__input {
  width: 0; padding: 0; border: 0; opacity: 0;
  font: inherit; font-size: .9rem;
  transition: width .25s ease, opacity .2s ease, padding .25s ease;
  border-bottom: 2px solid var(--c-border); background: transparent;
}
.search.is-open .search__input { width: 180px; opacity: 1; padding: 8px 6px; }
.search.is-open .search__input:focus { border-bottom-color: var(--c-yellow); outline: none; }

/* Botón hamburguesa */
.nav-toggle {
  display: none; margin-left: auto;
  width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer;
  flex-direction: column; gap: 5px; align-items: center; justify-content: center;
}
.nav-toggle__bar { width: 24px; height: 2px; background: var(--c-dark); transition: transform .25s, opacity .2s; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===========================================================
   HERO
   =========================================================== */
.hero {
  position: relative; background: var(--c-dark); color: var(--c-white);
  overflow: hidden;
}
.hero__media {
  position: absolute; inset: 0;
  background-image: linear-gradient(90deg, rgba(14,27,36,.95) 0%, rgba(14,27,36,.75) 40%, rgba(14,27,36,.25) 100%), url("/assets/img/hero-excavadora.webp");
  background-size: cover; background-position: center right;
}
/* Franja diagonal amarilla decorativa */
.hero::before {
  content: ""; position: absolute; top: 0; left: 0; z-index: 1;
  width: 140px; height: 100%;
  background: linear-gradient(120deg, var(--c-yellow) 0 40%, transparent 40%);
  opacity: .9; pointer-events: none;
}
.hero__inner { position: relative; z-index: 2; padding-block: clamp(40px, 8vw, 90px); }
.hero__content { max-width: 620px; }
.hero__eyebrow { color: var(--c-yellow); font-weight: 700; letter-spacing: 1px; font-size: .85rem; margin: 0 0 10px; }
.hero__title {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(2rem, 7vw, 3.6rem); letter-spacing: .5px; text-transform: uppercase;
}
.hero__title span { color: var(--c-yellow); display: block; }
.hero__text { font-size: clamp(1rem, 2.6vw, 1.15rem); color: #d7dee3; max-width: 460px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }

/* ===========================================================
   BENEFICIOS
   =========================================================== */
.benefits { background: var(--c-dark-2); color: var(--c-white); }
.benefits__grid {
  display: grid; grid-template-columns: 1fr; gap: 1px;
  padding-block: 24px;
}
.benefit { display: flex; align-items: center; gap: 14px; padding: 10px 6px; }
.benefit__icon { width: 36px; height: 36px; color: var(--c-yellow); flex: none; }
.benefit p { margin: 0; font-weight: 600; font-size: .95rem; }

/* ===========================================================
   SECCIONES genéricas
   =========================================================== */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.section-title {
  font-family: var(--font-head); text-transform: uppercase;
  font-size: clamp(1.4rem, 4vw, 2rem); color: var(--c-dark);
  display: flex; align-items: center; gap: 14px; margin: 0;
}
.section-title--light { color: var(--c-white); }
.section-title__bar { width: 42px; height: 6px; background: var(--c-yellow); display: inline-block; flex: none; }
.section-link { color: var(--c-text-muted); font-weight: 600; font-size: .9rem; }
.section-link:hover { color: var(--c-dark); }

/* ---------- Productos ---------- */
.products { padding-block: clamp(40px, 7vw, 70px); background: var(--c-white); }
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.product-card {
  background: var(--c-dark); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden; transition: transform .15s ease, box-shadow .15s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.product-card__btn {
  display: block; width: 100%; padding: 0; border: 0; cursor: pointer; background: none;
  position: relative; text-align: left;
}
.product-card__img { display: block; }
.product-card__img img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.product-card__name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 24px 12px 10px;
  font-family: var(--font-head); font-weight: 600; text-transform: uppercase;
  font-size: .8rem; color: var(--c-white); line-height: 1.15;
  background: linear-gradient(to top, rgba(14,27,36,.92) 0%, rgba(14,27,36,0) 100%);
}

/* ---------- Aplicaciones + Catálogo ---------- */
.apps { display: grid; grid-template-columns: 1fr; }
.apps__left {
  background: var(--c-dark); color: var(--c-white);
  padding: clamp(28px, 5vw, 48px) clamp(16px, 4vw, 40px);
}
.apps__sub { color: #c6cfd6; margin: 0 0 20px; }
.apps__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.app-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  background: var(--c-dark-3); border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius); padding: 18px 10px; font-weight: 600; font-size: .9rem;
}
.app-card svg { width: 34px; height: 34px; color: var(--c-yellow); }

.apps__catalog { background: var(--c-yellow); display: grid; align-items: center; padding: clamp(28px, 5vw, 48px) clamp(16px, 4vw, 40px); }
.catalog__box { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.catalog__cover { width: 190px; height: auto; filter: drop-shadow(0 8px 16px rgba(14,27,36,.35)); transform: rotate(-4deg); }
.catalog__title { font-family: var(--font-head); text-transform: uppercase; color: var(--c-dark); font-size: clamp(1.3rem, 3.5vw, 1.9rem); }
.catalog__text p { color: #3a2e00; margin: 0 0 16px; max-width: 420px; }

/* ---------- Servicios ---------- */
.services { padding-block: clamp(40px, 7vw, 70px); background: var(--c-bg-alt); }
.services__grid { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 20px; }
.service { background: var(--c-white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); border-top: 4px solid var(--c-yellow); }
.service h3 { font-family: var(--font-head); text-transform: uppercase; font-size: 1.1rem; color: var(--c-dark); }
.service p { margin: 0; color: var(--c-text-muted); }

/* ---------- Nosotros ---------- */
.about { padding-block: clamp(40px, 7vw, 70px); }
.about__inner p { max-width: 760px; color: var(--c-text-muted); font-size: 1.05rem; }

/* ---------- Contacto ---------- */
.contact { background: var(--c-dark); color: var(--c-white); padding-block: clamp(40px, 7vw, 70px); }
.contact__lead { color: #c6cfd6; max-width: 560px; }
.contact__details { list-style: none; margin: 22px 0 6px; padding: 0; display: grid; gap: 12px; max-width: 560px; }
.contact__details li { display: flex; flex-direction: column; gap: 2px; }
.contact__label { font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; color: #8fa0ad; }
.contact__details a { color: var(--c-white); text-decoration: none; font-weight: 600; font-size: 1.05rem; }
.contact__details a:hover, .contact__details a:focus-visible { text-decoration: underline; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }

/* ---------- Galería / Líneas destacadas ---------- */
.gallery { padding-block: clamp(40px, 7vw, 70px); background: var(--c-bg-alt); }
.gallery__grid { display: grid; grid-template-columns: repeat(1, 1fr); gap: 16px; }
.gallery__item { display: flex; }
.gallery__btn {
  width: 100%; padding: 0; border: 0; cursor: pointer; background: var(--c-dark);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  position: relative; display: block;
  transition: transform .15s ease, box-shadow .15s ease;
}
.gallery__btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.gallery__btn img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.gallery__caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 14px 12px;
  font-family: var(--font-head); font-weight: 600; text-transform: uppercase;
  font-size: .9rem; color: var(--c-white); text-align: left;
  background: linear-gradient(to top, rgba(14,27,36,.92) 0%, rgba(14,27,36,0) 100%);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  background: rgba(8,15,20,.9); padding: clamp(16px, 4vw, 48px);
}
.lightbox[hidden] { display: none; }
.lightbox__img {
  max-width: 100%; max-height: 90vh; width: auto; height: auto;
  border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.lightbox__close {
  position: absolute; top: 16px; right: 16px;
  width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
  background: rgba(255,255,255,.12); color: var(--c-white);
  transition: background .15s ease;
}
.lightbox__close:hover { background: rgba(255,255,255,.25); }

/* ===========================================================
   FOOTER
   =========================================================== */
.site-footer { background: var(--c-dark-2); color: #c6cfd6; }
.footer__inner {
  display: grid; grid-template-columns: 1fr; gap: 24px;
  padding-block: 34px; align-items: center;
}
.footer__brand { display: flex; align-items: center; gap: 10px; }
.footer__brand .brand__text strong { color: var(--c-white); }
.footer__nav ul { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer__nav a { font-weight: 500; }
.footer__nav a:hover, .footer__contact a:hover { color: var(--c-yellow); }
.footer__social { display: flex; gap: 12px; }
.footer__social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.08); color: var(--c-white); }
.footer__social a:hover { background: var(--c-yellow); color: var(--c-dark); }
.footer__contact { display: flex; flex-direction: column; gap: 6px; }
.footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  padding-block: 16px; border-top: 1px solid rgba(255,255,255,.08); color: #8798a3;
}

/* ===========================================================
   BREAKPOINTS
   =========================================================== */

/* Móvil: menú desplegable */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; margin: 0;
    background: var(--c-white); border-bottom: 1px solid var(--c-border);
    max-height: 0; overflow: hidden; transition: max-height .3s ease; box-shadow: var(--shadow-md);
  }
  .main-nav.is-open { max-height: 70vh; overflow: auto; }
  .main-nav__list { flex-direction: column; gap: 0; padding: 8px 0; }
  .main-nav__list a { padding: 14px 24px; border-bottom: 1px solid var(--c-border); border-radius: 0; }
  .main-nav__list a.is-active { border-bottom-color: var(--c-border); border-left: 4px solid var(--c-yellow); }
  .header__actions .search { display: none; }
}

/* Tablet */
@media (min-width: 600px) {
  .benefits__grid { grid-template-columns: repeat(2, 1fr); gap: 10px 32px; }
  .benefit { border-left: 1px solid rgba(255,255,255,.1); padding-left: 20px; }
  .benefit:nth-child(odd) { border-left: 0; padding-left: 6px; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .gallery__grid { grid-template-columns: repeat(2, 1fr); }
  .apps__grid { grid-template-columns: repeat(4, 1fr); }
  .services__grid { grid-template-columns: repeat(3, 1fr); }
  .footer__inner { grid-template-columns: auto 1fr auto; }
  .footer__contact { flex-direction: row; gap: 18px; }
}

/* Desktop */
@media (min-width: 901px) {
  .benefits__grid { grid-template-columns: repeat(4, 1fr); gap: 0; }
  .benefit { border-left: 1px solid rgba(255,255,255,.12); padding-left: 24px; }
  .benefit:first-child { border-left: 0; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .gallery__grid { grid-template-columns: repeat(3, 1fr); }
  .apps { grid-template-columns: 1.1fr 1fr; }
}

@media (min-width: 1100px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
}

/* Movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
