:root {
  --ink: #101a20;
  --ink-soft: #4a5b66;
  --ink-faint: #7f909b;
  --line: #e3e9ed;
  --bg: #ffffff;
  --bg-soft: #f5f8f9;
  --accent: #0d7a5f;
  --accent-dark: #095c47;
  --accent-soft: #e6f4ef;
  --sale: #c62828;
  --sale-soft: #fdecec;
  --warn: #a25a00;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 26, 32, .05), 0 8px 24px rgba(16, 26, 32, .06);
  --shadow-lg: 0 2px 4px rgba(16, 26, 32, .06), 0 18px 48px rgba(16, 26, 32, .12);
  --maxw: 1200px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Un `display` propio (p.ej. .btn) tiene la misma prioridad de cascada que la
   regla del navegador para [hidden] y puede ganarle por orden de aparición;
   esto asegura que el atributo hidden siempre oculte el elemento. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
}

a { color: var(--accent-dark); }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.stack > * + * { margin-top: 12px; }
.muted { color: var(--ink-soft); }
.small { font-size: .85rem; }
.tiny { font-size: .78rem; }
.center { text-align: center; }

/* ---------------------------------------------------------------- cabecera */
.topbar {
  background: var(--ink);
  color: #cfe3dc;
  font-size: .8rem;
  padding: 7px 0;
}
.topbar .wrap { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.topbar span { display: inline-flex; align-items: center; gap: 6px; }

header.site {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
header.site .wrap {
  display: flex; align-items: center; gap: 22px; height: 70px;
}
.brand {
  font-weight: 700; font-size: 1.28rem; letter-spacing: -.02em;
  color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 9px;
}
.brand .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); }

nav.main { display: flex; gap: 20px; margin-left: 8px; flex: 1; }
nav.main a {
  color: var(--ink-soft); text-decoration: none; font-size: .93rem; font-weight: 500;
  padding: 6px 0; border-bottom: 2px solid transparent;
}
nav.main a:hover, nav.main a[aria-current="page"] { color: var(--accent-dark); border-color: var(--accent); }

.search-mini {
  display: flex; align-items: center; gap: 8px; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; min-width: 230px;
}
.search-mini input { border: none; background: none; outline: none; width: 100%; font-size: .9rem; font-family: inherit; }

.cart-btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; border: none; border-radius: 999px;
  padding: 9px 18px; font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none;
}
.cart-btn:hover { background: var(--accent-dark); }
.cart-count {
  background: #fff; color: var(--accent-dark); border-radius: 999px;
  min-width: 20px; height: 20px; font-size: .74rem; display: grid; place-items: center; padding: 0 5px;
}

/* ------------------------------------------------------------------- hero */
.hero {
  background: linear-gradient(160deg, #f0f7f4 0%, #ffffff 60%);
  border-bottom: 1px solid var(--line);
  padding: 60px 0 54px;
}
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.1; letter-spacing: -.03em; margin: 0 0 16px; max-width: 16ch; }
.hero p.lead { font-size: 1.1rem; color: var(--ink-soft); max-width: 56ch; margin: 0 0 26px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 44px; align-items: center; }

.badges { display: flex; gap: 10px; flex-wrap: wrap; }
.badge-pill {
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font-size: .82rem; font-weight: 600; color: var(--ink-soft);
  display: inline-flex; gap: 7px; align-items: center;
}

.how {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.how h3 { margin: 0 0 14px; font-size: 1rem; }
.how ol { margin: 0; padding-left: 0; list-style: none; counter-reset: s; }
.how li {
  counter-increment: s; position: relative; padding-left: 38px; margin-bottom: 14px;
  font-size: .9rem; color: var(--ink-soft);
}
.how li::before {
  content: counter(s); position: absolute; left: 0; top: 1px;
  width: 25px; height: 25px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent-dark); font-weight: 700; font-size: .8rem; display: grid; place-items: center;
}
.how li b { color: var(--ink); display: block; font-weight: 600; }

/* --------------------------------------------------------------- secciones */
section.block { padding: 54px 0; }
section.block.alt { background: var(--bg-soft); border-block: 1px solid var(--line); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 1.6rem; letter-spacing: -.02em; }
.section-head p { margin: 6px 0 0; color: var(--ink-soft); font-size: .95rem; }
.link-more { font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap; }

/* ---------------------------------------------------------------- productos */
.grid-products {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
  text-decoration: none; color: inherit; position: relative;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card .thumb { aspect-ratio: 1; background: var(--bg-soft); overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card .cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); font-weight: 600; }
.card h3 { margin: 0; font-size: .95rem; font-weight: 600; line-height: 1.35; }
.card .prices { margin-top: auto; padding-top: 6px; }

.price-now { font-size: 1.32rem; font-weight: 700; letter-spacing: -.02em; }
.price-now.sale { color: var(--sale); }
.price-ref { font-size: .85rem; color: var(--ink-faint); text-decoration: line-through; margin-left: 8px; }
.price-vat { font-size: .72rem; color: var(--ink-faint); }

.tag-sale {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: var(--sale); color: #fff; font-size: .78rem; font-weight: 700;
  padding: 4px 9px; border-radius: 7px;
}
.tag-multi {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: rgba(255, 255, 255, .95); border: 1px solid var(--line);
  color: var(--accent-dark); font-size: .7rem; font-weight: 700;
  padding: 4px 8px; border-radius: 7px;
}
.stock-out { position: absolute; inset: 0; background: rgba(255,255,255,.7); display: grid; place-items: center;
  font-weight: 700; color: var(--ink-soft); z-index: 3; }

/* ------------------------------------------------------------------ nichos */
.grid-niches { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.niche {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; text-decoration: none; color: inherit; display: block;
  transition: border-color .15s ease, transform .15s ease;
}
.niche:hover { border-color: var(--accent); transform: translateY(-2px); }
.niche .icon { font-size: 1.8rem; }
.niche h3 { margin: 10px 0 4px; font-size: 1.02rem; }
.niche p { margin: 0; font-size: .86rem; color: var(--ink-soft); }
.niche .meta { margin-top: 12px; font-size: .76rem; color: var(--ink-faint); display: flex; gap: 12px; }

/* ---------------------------------------------------------------- catálogo */
.catalog { display: grid; grid-template-columns: 240px 1fr; gap: 34px; align-items: start; padding: 34px 0 60px; }
.filters { position: sticky; top: 92px; }
.filters h4 { margin: 0 0 10px; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.filters .group + .group { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.filters label { display: flex; align-items: center; gap: 9px; font-size: .9rem; padding: 5px 0; cursor: pointer; color: var(--ink-soft); }
.filters label:hover { color: var(--ink); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

select, input[type=text], input[type=email], input[type=tel], input[type=number], textarea {
  font-family: inherit; font-size: .93rem; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); width: 100%;
}
select:focus, input:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
select { width: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--accent); color: #fff; border: none; border-radius: 11px;
  padding: 13px 22px; font-size: .96rem; font-weight: 600; cursor: pointer;
  font-family: inherit; text-decoration: none; transition: background .15s;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { background: #b9c6cc; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--bg-soft); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 15px; font-size: .87rem; border-radius: 9px; }

/* -------------------------------------------------------------- producto */
.product { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; padding: 34px 0 60px; align-items: start; }
.gallery .main { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-soft); }
.gallery .thumbs { display: flex; gap: 10px; margin-top: 12px; }
.gallery .thumbs img { width: 68px; height: 68px; object-fit: cover; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.gallery .thumbs img.on { border-color: var(--accent); border-width: 2px; }

.pd h1 { font-size: 1.85rem; letter-spacing: -.02em; margin: 6px 0 10px; line-height: 1.2; }
.price-box { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 20px 0; }
.price-box .row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.price-box .price-now { font-size: 2.1rem; }
.omnibus {
  margin-top: 12px; padding: 11px 13px; background: #fff;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 8px; font-size: .82rem; color: var(--ink-soft);
}
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.qty button { border: none; background: #fff; width: 42px; height: 46px; font-size: 1.15rem; cursor: pointer; color: var(--ink-soft); }
.qty button:hover { background: var(--bg-soft); }
.qty input { border: none; width: 52px; text-align: center; height: 46px; font-size: 1rem; }

.facts { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 11px; }
.facts li { display: flex; gap: 11px; font-size: .89rem; color: var(--ink-soft); align-items: start; }
.facts li b { color: var(--ink); font-weight: 600; }

.sparkline { width: 100%; height: 56px; }

/* ------------------------------------------------------------------ carrito */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 34px; padding: 34px 0 60px; align-items: start; }
.line { display: grid; grid-template-columns: 82px 1fr auto; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: center; }
.line img { width: 82px; height: 82px; object-fit: cover; border-radius: 10px; background: var(--bg-soft); }
.summary { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: sticky; top: 92px; }
.summary .row { display: flex; justify-content: space-between; padding: 7px 0; font-size: .94rem; }
.summary .row.total { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 14px; font-size: 1.2rem; font-weight: 700; }

/* ---------------------------------------------------------------- checkout */
.checkout { display: grid; grid-template-columns: 1fr 360px; gap: 34px; padding: 34px 0 60px; align-items: start; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 0 0 22px; }
legend { font-weight: 700; padding: 0 8px; font-size: 1rem; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.pay-option {
  display: flex; gap: 13px; align-items: center; border: 1px solid var(--line);
  border-radius: 11px; padding: 15px; cursor: pointer; margin-bottom: 10px; background: #fff;
}
.pay-option:hover { border-color: var(--accent); }
.pay-option.on { border-color: var(--accent); background: var(--accent-soft); }
.pay-option .t { font-weight: 600; font-size: .94rem; }
.pay-option .d { font-size: .8rem; color: var(--ink-soft); }
.pay-kind { margin-left: auto; font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; padding: 3px 8px; border-radius: 6px; background: var(--bg-soft); color: var(--ink-faint); }
.pay-kind.crypto { background: #fff4e0; color: #8a5a00; }

.consent { display: flex; gap: 10px; font-size: .85rem; color: var(--ink-soft); align-items: start; margin-bottom: 14px; }
.consent input { margin-top: 3px; }

.alert { padding: 13px 15px; border-radius: 10px; font-size: .9rem; margin-bottom: 16px; }
.alert.err { background: var(--sale-soft); color: #8c1d1d; border: 1px solid #f3c9c9; }
.alert.ok { background: var(--accent-soft); color: var(--accent-dark); border: 1px solid #bde3d6; }
.alert.warn { background: #fff6e5; color: var(--warn); border: 1px solid #f2ddb5; }

/* --------------------------------------------------------------- pie / legal */
footer.site { background: var(--ink); color: #a9bcc4; padding: 48px 0 30px; margin-top: 40px; font-size: .88rem; }
footer.site a { color: #d3e5df; text-decoration: none; }
footer.site a:hover { text-decoration: underline; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 34px; }
.foot-grid h4 { color: #fff; font-size: .88rem; margin: 0 0 12px; text-transform: uppercase; letter-spacing: .05em; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.foot-legal { border-top: 1px solid #263840; margin-top: 34px; padding-top: 20px; font-size: .8rem; color: #7d939c; }

.legal-doc { max-width: 780px; padding: 40px 0 60px; }
.legal-doc h1 { font-size: 1.9rem; letter-spacing: -.02em; }
.legal-doc h2 { font-size: 1.15rem; margin-top: 34px; }
.legal-doc p, .legal-doc li { color: var(--ink-soft); font-size: .95rem; }
.legal-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 30px; }
.legal-nav a { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: .86rem; text-decoration: none; color: var(--ink-soft); }
.legal-nav a.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.cookie-bar {
  position: fixed; inset: auto 16px 16px; z-index: 90; max-width: 460px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 20px;
}
.cookie-bar h4 { margin: 0 0 8px; font-size: 1rem; }
.cookie-bar p { margin: 0 0 14px; font-size: .84rem; color: var(--ink-soft); }
.cookie-bar .acts { display: flex; gap: 10px; }

.empty { text-align: center; padding: 70px 20px; color: var(--ink-soft); }
.empty .big { font-size: 3rem; margin-bottom: 12px; }
.skeleton { background: linear-gradient(90deg, #eef2f4 25%, #f7fafb 50%, #eef2f4 75%);
  background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: var(--radius); }
@keyframes sk { to { background-position: -200% 0; } }

@media (max-width: 940px) {
  .hero-grid, .product, .catalog, .cart-layout, .checkout, .foot-grid { grid-template-columns: 1fr; }
  .filters, .summary { position: static; }
  nav.main { display: none; }
  .search-mini { min-width: 0; flex: 1; }
}
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  header.site .wrap { gap: 12px; }
  .brand span:not(.dot) { display: none; }
}
