/* Hialsa v2 — showcase inmersivo (fondo oscuro derivado del logo).
   Paleta y contrastes: docs/paleta.md; desviaciones en docs/v2/implementacion.md */

:root {
  --bg: #161211;
  --bg-soft: #1e1a19;
  --bg-raised: #262120;
  --text: #eaf6fa;
  --muted: #9aaec0;
  --border: #39332f;

  --accent: #4ea8e0;
  --accent-strong: #0e79b6;
  --gradient: linear-gradient(135deg, #0c4b86, #0e79b6);

  --whatsapp: #25d366;
  --whatsapp-text: #161211;

  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --container: 1200px;
  --pad: clamp(1rem, 4vw, 2rem);
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
img, svg, iframe { display: block; max-width: 100%; }
a { color: var(--accent); }
a:hover { color: #6fbde6; }
ul { list-style: none; padding: 0; }
button, input, textarea { font: inherit; color: inherit; }

h1, h2, h3 { line-height: 1.08; font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 8vw, 5rem); }
h2 { font-size: clamp(1.8rem, 5vw, 3.2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }

.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;
}
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--accent); color: var(--bg); padding: 0.6rem 1rem; font-weight: 700;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.container { width: min(100% - 2 * var(--pad), var(--container)); margin-inline: auto; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.85rem 1.5rem; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-accent { background: var(--gradient); color: #fff; }
.btn-accent:hover { color: #fff; filter: brightness(1.12); }
.btn-line { background: transparent; color: var(--text); border-color: var(--border); }
.btn-line:hover { border-color: var(--accent); color: var(--accent); }
.btn-wa { background: var(--whatsapp); color: var(--whatsapp-text); }
.btn-wa:hover { background: #1eb955; color: var(--whatsapp-text); }
.btn-lg { padding: 1rem 1.9rem; font-size: 1.05rem; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.88rem; }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 100; height: var(--header-h);
  display: flex; align-items: center;
  background: transparent; transition: background 0.3s ease, box-shadow 0.3s ease;
}
.site-header.is-solid {
  background: rgba(22, 18, 17, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--border);
}
.header-inner {
  width: min(100% - 2 * var(--pad), var(--container)); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: inline-flex; align-items: center; }
.brand img { height: 46px; width: auto; border-radius: 6px; }
.nav-toggle {
  background: none; border: 0; padding: 0.4rem; cursor: pointer; color: var(--text);
  z-index: 120;
}
.site-nav { display: none; }
.site-nav.is-open {
  display: flex; flex-direction: column; gap: 1.2rem; align-items: flex-start;
  position: fixed; inset: 0; z-index: 110;
  background: var(--bg); padding: calc(var(--header-h) + 2rem) var(--pad) 2rem;
  overflow-y: auto;
}
.site-nav ul { display: flex; flex-direction: column; gap: 1.1rem; }
.site-nav a { color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.35rem; }
.site-nav a:hover { color: var(--accent); }
.site-nav .nav-cta a { font-size: 1rem; }

/* ---------- hero ---------- */
.hero {
  min-height: 100svh; display: flex; align-items: flex-end;
  padding: calc(var(--header-h) + 2rem) 0 clamp(3rem, 8vw, 6rem);
  position: relative; isolation: isolate;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(14, 121, 182, 0.35), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(12, 75, 134, 0.35), transparent 60%),
    var(--bg);
}
.hero::after {
  content: ''; position: absolute; inset: auto 0 0; height: 35vh; z-index: -1;
  background: linear-gradient(to top, var(--bg), transparent);
}
.hero-inner { max-width: 900px; }
.hero .eyebrow {
  color: var(--accent); text-transform: uppercase; letter-spacing: 0.3em;
  font-size: 0.78rem; font-weight: 700; margin-bottom: 1.2rem;
}
.hero h1 { margin-bottom: 1.4rem; }
.hero h1 em { font-style: normal; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: clamp(1rem, 2.4vw, 1.25rem); max-width: 60ch; margin-bottom: 2.2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.scroll-cue {
  position: absolute; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  color: var(--muted); font-size: 0.75rem; letter-spacing: 0.25em; text-transform: uppercase;
  animation: bob 2.4s infinite var(--ease);
}
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ---------- secciones / showcase ---------- */
.section { padding: clamp(3.5rem, 9vw, 7rem) 0; }
.section-soft { background: var(--bg-soft); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.section-sub { color: var(--muted); max-width: 55ch; }
.kicker {
  color: var(--accent); font-weight: 700; font-size: 0.8rem;
  letter-spacing: 0.28em; text-transform: uppercase; margin-bottom: 0.7rem;
}
.page-head { padding: calc(var(--header-h) + clamp(2rem, 6vw, 4rem)) 0 clamp(2rem, 5vw, 3rem); }
.page-head .lead { color: var(--muted); font-size: clamp(1rem, 2.4vw, 1.2rem); max-width: 65ch; margin-top: 1rem; }
.breadcrumbs { font-size: 0.85rem; color: var(--muted); margin-bottom: 1.2rem; letter-spacing: 0.05em; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span[aria-hidden] { margin: 0 0.4rem; opacity: 0.6; }

.spread { padding: clamp(3rem, 8vw, 6rem) 0; border-top: 1px solid var(--border); }
.spread-head { display: grid; gap: 1rem; margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.spread-index { font-size: 0.8rem; letter-spacing: 0.3em; color: var(--accent); font-weight: 700; }
.spread-desc { color: var(--muted); max-width: 62ch; }
.spread-link { font-weight: 700; text-decoration: none; }
.spread-link:hover { text-decoration: underline; }

/* ---------- tiles ---------- */
.grid-tiles {
  display: grid; gap: clamp(0.9rem, 2vw, 1.4rem);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.tile {
  position: relative; display: block; border-radius: 14px; overflow: hidden;
  text-decoration: none; color: var(--text); background: var(--bg-raised);
  aspect-ratio: 3 / 4; isolation: isolate;
  transition: transform 0.35s var(--ease);
}
.tile:hover { transform: translateY(-6px); color: var(--text); }
.tile-media { position: absolute; inset: 0; display: grid; place-items: center; }
.tile-media img { width: 100%; height: 100%; object-fit: cover; }
.ph {
  font-size: clamp(3rem, 8vw, 4.5rem); font-weight: 900; letter-spacing: 0.05em;
  color: rgba(234, 246, 250, 0.85);
  background: var(--gradient); width: 100%; height: 100%;
  display: grid; place-items: center;
}
.tile::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(12, 8, 7, 0.92) 5%, rgba(12, 8, 7, 0.15) 55%, transparent);
}
.tile-meta { position: absolute; inset: auto 0 0; z-index: 1; padding: 1.2rem; }
.tile-name { display: block; font-weight: 800; font-size: 1.15rem; }
.tile-cta {
  display: inline-flex; gap: 0.4rem; margin-top: 0.35rem;
  color: var(--accent); font-size: 0.85rem; font-weight: 700;
  opacity: 0; transform: translateY(6px); transition: all 0.3s var(--ease);
}
.tile:hover .tile-cta, .tile:focus-visible .tile-cta { opacity: 1; transform: none; }

/* ---------- overlay de ficha ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 150; display: none;
  background: rgba(10, 8, 7, 0.75); backdrop-filter: blur(6px);
  overflow-y: auto; padding: var(--pad);
}
.overlay.is-open { display: block; }
.overlay-panel {
  width: min(100%, 980px); margin: 3vh auto; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: 18px; overflow: hidden;
  display: grid; animation: rise 0.35s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.overlay-media { min-height: 240px; display: grid; }
.overlay-body { padding: clamp(1.4rem, 4vw, 2.4rem); display: grid; gap: 1.1rem; align-content: start; }
.overlay-close {
  position: absolute; top: calc(var(--pad) + 0.5rem); right: calc(var(--pad) + 0.5rem);
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg-raised); color: var(--text); cursor: pointer;
  display: grid; place-items: center; z-index: 2;
}
.overlay-close:hover { border-color: var(--accent); color: var(--accent); }
.overlay-body .lead { color: var(--muted); }
.overlay-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* ---------- ficha de producto (página) ---------- */
.detail-layout { display: grid; gap: clamp(1.5rem, 4vw, 3rem); }
.detail-media { border-radius: 18px; overflow: hidden; min-height: 320px; display: grid; border: 1px solid var(--border); }
.detail-info h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
.detail-info .lead { color: var(--muted); margin: 1rem 0 1.6rem; }

.specs { width: 100%; border-collapse: collapse; margin-bottom: 1.8rem; }
.specs caption { text-align: left; color: var(--accent); font-size: 0.78rem; letter-spacing: 0.25em; text-transform: uppercase; font-weight: 700; padding-bottom: 0.7rem; }
.specs th, .specs td { text-align: left; padding: 0.85rem 0.4rem; border-bottom: 1px solid var(--border); }
.specs th { color: var(--muted); font-weight: 600; width: 45%; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* ---------- destacados (strip) ---------- */
.strip { display: grid; gap: 1rem; grid-auto-flow: column; grid-auto-columns: minmax(240px, 320px); overflow-x: auto; padding-bottom: 0.8rem; scroll-snap-type: x mandatory; }
.strip .tile { scroll-snap-align: start; aspect-ratio: 4 / 5; }

/* ---------- nosotros / contacto ---------- */
.prose { display: grid; gap: 1.2rem; max-width: 70ch; }
.prose p { color: var(--muted); font-size: clamp(1rem, 2.2vw, 1.15rem); }
.value-grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: 2.5rem; }
.value-card { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 14px; padding: 1.6rem; }
.value-card h3 { color: var(--accent); margin-bottom: 0.5rem; }
.value-card p { color: var(--muted); font-size: 0.97rem; }

.contact-layout { display: grid; gap: 2.5rem; }
.contact-list { display: grid; gap: 1.1rem; margin-top: 1.5rem; }
.contact-list li { display: flex; gap: 0.8rem; align-items: flex-start; color: var(--muted); }
.contact-list svg { flex: none; margin-top: 0.25rem; color: var(--accent); }
.contact-list a { color: var(--text); text-decoration: none; font-weight: 600; }
.contact-list a:hover { color: var(--accent); }
.mapa { margin-top: 2rem; }
.mapa iframe { width: 100%; height: 320px; border: 1px solid var(--border); border-radius: 14px; filter: grayscale(0.4) contrast(1.05); }

.form-grid { display: grid; gap: 1.1rem; }
.field label { display: block; font-weight: 700; margin-bottom: 0.4rem; font-size: 0.92rem; }
.field input, .field textarea {
  width: 100%; padding: 0.85rem 1rem; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg-raised); color: var(--text);
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field input::placeholder, .field textarea::placeholder { color: #6f7d8a; }
.form-note { font-size: 0.85rem; color: var(--muted); }
.card-pad { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 16px; padding: clamp(1.4rem, 4vw, 2.2rem); }

/* ---------- footer ---------- */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); margin-top: auto; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.footer-grid { display: grid; gap: 2rem; padding: clamp(2.5rem, 6vw, 4rem) 0 2rem; }
.footer-brand { font-size: 1.3rem; font-weight: 900; margin-bottom: 0.6rem; }
.footer-desc { color: var(--muted); font-size: 0.95rem; }
.footer-title { color: var(--accent); font-size: 0.78rem; letter-spacing: 0.25em; text-transform: uppercase; margin-bottom: 0.9rem; font-weight: 700; }
.footer-list { display: grid; gap: 0.6rem; font-size: 0.95rem; }
.footer-contact li { display: flex; gap: 0.6rem; align-items: flex-start; }
.footer-contact svg { flex: none; margin-top: 0.25rem; color: var(--accent); }
.socials { display: flex; gap: 0.6rem; margin-top: 1.1rem; }
.socials a {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid var(--border); border-radius: 50%;
  font-size: 0.75rem; font-weight: 800; text-transform: uppercase;
}
.socials a:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); text-decoration: none; }
.footer-bottom { border-top: 1px solid var(--border); padding: 1.1rem 0; font-size: 0.85rem; color: var(--muted); }

/* ---------- whatsapp flotante ---------- */
.float-wa {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 140;
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--whatsapp); color: var(--whatsapp-text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s var(--ease);
}
.float-wa:hover { transform: scale(1.08); color: var(--whatsapp-text); }

/* ---------- utilidades ---------- */
main { min-height: 70vh; }
.mt-2 { margin-top: 2rem; }
.text-center { text-align: center; }
body.no-scroll { overflow: hidden; }

/* ---------- escritorio ---------- */
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav { display: block; }
  .site-nav ul { flex-direction: row; align-items: center; gap: 1.6rem; }
  .site-nav a { font-size: 0.95rem; font-weight: 600; }
  .site-nav .nav-cta a { font-size: 0.88rem; }

  .spread-head { grid-template-columns: auto 1fr auto; align-items: end; }
  .grid-tiles { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .overlay-panel { grid-template-columns: 1.1fr 1fr; }
  .overlay-media { min-height: 100%; }
  .detail-layout { grid-template-columns: 1.15fr 1fr; align-items: start; }
  .contact-layout { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 2fr 1fr 1.4fr; }
}
