/* SIGAT — Sistema de diseño oficial
   Colores: Pantone Black C #000000 + Pantone 173 C #d74a21
   Tipografía: Montserrat (400 regular · 500 medium · 600 semibold · 700 bold)
*/
:root {
  --ink:      #1a1a1a;
  --ink-2:    #444444;
  --ink-3:    #888888;
  --rule:     #e0e0e0;
  --rule-soft:#eeeeee;
  --paper:    #ffffff;
  --paper-2:  #f7f7f7;
  --paper-3:  #f0f0f0;
  --black:    #000000;
  --orange:   #d74a21;       /* Pantone 173 C */
  --orange-dk:#b33d1a;
  --orange-lt:#f5ede9;

  --f-sans: "Montserrat", ui-sans-serif, system-ui, sans-serif;
  /* No display/serif — Montserrat es la única tipografía corporativa */

  --radius:    4px;
  --radius-lg: 10px;
  --maxw:      1240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.panel-img img { width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; }

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

/* Labels & eyebrows */
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}
.eyebrow-orange {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--orange);
}

/* Display type — Montserrat bold large */
.display {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.rule { height: 1px; background: var(--rule); border: 0; }
.rule-strong { height: 1px; background: var(--ink); border: 0; }

/* ————————— Topbar ————————— */
.topbar {
  border-bottom: 1px solid rgba(224,224,224,0.9);
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.96);
  /* Removed backdrop-filter to avoid expensive repaint/reflow on scroll */
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 120px;
}

/* Scroll top button */
.scroll-top-button {
  position: fixed;
  left: 20px;
  bottom: 24px;
  z-index: 60;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.98);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px rgba(0,0,0,0.09);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
}
.scroll-top-button.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.scroll-top-button:hover,
.scroll-top-button:focus {
  background: var(--orange);
  color: white;
  border-color: rgba(215,74,33,0.15);
}

@media (max-width: 768px) {
  .scroll-top-button {
    left: 16px;
    bottom: 20px;
  }
}


/* Logo using actual image */
.brand-logo {
  display: flex; align-items: center;
  height: 65px;
}
.brand-logo img {
  height: 65px;
  width: auto;
  display: block;
}

.nav {
  display: flex; align-items: center; gap: 28px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.nav a { transition: color .15s ease; }
.nav a:hover { color: var(--black); }
.nav .pill {
  padding: 9px 18px;
  border: 1.5px solid var(--orange);
  border-radius: 999px;
  color: var(--orange);
  font-weight: 600;
  font-size: 13px;
  transition: background .15s, color .15s;
}
.nav .pill:hover { background: var(--orange); color: var(--paper); }
.nav .cta {
  padding: 9px 20px;
  background: var(--orange);
  color: white;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  transition: background .15s;
}
.nav .cta:hover { background: var(--orange-dk); }

/* ————————— Buttons ————————— */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  font-family: var(--f-sans);
  transition: transform .1s, background .15s, color .15s, border-color .15s;
  cursor: pointer;
  border: 1.5px solid transparent;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--orange); color: white; }
.btn-primary:hover { background: var(--orange-dk); }
.btn-black { background: var(--black); color: white; }
.btn-black:hover { background: #333; }
.btn-ghost { border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: white; }
.btn-ghost-orange { border-color: var(--orange); color: var(--orange); }
.btn-ghost-orange:hover { background: var(--orange); color: white; }
.btn-white { background: white; color: var(--black); }
.btn-white:hover { background: var(--paper-2); }

/* ————————— Chips / tags ————————— */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}
.chip-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--orange);
}
.chip-orange {
  background: var(--orange-lt);
  border-color: transparent;
  color: var(--orange-dk);
  font-weight: 600;
}

/* ————————— Tweaks panel ————————— */
.tweaks-panel {
  position: fixed; right: 20px; bottom: 20px;
  width: 280px;
  background: var(--black);
  color: white;
  border-radius: 12px;
  padding: 20px;
  font-size: 12px;
  box-shadow: 0 20px 50px -10px rgba(0,0,0,0.35);
  z-index: 100;
  display: none;
}
.tweaks-panel.open { display: block; }
.tweaks-panel h4 {
  margin: 0 0 14px 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.tweak-row { margin-bottom: 12px; }
.tweak-row label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-bottom: 6px;
}
.tweak-options { display: flex; gap: 4px; flex-wrap: wrap; }
.tweak-options button {
  flex: 1; min-width: 56px;
  padding: 7px 8px;
  background: rgba(255,255,255,0.08);
  color: white;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--f-sans);
  transition: background .15s;
  cursor: pointer;
}
.tweak-options button.active {
  background: var(--orange);
  font-weight: 700;
}

/* ————————— Swatch ————————— */
.swatch {
  width: 14px; height: 14px; border-radius: 50%;
  display: inline-block; vertical-align: middle;
}

/* ————————— Scrollbar ————————— */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

/* ————————— Status badges ————————— */
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-block;
}
.badge-ok   { background: #e6f4ea; color: #1e6e35; }
.badge-warn { background: #fff3e0; color: #a35c00; }
.badge-bad  { background: #fde8e3; color: #b33000; }
.badge-new  { background: var(--paper-3); color: var(--ink-2); }

/* ==============================================
   Mobile Navigation — Hamburger
   (v1.0 producción — Mayo 2026)
   ============================================== */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  background: none;
  border: 0;
  cursor: pointer;
  z-index: 60;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--black);
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.topbar.scrolled { box-shadow: 0 2px 16px rgba(0,0,0,0.08); }

@media (max-width: 1024px) {
  .nav-toggle { display: flex; }
  .nav {
    display: none;
    position: fixed;
    inset: 0;
    top: 84px;
    background: var(--paper);
    flex-direction: column;
    padding: 24px 28px 40px;
    gap: 0;
    z-index: 45;
    border-top: 2px solid var(--orange);
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  }
  .nav.open { display: flex; }
  .nav a {
    display: block;
    padding: 20px 0;
    border-bottom: 1px solid var(--rule);
    font-weight: 600;
    font-size: 18px;
    color: var(--ink);
    letter-spacing: -0.01em;
  }
  .nav a:last-child { border-bottom: 0; }
  /* CTA "Acceder a SIGAT" en móvil — botón completo */
  .nav .cta {
    margin-top: 24px;
    align-self: stretch;
    text-align: center;
    border-radius: 999px;
    padding: 18px 24px;
    font-size: 16px;
    background: var(--orange);
    color: white;
    font-weight: 700;
  }
  .nav .cta:hover { background: var(--orange-dk); color: white; }
}

/* ==============================================
   Cookie Banner + Panel — GDPR
   (v1.0 producción — Mayo 2026)
   ============================================== */

.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 9000;
  background: var(--black); color: white;
  padding: 24px 32px;
  border-top: 3px solid var(--orange);
  transform: translateY(100%);
  transition: transform .35s ease;
}
.cookie-banner.visible { transform: translateY(0); }
.cookie-banner__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; gap: 32px; align-items: center; flex-wrap: wrap;
}
.cookie-banner__text { flex: 1; min-width: 260px; }
.cookie-banner__text strong { font-size: 15px; font-weight: 700; display: block; margin-bottom: 6px; color: white; }
.cookie-banner__text p { font-size: 13px; color: rgba(255,255,255,0.7); margin: 0 0 8px; line-height: 1.55; }
.cookie-banner__text a { font-size: 12px; color: var(--orange); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.cookie-banner__actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.cookie-banner__actions .btn { padding: 10px 18px; font-size: 13px; }

.cookie-panel {
  position: fixed; inset: 0; z-index: 9001;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.cookie-panel.visible { opacity: 1; pointer-events: all; }
.cookie-panel__box {
  background: white; border-radius: 16px;
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.4);
}
.cookie-panel__header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px 28px; border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; background: white; z-index: 1;
}
.cookie-panel__header h3 { font-size: 17px; font-weight: 700; margin: 0; color: var(--black); }
.cookie-panel__close {
  background: var(--paper-2); border: 0; border-radius: 50%;
  width: 32px; height: 32px; font-size: 16px;
  cursor: pointer; display: grid; place-items: center;
  transition: background .15s; color: var(--ink); flex: none;
}
.cookie-panel__close:hover { background: var(--rule); }
.cookie-panel__body { padding: 4px 28px; }
.cookie-row { display: flex; align-items: center; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.cookie-row:last-child { border-bottom: 0; }
.cookie-row__info { flex: 1; }
.cookie-row__info strong { font-size: 14px; font-weight: 700; color: var(--black); display: block; margin-bottom: 4px; }
.cookie-row__info p { font-size: 12px; color: var(--ink-3); margin: 0; line-height: 1.5; }
.cookie-toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.cookie-toggle input { opacity: 0; width: 0; height: 0; }
.cookie-toggle__slider {
  position: absolute; inset: 0; background: var(--rule); border-radius: 24px;
  cursor: pointer; transition: background .2s;
}
.cookie-toggle__slider::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  left: 3px; bottom: 3px; background: white; border-radius: 50%;
  transition: transform .2s; box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.cookie-toggle input:checked + .cookie-toggle__slider { background: var(--orange); }
.cookie-toggle input:checked + .cookie-toggle__slider::before { transform: translateX(20px); }
.cookie-toggle--disabled .cookie-toggle__slider { background: var(--ink-3); cursor: not-allowed; }
.cookie-panel__footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 20px 28px; border-top: 1px solid var(--rule);
  position: sticky; bottom: 0; background: white;
}
.cookie-panel__footer .btn { padding: 11px 20px; font-size: 13px; }
[data-open-cookies] { cursor: pointer; color: var(--orange) !important; font-weight: 600; }

@media (max-width: 768px) {
  .cookie-banner { padding: 20px; }
  .cookie-banner__inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .cookie-banner__actions { width: 100%; }
  .cookie-banner__actions .btn { flex: 1; justify-content: center; min-width: 0; }
}
@media (max-width: 480px) {
  .cookie-banner__actions { flex-direction: column; }
}

/* Footer logo size adjustment */
.foot-logo img { transform: scale(1.5); }
