/* mktn.es · Header del sitio (G12a). Pieza compartida: _partials/nav-v2.html + assets/js/header.js
   Tono por página con <body data-header="dark|cream"> (por defecto: neutro esmerilado).
   Transparente arriba solo con JS y solo en tonos dark/cream; con scroll de más de 8 px
   o con un panel abierto pasa a neutro esmerilado. Sin JS: siempre neutro.                */
.site-header {
  --hbg: rgba(244,243,239,.88); --hfx: blur(14px) saturate(1.1); --hln: rgba(22,22,22,.14);
  --htx: #161616; --hsc: #4A4945; --cbg: #161616; --ctx: #F4F3EF; --hov: rgba(22,22,22,.06);
  --cap: #E9E7E1; --caph: #DDDBD3; --capc: #F4F3EF; --capct: #161616;
  --hpx: var(--gut, 64px);
  position: fixed; top: 0; left: 0; right: 0; z-index: 40; height: 56px; box-sizing: border-box;
  background: var(--hbg); border-bottom: 1px solid var(--hln); color: var(--htx);
  font-family: var(--font, 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
  font-size: 15px; line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .site-header { -webkit-backdrop-filter: var(--hfx); backdrop-filter: var(--hfx); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header { background: #F4F3EF; }
}
html.js body[data-header="dark"] .site-header:not(.is-scrolled):not(.is-open):not(.is-menu-open) {
  --hbg: transparent; --hfx: none; --hln: rgba(244,243,239,.22); --htx: #F4F3EF; --hsc: #C9C7C0;
  --cbg: #F4F3EF; --ctx: #161616; --hov: rgba(244,243,239,.1);
  --cap: rgba(244,243,239,.16); --caph: rgba(244,243,239,.28); --capc: #F4F3EF; --capct: #161616;
}
html.js body[data-header="cream"] .site-header:not(.is-scrolled):not(.is-open):not(.is-menu-open) {
  --hbg: transparent; --hfx: none; --hln: rgba(22,22,22,.18); --htx: #161616; --hsc: #4A4945;
  --cbg: #161616; --ctx: #F8E5AB; --hov: rgba(22,22,22,.06);
  --cap: #E9E7E1; --caph: #DDDBD3; --capc: #F4F3EF; --capct: #161616;
}
.site-header * { box-sizing: border-box; }
.site-header a, .site-header summary, .site-header button { -webkit-tap-highlight-color: transparent; }
.site-header ul { list-style: none; margin: 0; padding: 0; }
.site-header :where(a) { color: inherit; text-decoration: none; }

.sh-in { height: 55px; padding: 0 var(--hpx); display: flex; align-items: center; gap: 8px; max-width: none; }
.sh-logo { margin-right: auto; display: flex; align-items: center; min-height: 44px; font-size: 22px; line-height: 1; font-weight: 700; letter-spacing: -.06em; color: var(--htx); }
.sh-logo:focus-visible, .sh-cta:focus-visible, .sh-burger:focus-visible, .sh-nav a:focus-visible, .sh-nav summary:focus-visible { outline: 2px solid var(--htx); outline-offset: 2px; }
.sh-logo:focus-visible { border-radius: 2px; }

.sh-cta { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; background: var(--cbg); border: 2px solid var(--cbg); color: var(--ctx); border-radius: 22px; font-size: 15px; font-weight: 600; white-space: nowrap; transition: background-color .15s ease, color .15s ease; }
.sh-cta:focus-visible { outline-offset: 3px; }

.sh-burger { width: 44px; height: 44px; padding: 0; display: flex; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--hln); border-radius: 22px; color: var(--htx); cursor: pointer; }
.sh-burger[hidden] { display: none; }
.sh-i-close { display: none; }
.sh-burger[aria-expanded="true"] .sh-i-open { display: none; }
.sh-burger[aria-expanded="true"] .sh-i-close { display: block; }

.sh-nav a, .sh-nav summary { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 15px; line-height: 1; color: var(--htx); cursor: pointer; list-style: none; }
.sh-nav summary::-webkit-details-marker { display: none; }
.sh-chev { flex: none; transition: transform .15s ease; }
.sh-more details[open] .sh-chev { transform: rotate(180deg); }
.sh-sec a[aria-current="page"], .sh-sec a[aria-current="true"], .sh-more summary[data-active] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.sh-card a[aria-current="page"] .sh-t, .sh-card a[aria-current="true"] .sh-t { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.sh-panel .sh-t { font-size: 15px; font-weight: 600; color: #161616; line-height: 1.3; }
.sh-panel .sh-d { font-size: 14px; line-height: 1.4; color: #5E5D58; font-weight: 400; }

/* ── Escritorio (1024 px o más) ── */
@media (min-width: 1024px) {
  .sh-in { gap: 24px; }
  .sh-nav { display: flex; align-items: center; gap: 6px; }
  .sh-nav ul { display: flex; align-items: center; gap: 2px; }
  .sh-nav .sh-svc { padding: 3px; background: var(--cap); border-radius: 999px; }
  .sh-svc a { height: 38px; padding: 0 11px; border: 1px solid transparent; border-radius: 999px; font-weight: 600; transition: background-color .15s ease, color .15s ease; }
  .sh-svc a:hover { background: var(--caph); }
  .sh-svc a[aria-current="page"], .sh-svc a[aria-current="true"] { background: var(--capc); border-color: var(--htx); color: var(--capct); text-decoration: none; }
  .sh-sec > li > a, .sh-more summary { height: 44px; padding: 0 9px; border-radius: 999px; font-weight: 500; }
  .sh-more summary { padding: 0 8px 0 10px; }
  .sh-sec > li > a:hover, .sh-more summary:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
  .sh-more details[open] summary { background: var(--cap); text-decoration: none; }
  .sh-more { position: relative; }
  .sh-cta { padding: 0 18px; }
  .sh-cta:hover { background: #1F3A30; border-color: #1F3A30; color: #F4F3EF; }
  .sh-burger { display: none; }
  .sh-panel { position: absolute; top: calc(100% + 8px); right: 0; width: 300px; padding: 6px; background: #F4F3EF; border: 1px solid #D8D6CF; border-radius: 6px; color: #161616; z-index: 2; }
  .sh-panel ul { display: flex; flex-direction: column; align-items: stretch; gap: 2px; }
  .sh-card { position: relative; }
  .sh-card a { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; min-height: 44px; padding: 12px 14px; border-radius: 6px; white-space: normal; }
  .sh-card a:hover { background: #E9E7E1; }
  .sh-card a:focus-visible { outline: 2px solid #161616; outline-offset: -2px; }
}
@media (min-width: 1200px) { .sh-in { gap: 32px; } }

/* ── Móvil y tableta (menos de 1024 px) ── */
@media (max-width: 1023px) {
  html.js .sh-nav { display: none; }
  html.js .site-header.is-menu-open { bottom: 0; height: auto; }
  html.js .site-header.is-menu-open .sh-nav {
    display: flex; flex-direction: column; gap: 24px; position: absolute; top: 55px; left: 0; right: 0; bottom: 0; overflow: auto;
    background: #F4F3EF; color: #161616; padding: 8px var(--hpx) 32px;
  }
  .sh-nav ul { display: flex; }
  .sh-svc { flex-direction: column; }
  .sh-svc a { width: 100%; min-height: 60px; justify-content: space-between; border-bottom: 1px solid #D8D6CF; font-size: 24px; font-weight: 600; letter-spacing: -.02em; color: #161616; }
  .sh-svc a::after { content: ""; flex: none; width: 20px; height: 20px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23161616' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat; }
  .sh-svc a[aria-current="page"], .sh-svc a[aria-current="true"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
  .sh-sec { flex-wrap: wrap; gap: 4px 24px; }
  .sh-sec > li > a { min-height: 44px; font-size: 19px; font-weight: 500; color: #161616; }
  .sh-sec .sh-more { flex: 0 0 100%; margin-top: 12px; padding-top: 16px; border-top: 1px solid #D8D6CF; }
  .sh-more summary { min-height: 0; margin-bottom: 6px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #5E5D58; pointer-events: none; cursor: default; }
  .sh-more .sh-chev { display: none; }
  .sh-panel ul { flex-direction: column; }
  .sh-card a { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 44px; padding: 10px 0; white-space: normal; }
  .sh-panel .sh-t { font-size: 17px; }
  .sh-nav a:focus-visible { outline: 2px solid #161616; outline-offset: -2px; }
  /* Sin JS: el menú queda visible bajo la barra */
  html:not(.js) .site-header { height: auto; }
  html:not(.js) .sh-in { flex-wrap: wrap; height: auto; padding-bottom: 8px; }
  html:not(.js) .sh-nav { order: 3; flex: 0 0 100%; display: flex; flex-direction: column; gap: 12px; }
}
@media (max-width: 760px) { .sh-in { padding: 0 var(--hpx); } }
html.menu-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .site-header, .sh-cta, .sh-chev, .sh-svc a { transition: none; } }
