/* =============================================================
   Makoto Lab — Consentimiento de cookies (banner + panel)
   Reutiliza los tokens de color/tipografía de styles.css.
   ============================================================= */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* -------- Banner -------- */
.mk-cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9000;
  background: var(--ink);
  color: var(--ink-invert);
  border-top: 1px solid var(--line-invert);
  padding: 1.3rem var(--gutter);
  animation: mkCookieUp .5s var(--ease-out) both;
}
.mk-cookie-banner[hidden] { display: none; }
@keyframes mkCookieUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.mk-cookie-banner-inner {
  max-width: var(--container); margin-inline: auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem 2rem;
  justify-content: space-between;
}
.mk-cookie-text {
  flex: 1 1 420px; font-size: .92rem; line-height: 1.55; color: var(--ink-invert-mute); margin: 0;
}
.mk-cookie-text a { color: var(--ink-invert); text-decoration: underline; text-underline-offset: 2px; }
.mk-cookie-text a:hover { color: var(--green-mid); }

.mk-cookie-actions {
  display: flex; flex-wrap: wrap; gap: .7rem; flex: 0 0 auto;
}

/* -------- Botones (Aceptar / Rechazar con el mismo peso visual) -------- */
.mk-cookie-btn {
  font-family: var(--font);
  font-weight: 600; font-size: .88rem;
  padding: .8rem 1.4rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .25s var(--ease-out), background-color .25s var(--ease-out), color .25s var(--ease-out), border-color .25s var(--ease-out);
}
.mk-cookie-btn:active { transform: scale(0.97); transition-duration: .12s; }
.mk-cookie-btn:focus-visible { outline: 2px solid var(--green-text); outline-offset: 2px; }

@media (hover: hover) and (pointer: fine) {
  .mk-cookie-btn:hover { transform: translateY(-1px); }
}

.mk-cookie-btn--dark { background: var(--ink-invert); color: var(--ink); border-color: var(--ink-invert); }
.mk-cookie-btn--dark:hover { background: transparent; color: var(--ink-invert); }

.mk-cookie-btn--accent { background: var(--green); color: var(--ink); border-color: var(--green); }
.mk-cookie-btn--accent:hover { background: var(--green-mid); border-color: var(--green-mid); }

.mk-cookie-btn--outline { background: transparent; color: var(--ink-invert); border-color: var(--line-invert); }
.mk-cookie-btn--outline:hover { border-color: var(--ink-invert); }

/* Dentro del panel (fondo claro) el outline usa colores de tinta oscura */
.mk-cookie-panel-box .mk-cookie-btn--outline { color: var(--ink); border-color: var(--line); }
.mk-cookie-panel-box .mk-cookie-btn--outline:hover { border-color: var(--ink); }

@media (max-width: 719px) {
  .mk-cookie-actions { width: 100%; }
  .mk-cookie-btn { flex: 1 1 auto; text-align: center; }
}

/* -------- Panel de preferencias -------- */
.mk-cookie-panel { position: fixed; inset: 0; z-index: 9100; }
.mk-cookie-panel[hidden] { display: none; }

.mk-cookie-panel-backdrop {
  position: absolute; inset: 0; background: rgba(13,13,15,0.55);
  animation: mkFadeIn .3s var(--ease-out) both;
}
@keyframes mkFadeIn { from { opacity: 0; } to { opacity: 1; } }

.mk-cookie-panel-box {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  max-width: 560px; width: calc(100% - 2.4rem);
  margin: 6vh auto; max-height: 88vh; overflow: hidden;
  background: var(--paper); color: var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px -20px rgba(13,13,15,0.45);
  animation: mkPanelIn .35s var(--ease-out) both;
}
@keyframes mkPanelIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

.mk-cookie-panel-scroll {
  overflow-y: auto; flex: 1 1 auto; min-height: 0;
  padding: clamp(1.6rem, 4vw, 2.4rem) clamp(1.6rem, 4vw, 2.4rem) 0;
}

.mk-cookie-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  margin-bottom: .8rem;
}
.mk-cookie-panel-head h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; }
.mk-cookie-panel-close {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid var(--line); background: transparent; color: var(--ink);
  font-size: .9rem; cursor: pointer;
  transition: border-color .2s var(--ease-out), background-color .2s var(--ease-out);
}
.mk-cookie-panel-close:hover { background: var(--paper-2); border-color: var(--ink); }
.mk-cookie-panel-close:focus-visible { outline: 2px solid var(--green-text); outline-offset: 2px; }

.mk-cookie-panel-intro { color: var(--mute); font-size: .92rem; line-height: 1.6; margin-bottom: 1.5rem; }

.mk-cookie-category {
  border-top: 1px solid var(--line);
  padding-block: 1.2rem;
}
.mk-cookie-category:last-of-type { border-bottom: 1px solid var(--line); }
.mk-cookie-category-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: .5rem;
}
.mk-cookie-category-head h3 { font-size: 1rem; font-weight: 600; }
.mk-cookie-category p { color: var(--mute); font-size: .88rem; line-height: 1.6; }

.mk-cookie-status {
  font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--green-text); background: rgba(16,214,126,0.12);
  border-radius: 999px; padding: .3rem .7rem; flex: none;
}

/* Toggle (interruptor) accesible */
.mk-cookie-toggle { position: relative; display: inline-flex; align-items: center; flex: none; cursor: pointer; }
.mk-cookie-toggle input {
  position: absolute; opacity: 0; width: 44px; height: 24px; margin: 0; cursor: pointer;
}
.mk-cookie-toggle-track {
  display: block; width: 44px; height: 24px; border-radius: 999px;
  background: var(--line); border: 1.5px solid var(--line);
  transition: background-color .25s var(--ease-out), border-color .25s var(--ease-out);
  position: relative;
}
.mk-cookie-toggle-track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px;
  border-radius: 50%; background: var(--paper);
  box-shadow: 0 1px 3px rgba(13,13,15,0.3);
  transition: transform .25s var(--ease-out);
}
.mk-cookie-toggle input:checked + .mk-cookie-toggle-track {
  background: var(--green); border-color: var(--green);
}
.mk-cookie-toggle input:checked + .mk-cookie-toggle-track::after { transform: translateX(20px); }
.mk-cookie-toggle input:focus-visible + .mk-cookie-toggle-track {
  outline: 2px solid var(--green-text); outline-offset: 2px;
}

.mk-cookie-panel-actions {
  display: flex; flex-wrap: wrap; gap: .7rem; flex: none;
  padding: 1.2rem clamp(1.6rem, 4vw, 2.4rem) clamp(1.6rem, 4vw, 2.4rem);
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.mk-cookie-panel-actions .mk-cookie-btn { flex: 1 1 auto; text-align: center; }

/* -------- Enlace "Configurar cookies" en el footer -------- */
.footer-cookie-link {
  font: inherit; color: var(--ink-invert); background: none; border: 0; padding: 0; margin: 0;
  cursor: pointer; opacity: .88; transition: opacity .25s var(--ease-out);
  font-weight: 500; font-size: .82rem;
}
.footer-cookie-link:hover { opacity: 1; color: var(--green-mid); }
