/*
 * MenuAI — Banner de consentimiento de cookies (RGPD / ePrivacy).
 * ---------------------------------------------------------------------------
 * Estilos del aviso de cookies y del panel de configuración por categorías.
 * Reutiliza los tokens de styles.css (--gold, --bg-*, --glass-*, etc.). Si la
 * página no carga styles.css, hay fallbacks en los propios valores.
 * Todo el DOM lo inyecta cookie-consent.js; aquí solo va la presentación.
 * ---------------------------------------------------------------------------
 */

.cc-root { --cc-z: 2147483000; }

/* Scrim del panel de configuración (no del banner, que no bloquea la página) */
.cc-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--cc-z);
  display: none;
  background: rgba(6, 5, 3, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 1.25rem;
  overflow-y: auto;
}
.cc-overlay.is-open { display: grid; place-items: center; }

/* ---------- Banner (bottom sheet) ---------- */
.cc-banner {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%) translateY(0);
  z-index: calc(var(--cc-z) - 1);
  width: min(720px, calc(100vw - 2rem));
  padding: 1.4rem 1.5rem;
  border-radius: var(--radius-lg, 18px);
  background: var(--glass-bg, rgba(26, 22, 15, 0.92));
  border: 1px solid var(--glass-border, rgba(212, 160, 23, 0.22));
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  color: var(--text-secondary, #d8cfc0);
  font-family: var(--font-body, "Inter", system-ui, sans-serif);
  opacity: 0;
  transition: opacity .35s ease, transform .35s ease;
}
.cc-banner.is-visible { opacity: 1; }
.cc-banner[hidden] { display: none; }

.cc-banner__title {
  display: flex; align-items: center; gap: .55rem;
  font-family: var(--font-heading, "Playfair Display", serif);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--cream, #f5eddd);
  margin: 0 0 .5rem;
}
.cc-banner__icon { width: 20px; height: 20px; color: var(--gold, #D4A017); flex-shrink: 0; }
.cc-banner__text { font-size: .92rem; line-height: 1.65; margin: 0 0 1.1rem; }
.cc-banner__text a { color: var(--gold, #D4A017); text-decoration: underline; }
.cc-banner__text a:hover { color: var(--gold-light, #e8bf4a); }

.cc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

/* ---------- Botones ---------- */
.cc-btn {
  font: inherit;
  font-weight: 600;
  font-size: .9rem;
  line-height: 1;
  padding: .72rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.cc-btn--primary {
  background: var(--gold, #D4A017);
  color: var(--bg-deep, #0c0a08);
  box-shadow: 0 4px 14px var(--gold-glow, rgba(212, 160, 23, 0.28));
  flex: 1 1 auto;
}
.cc-btn--primary:hover { background: var(--gold-light, #e8bf4a); }
.cc-btn--secondary {
  background: transparent;
  color: var(--cream, #f5eddd);
  border-color: var(--glass-border, rgba(212, 160, 23, 0.3));
}
.cc-btn--secondary:hover { border-color: var(--gold, #D4A017); color: var(--gold, #D4A017); }
.cc-btn--ghost {
  background: transparent;
  color: var(--text-muted, #a89e8c);
  border-color: transparent;
  text-decoration: underline;
}
.cc-btn--ghost:hover { color: var(--gold, #D4A017); }

.cc-btn:focus-visible,
.cc-switch input:focus-visible + .cc-switch__track {
  outline: 2px solid var(--gold-light, #e8bf4a);
  outline-offset: 2px;
}

/* ---------- Panel de configuración ---------- */
.cc-panel {
  width: min(560px, 100%);
  max-height: min(88vh, 720px);
  overflow-y: auto;
  border-radius: var(--radius-lg, 18px);
  background: var(--bg-card, #1a160f);
  border: 1px solid var(--glass-border, rgba(212, 160, 23, 0.22));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  color: var(--text-secondary, #d8cfc0);
  font-family: var(--font-body, "Inter", system-ui, sans-serif);
}
.cc-panel__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1.5rem 1.6rem 1rem;
  border-bottom: 1px solid var(--hairline, rgba(255, 255, 255, 0.07));
}
.cc-panel__title {
  font-family: var(--font-heading, "Playfair Display", serif);
  font-weight: 600; font-size: 1.35rem; color: var(--cream, #f5eddd); margin: 0;
}
.cc-panel__close {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-muted, #a89e8c); font-size: 1.6rem; line-height: 1;
  padding: .1rem .35rem; border-radius: 8px;
}
.cc-panel__close:hover { color: var(--gold, #D4A017); }
.cc-panel__intro { padding: 1.1rem 1.6rem 0; font-size: .9rem; line-height: 1.65; }
.cc-panel__intro a { color: var(--gold, #D4A017); text-decoration: underline; }

.cc-cats { list-style: none; margin: 0; padding: 1rem 1.6rem 0; display: grid; gap: .9rem; }
.cc-cat {
  padding: 1.05rem 1.15rem;
  border: 1px solid var(--glass-border, rgba(212, 160, 23, 0.18));
  border-radius: var(--radius-md, 12px);
  background: var(--glass-bg-2, rgba(255, 255, 255, 0.03));
}
.cc-cat__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cc-cat__name {
  font-weight: 600; font-size: 1rem; color: var(--cream, #f5eddd);
  display: flex; align-items: center; gap: .5rem;
}
.cc-cat__desc { margin: .5rem 0 0; font-size: .86rem; line-height: 1.6; color: var(--text-muted, #a89e8c); }
.cc-cat__badge {
  font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--gold-soft, #c9a94a); padding: .18rem .5rem;
  border: 1px solid var(--glass-border, rgba(212, 160, 23, 0.3)); border-radius: 999px;
}

/* ---------- Interruptor accesible ---------- */
.cc-switch { position: relative; display: inline-flex; flex-shrink: 0; }
.cc-switch input {
  position: absolute; opacity: 0; width: 44px; height: 24px; margin: 0; cursor: pointer;
}
.cc-switch input:disabled { cursor: not-allowed; }
.cc-switch__track {
  width: 44px; height: 24px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid var(--hairline, rgba(255, 255, 255, 0.12));
  transition: background .2s ease;
  pointer-events: none;
}
.cc-switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--cream, #f5eddd); transition: transform .2s ease;
}
.cc-switch input:checked + .cc-switch__track { background: var(--gold, #D4A017); }
.cc-switch input:checked + .cc-switch__track::after { transform: translateX(20px); }
.cc-switch input:disabled + .cc-switch__track { opacity: .6; }

.cc-panel__foot {
  display: flex; flex-wrap: wrap; gap: .65rem; justify-content: flex-end;
  padding: 1.3rem 1.6rem 1.6rem;
}

@media (max-width: 520px) {
  .cc-banner { bottom: 0; left: 0; transform: none; width: 100vw; border-radius: 16px 16px 0 0; padding: 1.2rem 1.15rem; }
  .cc-banner.is-visible { transform: none; }
  .cc-actions { flex-direction: column-reverse; }
  .cc-btn { width: 100%; text-align: center; }
  .cc-panel__foot { justify-content: stretch; }
  .cc-panel__foot .cc-btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-banner, .cc-switch__track, .cc-switch__track::after, .cc-btn { transition: none; }
}
