/* =============================================================
   1. Tokens — El Perno: acero galvanizado, tinta, naranja de seguridad, azul de plano
   Layout: catálogo en grilla con la cotización fija a un costado; en teléfono, la cotización va abajo
   ============================================================= */
:root {
  --steel: #e2e6e8;
  --steel-deep: #c9d0d4;
  --white: #ffffff;
  --ink: #1b1f22;
  --iron: #4a545b;
  --safety: #d9531b;
  --safety-soft: #fde6da;
  --blueprint: #1f4e8c;
  --line: rgba(27, 31, 34, .14);
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --sans: "Barlow", "Segoe UI", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

/* 2. Reset & base */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { font-family: var(--sans); font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--steel); -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
h1, h2, h3 { text-wrap: balance; line-height: 1; }
p { text-wrap: pretty; }
ul { list-style: none; padding: 0; }
:focus-visible { outline: 3px solid var(--blueprint); outline-offset: 2px; }

/* 3. Utilities */
.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 1rem; padding: .6rem 1rem; background: var(--ink); color: #fff; z-index: 99; }
.skip-link:focus { top: 1rem; }
.eyebrow { font-family: var(--mono); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--blueprint); }
.muted { color: var(--iron); }
.note { font-size: .8rem; color: var(--iron); }

/* 4. Components */
.demo-bar { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; justify-content: center; padding: .55rem max(16px, env(safe-area-inset-right, 0px)) .55rem max(16px, env(safe-area-inset-left, 0px)); background: var(--ink); color: var(--steel); font-size: .82rem; text-align: center; }
.demo-bar a { color: #ffb48f; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .75rem 1.3rem; border-radius: 6px; font-weight: 700; border: 0; cursor: pointer; transition: background .2s, transform .2s var(--ease-out); }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--safety); color: #fff; }
.btn-primary:hover { background: #b9430f; }
.btn-line { border: 2px solid var(--ink); }
.btn.is-off { opacity: .45; pointer-events: none; }
.link { background: none; border: 0; color: var(--blueprint); font-weight: 700; text-decoration: underline; cursor: pointer; min-height: 44px; }

.nav { position: sticky; top: 0; z-index: 20; background: var(--white); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 62px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--display); font-weight: 800; font-size: 1.7rem; text-transform: uppercase; letter-spacing: .02em; }
.bolt { width: 22px; height: 22px; border-radius: 50%; background: var(--safety); box-shadow: inset 0 0 0 5px var(--white), inset 0 0 0 7px var(--safety); flex-shrink: 0; }
.nav nav { display: flex; gap: 1.2rem; align-items: center; font-weight: 600; }
.nav nav a:not(.nav-cta) { display: none; }
.nav-cta { display: inline-flex; align-items: center; gap: .5rem; background: var(--ink); color: #fff; padding: .45rem .85rem; border-radius: 6px; }
.count { min-width: 1.6em; padding: 0 .35em; border-radius: 999px; background: var(--safety); text-align: center; font-family: var(--mono); font-size: .8rem; }

/* 5. Sections */
.hero { background: var(--white); border-bottom: 1px solid var(--line); padding-block: clamp(2.5rem, 6vw, 4.5rem);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px; background-position: -1px -1px; }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
.hero-grid > * { min-width: 0; }
.hero h1 { font-family: var(--display); font-weight: 800; font-size: clamp(2.8rem, 7.5vw, 5.6rem); text-transform: uppercase; margin-block: .8rem 1rem; max-width: 14ch; }
.lead { font-size: clamp(1rem, 1.5vw, 1.12rem); color: var(--iron); max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.5rem; }
.hero-card { background: var(--ink); color: var(--steel); border-radius: 10px; padding: 1.4rem; display: grid; gap: 1rem; }
.card-title { font-family: var(--display); font-weight: 800; font-size: 1.5rem; text-transform: uppercase; color: #fff; }
.hero-card dl { display: grid; gap: .6rem; }
.hero-card dl div { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed rgba(226, 230, 232, .25); padding-bottom: .55rem; }
.hero-card dd { font-family: var(--mono); font-variant-numeric: tabular-nums; color: #fff; }
.card-foot { font-size: .88rem; color: #ffb48f; }

.section { padding-block: clamp(3rem, 7vw, 5rem); }
.section-head { display: grid; gap: .4rem; margin-bottom: 1.4rem; }
.section h2 { font-family: var(--display); font-weight: 800; font-size: clamp(2.2rem, 5vw, 3.4rem); text-transform: uppercase; }

.tools { display: grid; gap: .9rem; }
.search input { width: 100%; min-height: 52px; padding: .8rem 1rem; border-radius: 8px; border: 2px solid var(--steel-deep); background: var(--white); font-size: 1.02rem; }
.search input:focus { outline: none; border-color: var(--blueprint); }
.cats { display: flex; flex-wrap: wrap; gap: .45rem; }
.cat { min-height: 44px; padding: .45rem .9rem; border-radius: 6px; border: 1.5px solid var(--steel-deep); background: var(--white); font-weight: 600; cursor: pointer; }
.cat.is-on { background: var(--blueprint); border-color: var(--blueprint); color: #fff; }
.results { font-family: var(--mono); font-size: .82rem; color: var(--iron); margin-block: 1.2rem .8rem; }

.catalog-layout { display: grid; gap: 1.5rem; align-items: start; }
.catalog-layout > * { min-width: 0; }
.grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.item { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; display: flex; flex-direction: column; gap: .35rem; transition: border-color .2s; }
.item:hover { border-color: var(--blueprint); }
.item-top { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.sku { font-family: var(--mono); font-size: .75rem; color: var(--blueprint); }
.cat-tag { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--iron); }
.item h3 { font-family: var(--display); font-weight: 700; font-size: 1.5rem; text-transform: uppercase; margin-top: .3rem; }
.spec { font-family: var(--mono); font-size: .85rem; color: var(--iron); }
.item-foot { margin-top: auto; padding-top: .8rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.item-price { font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.add { min-height: 44px; padding: .45rem .9rem; border-radius: 6px; border: 2px solid var(--safety); background: var(--white); color: var(--safety); font-weight: 700; cursor: pointer; }
.add:hover, .add.in { background: var(--safety); color: #fff; }

.quote { background: var(--white); border: 2px solid var(--ink); border-radius: 12px; padding: 1.2rem; display: grid; gap: .9rem; }
.quote-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.quote h2 { font-size: 1.9rem; }
.quote-list { display: grid; gap: .6rem; }
.quote-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .6rem; align-items: center; border-bottom: 1px dashed var(--line); padding-bottom: .6rem; }
.q-name { font-weight: 600; font-size: .95rem; }
.q-spec { font-family: var(--mono); font-size: .75rem; color: var(--iron); grid-column: 1; }
.qty { display: inline-flex; align-items: center; gap: .3rem; grid-row: 1 / span 2; grid-column: 2; }
.qty button { width: 36px; height: 36px; border-radius: 6px; border: 1.5px solid var(--steel-deep); background: var(--steel); font-weight: 700; cursor: pointer; }
.qty output { min-width: 2ch; text-align: center; font-family: var(--mono); }
.quote-empty { color: var(--iron); font-size: .92rem; }
.quote-total { display: flex; justify-content: space-between; align-items: baseline; padding: .7rem .8rem; background: var(--safety-soft); border-radius: 8px; }
.quote-total strong { font-family: var(--display); font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.field { display: grid; gap: .3rem; }
.field label { font-size: .8rem; font-weight: 700; color: var(--iron); }
.field input { width: 100%; min-height: 46px; padding: .6rem .8rem; border-radius: 6px; border: 1.5px solid var(--steel-deep); background: var(--steel); }

.band { background: var(--blueprint); color: #fff; }
.delivery { display: grid; gap: 1.5rem; }
.del-item h3 { font-family: var(--display); font-weight: 800; font-size: 1.7rem; text-transform: uppercase; margin-bottom: .4rem; }
.del-item p { color: #dbe5f3; }

.footer { background: var(--ink); color: var(--steel); padding-block: 2.5rem; }
.footer-inner { display: grid; gap: .4rem; font-size: .9rem; }
.footer .bolt { box-shadow: inset 0 0 0 5px var(--ink), inset 0 0 0 7px var(--safety); }
.footer a { color: #ffb48f; text-decoration: underline; text-underline-offset: 3px; }

.demo-bar .back { color: inherit; font-weight: 700; text-decoration: none; padding: .2rem .7rem; border: 1px solid currentColor; border-radius: 999px; margin-right: auto; }

/* 8. Responsive */
@media (min-width: 720px) {
  .nav nav a:not(.nav-cta) { display: inline; }
  .delivery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 7fr 4fr; }
  .catalog-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .quote { position: sticky; top: calc(76px + env(safe-area-inset-top, 0px)); }
}
