/* ============================================================
   CDAG Wireframes — Chrome (header/footer/drawer/FAB) styles
   ============================================================ */

/* Mega menu grid */
.wf-megamenu__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}
.wf-megamenu__col h5 {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
  color: var(--ink);
}
.wf-megamenu__list { list-style: none; padding: 0; margin: 0; }
.wf-megamenu__list li { padding: 6px 0; border-bottom: 1px dotted var(--line); }
.wf-megamenu__list a { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; }
.wf-megamenu__list a:hover { color: var(--ink); padding-left: 6px; transition: 120ms; }
.wf-megamenu__list--cols-2 { columns: 2; column-gap: 24px; }
.wf-megamenu__list--cols-3 { columns: 3; column-gap: 24px; }
.wf-megamenu__list--cols-2 li, .wf-megamenu__list--cols-3 li { break-inside: avoid; }
.wf-megamenu__feature { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Drawer */
.wf-drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none;
  transition: 200ms;
  z-index: 90;
}
.wf-drawer-overlay.is-open { opacity: 1; pointer-events: auto; }

.wf-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 320px; max-width: 90vw;
  background: var(--white);
  transform: translateX(100%);
  transition: 240ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.wf-drawer.is-open { transform: translateX(0); }
.wf-drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--ink);
  background: var(--ink); color: var(--white);
}
.wf-drawer__head .t-mono { color: var(--white); }
.wf-drawer__head .wf-icon-btn { color: var(--white); }
.wf-drawer__search { padding: 16px; border-bottom: 1px solid var(--line); }
.wf-drawer__nav { display: flex; flex-direction: column; padding: 8px 0; }
.wf-drawer__item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  font-size: 14px; font-weight: 600;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink);
}
.wf-drawer__item:hover { background: var(--paper-2); }
.wf-drawer__divider { height: 8px; background: var(--paper-2); margin: 8px 0; }

/* Hide mobile-only on desktop and vice-versa */
.wf-mobile-only { display: none; }

@media (max-width: 1023px) {
  .wf-mobile-only { display: inline-flex; }
  .wf-nav { display: none; }
}

/* FAB stack */
.wf-fab-stack {
  position: fixed; right: 24px; bottom: 24px;
  display: flex; flex-direction: column; gap: 12px;
  z-index: 80;
  opacity: 0; pointer-events: none;
  transition: 200ms;
}
.wf-fab-stack.is-visible { opacity: 1; pointer-events: auto; }
.wf-fab-stack .wf-fab--wa { opacity: 1; pointer-events: auto; } /* WhatsApp always visible */
.wf-fab-stack { opacity: 1; pointer-events: auto; } /* show stack always for WhatsApp */
.wf-fab-stack .wf-fab--top { opacity: 0; pointer-events: none; }
.wf-fab-stack.is-visible .wf-fab--top { opacity: 1; pointer-events: auto; }

.wf-fab {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--ink); color: var(--white);
  border: 2px solid var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: 120ms;
}
.wf-fab:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.3); }

/* Pin pulse */
@keyframes pinPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* Annotation panel layout (page level) */
.page-with-annots {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  max-width: 1800px;
  margin: 0 auto;
  padding: 24px;
  align-items: flex-start;
}
.page-with-annots__main {
  border: 1px solid var(--line);
  background: var(--white);
  overflow: hidden;
  position: relative; /* containing block para mega menú y search bar */
}
@media (max-width: 1100px) {
  .page-with-annots { grid-template-columns: 1fr; }
  .annot-panel { position: relative; top: 0; max-height: none; }
}

/* Page hero (interior pages) */
.page-hero {
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  padding: 48px 0 56px;
}
.page-hero__eyebrow { font-family: var(--mono); font-size: 12px; color: var(--ink-4); margin-bottom: 8px; letter-spacing: 0.06em; text-transform: uppercase; }
.page-hero h1 { margin: 0; font-family: var(--display); font-size: 48px; line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; }
.page-hero p { font-size: 17px; color: var(--ink-3); max-width: 720px; margin: 16px 0 0; }

/* Section block */
.section { padding: 64px 0; }
.section--tight { padding: 32px 0; }

/* Sticky reading progress bar */
.read-progress {
  position: sticky; top: 0;
  height: 3px;
  background: var(--line-2);
  z-index: 50;
}
.read-progress__bar { height: 100%; background: var(--ink); width: 0%; transition: width 120ms; }

/* Slider chrome */
.slider {
  position: relative;
  overflow: hidden;
}
.slider__viewport { display: flex; transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1); }
.slider__slide { flex: 0 0 100%; }
.slider__btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  background: var(--white); color: var(--ink);
  border: 1px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 5;
}
.slider__btn:hover { background: var(--ink); color: var(--white); }
.slider__btn--prev { left: 24px; }
.slider__btn--next { right: 24px; }
.slider__dots {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 5;
}
.slider__dot { width: 32px; height: 3px; background: rgba(255,255,255,0.4); border: none; cursor: pointer; }
.slider__dot.is-active { background: var(--white); }
.slider__dot--dark { background: rgba(0,0,0,0.2); }
.slider__dot--dark.is-active { background: var(--ink); }

/* Horizontal scroller */
.h-scroll {
  display: flex; gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 12px;
}
.h-scroll > * { scroll-snap-align: start; flex: 0 0 auto; }
.h-scroll::-webkit-scrollbar { height: 4px; }
.h-scroll::-webkit-scrollbar-track { background: var(--line-2); }
.h-scroll::-webkit-scrollbar-thumb { background: var(--ink); }

.h-scroll-wrap { position: relative; }
.h-scroll-wrap__btn {
  position: absolute; top: 35%;
  width: 36px; height: 36px;
  background: var(--white); border: 1px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 3;
}
.h-scroll-wrap__btn--prev { left: -18px; }
.h-scroll-wrap__btn--next { right: -18px; }

/* Sidebar nav */
.side-nav { background: var(--paper-2); border: 1px solid var(--line); padding: 16px; }
.side-nav h4 { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--ink); }
.side-nav ul { list-style: none; padding: 0; margin: 0; }
.side-nav li a { display: block; padding: 8px 0; font-size: 13px; color: var(--ink-3); border-bottom: 1px dotted var(--line); }
.side-nav li a:hover { color: var(--ink); padding-left: 6px; transition: 120ms; }
.side-nav li.is-active a { color: var(--ink); font-weight: 700; border-left: 3px solid var(--ink); padding-left: 10px; }
.side-nav li.is-active { padding-left: 0; }

/* Filter sidebar */
.filter { background: var(--white); border: 1px solid var(--line); padding: 20px; }
.filter h5 { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.filter__group { margin-bottom: 24px; }
.filter__list { display: flex; flex-direction: column; gap: 8px; }

/* Tooltip */
.has-tooltip { position: relative; }
.has-tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--white);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 8px; white-space: nowrap;
  z-index: 90;
}

/* Modal / lightbox shell */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  display: none; align-items: center; justify-content: center;
  z-index: 200;
  padding: 24px;
}
.modal.is-open { display: flex; animation: fadeIn 200ms; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal__close { position: absolute; top: 24px; right: 24px; background: transparent; border: 1px solid var(--white); color: var(--white); width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.modal__nav  { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; background: transparent; border: 1px solid var(--white); color: var(--white); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.modal__nav--prev { left: 24px; }
.modal__nav--next { right: 24px; }

/* Inline desktop mockup vs mobile mockup side by side */
.dual-frame {
  display: flex; gap: 64px; align-items: flex-start;
  padding: 48px;
  background: repeating-linear-gradient(45deg, var(--paper) 0 12px, var(--paper-2) 12px 24px);
  border: 1px solid var(--line);
}
.dual-frame .wf-frame { flex-shrink: 0; }

/* Inline page in sandbox iframe */
.sandbox-iframe {
  width: 100%; border: none; background: var(--white);
  display: block;
}

/* Magazine layout helpers */
.magazine {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
}
.magazine__list { display: flex; flex-direction: column; gap: 0; }

/* Card variants tweaks */
.card-tag-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Logo strip */
.logo-strip {
  display: flex; gap: 24px;
  padding: 24px 0;
  overflow: hidden;
  align-items: center;
}
.logo-strip__item {
  flex: 0 0 140px;
  height: 80px;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 10px; color: var(--ink-4);
  background: var(--white);
}

/* Index/canvas helpers */
.canvas-bg {
  background:
    linear-gradient(var(--line-2) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--line-2) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--paper);
}

.lab-section {
  margin: 96px auto;
  max-width: 1800px;
  padding: 0 32px;
}
.lab-section__head {
  display: flex; align-items: baseline; gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ink);
}
.lab-section__num { font-family: var(--mono); font-size: 13px; color: var(--ink-4); }
.lab-section__title { font-family: var(--display); font-size: 32px; font-weight: 800; margin: 0; }
.lab-section__sub { color: var(--ink-3); font-size: 14px; margin-left: auto; max-width: 480px; }

.spec-card {
  background: var(--white); border: 1px solid var(--line); padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.spec-card__label { font-family: var(--mono); font-size: 11px; color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.04em; }
.spec-card__title { font-family: var(--display); font-size: 16px; font-weight: 700; }
.spec-card__demo { padding: 16px; background: var(--paper-2); border: 1px dashed var(--line); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.spec-card__notes { font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.spec-card__notes code { font-family: var(--mono); font-size: 11px; background: var(--paper-2); padding: 1px 4px; border: 1px solid var(--line); }

/* ---------- Index/menu styles for prototype index ---------- */

.index-card {
  background: var(--white); border: 1px solid var(--line);
  padding: 20px; cursor: pointer; transition: 120ms;
  display: flex; flex-direction: column; gap: 12px;
  text-decoration: none; color: inherit;
}
.index-card:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: 6px 6px 0 var(--ink); }
.index-card__num { font-family: var(--mono); font-size: 12px; color: var(--ink-4); }
.index-card__title { font-family: var(--display); font-size: 18px; font-weight: 700; line-height: 1.2; }
.index-card__meta { display: flex; gap: 8px; font-size: 11px; }
.index-card__priority { padding: 2px 6px; font-family: var(--mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.index-card__priority--critica { background: var(--ink); color: var(--white); }
.index-card__priority--alta    { background: var(--paper-2); color: var(--ink); border: 1px solid var(--ink); }
.index-card__priority--media   { background: transparent; color: var(--ink-3); border: 1px solid var(--line); }
.index-card__priority--baja    { background: transparent; color: var(--ink-4); border: 1px dotted var(--line); }

/* Map pin */
.map-svg {
  width: 100%;
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.map-pin {
  cursor: pointer;
  transition: 120ms;
}
.map-pin:hover { transform: scale(1.2); }

/* Calendar */
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--ink); }
.calendar__head {
  background: var(--ink); color: var(--white);
  text-align: center;
  font-family: var(--mono); font-size: 11px; padding: 8px 4px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.calendar__cell {
  background: var(--white);
  min-height: 96px;
  padding: 8px;
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  display: flex; flex-direction: column; gap: 4px;
}
.calendar__cell.is-other-month { background: var(--paper-2); color: var(--ink-5); }
.calendar__cell.is-today { background: var(--ink); color: var(--white); }
.calendar__cell.is-today .calendar__num { color: var(--white); }
.calendar__num { font-weight: 700; font-size: 13px; color: var(--ink); }
.calendar__event {
  display: block;
  background: var(--ink); color: var(--white);
  padding: 2px 4px; font-size: 9px; line-height: 1.3;
  cursor: pointer; text-decoration: none;
}
.calendar__event:hover { background: var(--ink-3); }
.calendar__event--ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--ink); }

/* Floating share rail */
.share-rail {
  position: fixed; left: 24px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 30;
}
.share-rail button {
  width: 40px; height: 40px;
  background: var(--white); border: 1px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.share-rail button:hover { background: var(--ink); color: var(--white); }

@media (max-width: 1100px) { .share-rail { display: none; } }

/* TOC */
.toc { position: sticky; top: 96px; padding: 20px; background: var(--paper-2); border-left: 3px solid var(--ink); font-size: 13px; }
.toc h5 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; margin: 0 0 12px; }
.toc ol { padding-left: 16px; margin: 0; }
.toc li { padding: 4px 0; color: var(--ink-3); }
.toc li.is-active { color: var(--ink); font-weight: 700; }

/* Empty state */
.empty {
  text-align: center;
  padding: 64px 32px;
  border: 1px dashed var(--line);
  background: var(--paper-2);
}
.empty svg { margin: 0 auto 16px; opacity: 0.4; display: block; }

/* 404 */
.error-stage {
  text-align: center; padding: 96px 32px;
}
.error-stage__code { font-family: var(--display); font-size: 240px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; color: var(--ink); }

/* Hero slider variants for tweaks */
.hero-magazine { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }

/* Color swatch (in design system, even if grayscale) */
.swatch { display: flex; gap: 12px; align-items: center; }
.swatch__chip { width: 56px; height: 56px; border: 1px solid var(--ink); }
.swatch__info { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

/* Component kit grid */
.kit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }

/* Brand mark used inside hero slides */
.brand-mark {
  font-family: var(--display); font-weight: 800;
  letter-spacing: -0.04em; line-height: 0.85;
}

/* Nav map */
.nav-map { background: var(--white); padding: 32px; border: 1px solid var(--line); overflow: auto; }
.nav-map svg { display: block; }

/* Print-style document for laws */
.law-doc {
  font-family: var(--body);
  max-width: 720px; margin: 0 auto;
  background: var(--white); padding: 64px 80px;
  border: 1px solid var(--line);
  line-height: 1.7;
  font-size: 15px;
}
.law-doc h1 { font-family: var(--mono); font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 8px; }
.law-doc h2 { font-family: var(--display); font-size: 28px; line-height: 1.15; margin: 0 0 24px; padding-bottom: 16px; border-bottom: 2px solid var(--ink); }
.law-doc .article { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-4); margin-top: 32px; }
.law-doc h3 { font-family: var(--display); font-size: 18px; margin: 4px 0 12px; }

/* Inline tweak panel positioning */
#tweaks-panel-root { z-index: 150; }
