/* =========================================================
   OPC — Obturadores y Tapones para Cañerías
   Sistema de diseño: estética técnica / plano de fábrica
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Color */
  --ink: #15191d;
  --ink-soft: #3a424b;
  --steel: #5c6570;
  --paper: #fbfbfa;
  --panel: #eef0ee;
  --line: #d7dad6;
  --accent: #d81f26;      /* rojo de faena */
  --blue: #1c4258;        /* azul plano/plano técnico */

  /* Type */
  --f-head: 'Barlow Condensed', sans-serif;
  --f-body: 'Inter', sans-serif;

  /* Layout */
  --max: 1180px;
  --gap: clamp(1.25rem, 3vw, 2.5rem);
  --radius: 10px;

  /* Sombras */
  --shadow-sm: 0 1px 2px rgba(21, 25, 29, 0.05);
  --shadow-md: 0 16px 32px -16px rgba(21, 25, 29, 0.22);
  --shadow-lg: 0 24px 48px -24px rgba(21, 25, 29, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--f-head);
  font-weight: 600;
  line-height: 1.05;
  margin: 0 0 0.5em;
  color: var(--ink);
  letter-spacing: 0.01em;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); font-weight: 700; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }

p { margin: 0 0 1em; max-width: 62ch; color: var(--ink-soft); }
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 58ch; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--f-head);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin-bottom: 0.9em;
}
.tag::before {
  content: '';
  width: 22px;
  height: 2px;
  background: var(--accent);
  display: inline-block;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 251, 250, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.25s ease;
}
.site-header.is-scrolled {
  box-shadow: 0 4px 20px rgba(21, 25, 29, 0.08);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--gap);
  max-width: var(--max);
  margin: 0 auto;
}
.brand {
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.brand span {
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 0.62rem;
  color: var(--steel);
  letter-spacing: 0.04em;
}
.nav-links {
  display: flex;
  gap: clamp(1rem, 2vw, 2rem);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  text-decoration: none;
  font-family: var(--f-head);
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink-soft);
  padding: 0.3rem 0.1rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
  border-color: var(--accent);
}
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 42px;
  height: 38px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--ink);
  display: block;
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav-links.open { max-height: 420px; }
  .nav-links li { border-top: 1px solid var(--line); }
  .nav-links a { display: block; padding: 1rem var(--gap); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem);
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: '';
  position: absolute;
  inset: -15% -10% auto -10%;
  height: 520px;
  background:
    radial-gradient(55% 55% at 25% 20%, rgba(216, 31, 38, 0.12), transparent 70%),
    radial-gradient(45% 45% at 85% 5%, rgba(28, 66, 88, 0.10), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero.hero-narrow .wrap { grid-template-columns: 1fr; }
.hero-diagram { width: 100%; height: auto; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.6rem;
}

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-diagram { order: -1; max-width: 320px; margin: 0 auto 1rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-family: var(--f-head);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 22px -10px rgba(216, 31, 38, 0.6); }
.btn-primary:hover { background: #a8161c; transform: translateY(-2px); box-shadow: 0 14px 26px -10px rgba(216, 31, 38, 0.65); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

/* ---------- Sections ---------- */
section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-alt { background: var(--panel); }
.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
@media (max-width: 860px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.bullet-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }
.bullet-list li {
  display: flex;
  gap: 0.8rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.98rem;
}
.bullet-list li::before {
  content: '';
  min-width: 8px;
  height: 8px;
  margin-top: 0.4em;
  background: var(--accent);
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.section-alt .card { background: var(--paper); }

/* ---------- Placeholder de foto (marco técnico) ---------- */
.photo-frame {
  position: relative;
  border: 1px dashed var(--steel);
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(45deg, var(--panel), var(--panel) 10px, #e4e6e3 10px, #e4e6e3 20px);
  color: var(--steel);
  font-family: var(--f-head);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-align: center;
  padding: 1rem;
}
.photo-frame::before,
.photo-frame::after,
.photo-frame > span::before,
.photo-frame > span::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--ink-soft);
}
.photo-frame::before { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.photo-frame::after { top: 8px; right: 8px; border-left: none; border-bottom: none; }
.photo-frame > span::before { bottom: 8px; left: 8px; border-right: none; border-top: none; }
.photo-frame > span::after { bottom: 8px; right: 8px; border-left: none; border-top: none; }

/* ---------- Tabla técnica / specs ---------- */
.spec-table { width: 100%; border-collapse: collapse; font-size: 0.96rem; }
.spec-table caption { text-align: left; font-family: var(--f-head); font-weight: 600; margin-bottom: 0.8rem; }
.spec-table th, .spec-table td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}
.spec-table thead th {
  font-family: var(--f-head);
  font-weight: 600;
  color: var(--steel);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  border-bottom: 2px solid var(--ink);
}
.spec-table tbody tr:hover { background: var(--panel); }
.spec-table td, .spec-table th { white-space: nowrap; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll .spec-table { min-width: 720px; }

/* ---------- Lista de pasos numerados ---------- */
.steps-list { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 1.1rem; }
.steps-list li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}
.steps-list li::before {
  counter-increment: step;
  content: counter(step);
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.steps-list p { margin: 0; font-size: 0.98rem; }

/* ---------- Sub-nav interna (obturadores mecánicos) ---------- */
.subnav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.subnav a {
  text-decoration: none;
  font-family: var(--f-head);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
}
.subnav a:hover { border-color: var(--accent); color: var(--accent); }

.linea-block { padding-top: clamp(2.5rem, 5vw, 4rem); scroll-margin-top: 90px; }
.linea-block + .linea-block { border-top: 1px solid var(--line); }

.diam-badge {
  display: inline-block;
  font-family: var(--f-head);
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--blue);
  color: #fff;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

/* ---------- Aviso "contenido pendiente" ---------- */
.pending {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--panel);
  padding: 1.4rem 1.6rem;
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-size: 0.96rem;
}
.pending strong { color: var(--ink); }

/* ---------- Contacto ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}
@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr 1fr; }
}
.contact-item h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.contact-item p { font-size: 0.95rem; margin: 0; }
.contact-item a { text-decoration: none; color: var(--accent); font-weight: 600; }

/* ---------- Formulario de contacto (WhatsApp) ---------- */
.contact-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--gap);
  align-items: start;
}
@media (max-width: 860px) {
  .contact-layout { grid-template-columns: 1fr; }
}

.contact-form {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.2rem);
  box-shadow: var(--shadow-lg);
}
.contact-form h3 { font-size: 1.3rem; margin-bottom: 0.3rem; }
.contact-form > p { font-size: 0.92rem; margin-bottom: 1.3rem; }

.form-row { margin-bottom: 1.1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.form-row label {
  font-family: var(--f-head);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.form-row label::after {
  content: ' *';
  color: var(--accent);
}
.form-row input,
.form-row textarea {
  font-family: var(--f-body);
  font-size: 0.98rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 3px);
  background: #fff;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(216, 31, 38, 0.15);
}
.form-row textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 0.82rem; color: var(--steel); margin: -0.4rem 0 1.1rem; }

.btn-block { width: 100%; justify-content: center; margin-top: 0.3rem; }
.btn-block svg { width: 18px; height: 18px; flex-shrink: 0; }

.form-status {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: #1f9d55;
  font-weight: 600;
  display: none;
}
.form-status.is-visible { display: block; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #cfd3d6;
  padding: clamp(2.5rem, 5vw, 3.5rem) 0 1.5rem;
}
.site-footer .wrap {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: var(--gap);
}
@media (max-width: 860px) {
  .site-footer .wrap { grid-template-columns: 1fr; }
}
.site-footer h4 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.9rem;
}
.site-footer p, .site-footer a { color: #a9afb4; font-size: 0.92rem; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  max-width: var(--max);
  margin: 2rem auto 0;
  padding: 1.2rem var(--gap) 0;
  border-top: 1px solid #2a3038;
  font-size: 0.82rem;
  color: #767c81;
}

/* ---------- WhatsApp flotante ---------- */
.wa-float {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: #1f9d55;
  color: #fff;
  text-decoration: none;
  font-family: var(--f-head);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
}
.wa-float svg { width: 20px; height: 20px; flex-shrink: 0; }
@media (max-width: 860px) {
  .wa-float span { display: none; }
  .wa-float { padding: 0.85rem; }
}

/* ---------- Utilidades ---------- */
.mt-lg { margin-top: clamp(2rem, 4vw, 3rem); }
.center { text-align: center; margin-left: auto; margin-right: auto; }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Focus visibility */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Logo ---------- */
.brand img { width: 40px; height: 40px; margin-right: 0.2rem; }
.footer-logo { width: 56px; height: 56px; margin-bottom: 0.9rem; }
.about-logo { width: 100%; max-width: 260px; height: auto; margin-top: 1.5rem; }

/* ---------- Fotos ---------- */
.photo {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.photo img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.photo--tall img { aspect-ratio: 3 / 4; }
.photo--fit img { object-fit: contain; }
.photo--natural img { aspect-ratio: auto; }
.photo video { display: block; width: 100%; height: auto; }
.photo figcaption {
  font-family: var(--f-head);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-soft);
  padding: 0.65rem 0.9rem;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
a.photo { display: block; transition: border-color 0.15s ease; }
a.photo:hover { border-color: var(--accent); }

.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.gallery--3 { grid-template-columns: repeat(3, 1fr); }
.gallery .photo img { aspect-ratio: 1 / 1; }
@media (max-width: 860px) {
  .gallery, .gallery--3 { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Carrusel de fotos (mobile) ---------- */
@media (max-width: 860px) {
  .gallery,
  .gallery--3,
  .photo-row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0.9rem;
    padding-bottom: 0.4rem;
    scrollbar-width: none;
  }
  .gallery::-webkit-scrollbar,
  .gallery--3::-webkit-scrollbar,
  .photo-row::-webkit-scrollbar { display: none; }
  .gallery > *,
  .gallery--3 > *,
  .photo-row > * {
    flex: 0 0 82%;
    scroll-snap-align: start;
  }
}

.hero-media { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.hero-media img { width: 100%; height: auto; }
@media (max-width: 860px) {
  .hero-media { order: -1; }
}

.card:has(> .card-media) { overflow: hidden; }
.card-media {
  display: block;
  width: calc(100% + 3.6rem);
  max-width: none;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin: -1.8rem -1.8rem 1.4rem;
  border-bottom: 1px solid var(--line);
  transition: transform 0.4s ease;
}
.card:hover .card-media { transform: scale(1.05); }
.mb-gap { margin-bottom: var(--gap); }

/* ---------- Fichas técnicas y manuales ---------- */
.docs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 860px) {
  .docs { grid-template-columns: 1fr; }
}
.doc-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  text-decoration: none;
}
.doc-card { transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.doc-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.doc-card img {
  width: 72px;
  height: 96px;
  flex-shrink: 0;
  object-fit: cover;
  object-position: top;
  background: #fff;
  border: 1px solid var(--line);
}
.doc-card strong { display: block; font-family: var(--f-head); font-size: 1.15rem; color: var(--ink); }
.doc-card span { font-size: 0.9rem; font-weight: 600; color: var(--accent); }
