/*!
 * hipnosia-theme.css: adapta el Kit GDPR / Cookies UE a la marca Hipnosia (Wattle + Bottle Green).
 * Cargar DESPUES de cookie-consent.css. Config: theme 'dark', layout 'bar', position 'bottom-left'.
 * Aceptar y Rechazar comparten .cc-btn--choice: no diferenciarlos (regla AEPD).
 */

:root,
[data-cc-theme="dark"] {
  --cc-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cc-font-size: 14px;
  --cc-line-height: 1.55;
  --cc-title-size: 15px;
  --cc-title-weight: 700;

  --cc-bg: #0A1712;
  --cc-text: #F5F7EE;
  --cc-muted: #9AA396;            /* 7:1 sobre #0A1712 */
  --cc-border: rgba(22, 104, 71, .24);
  --cc-link: #CCDA47;

  --cc-primary: #CCDA47;          /* Aceptar y Rechazar, identicos */
  --cc-primary-text: #06130D;     /* ~11:1 sobre Wattle */
  --cc-primary-hover: #D8E463;

  --cc-secondary-bg: transparent;
  --cc-secondary-text: #CCDA47;
  --cc-secondary-border: rgba(204, 218, 71, .55);
  --cc-secondary-hover: rgba(22, 104, 71, .14);

  --cc-toggle-off: #6B7468;       /* >=3:1 sobre #0A1712 */
  --cc-toggle-on: #CCDA47;
  --cc-focus: #CCDA47;

  --cc-radius: 16px;
  --cc-btn-radius: 12px;
  --cc-btn-padding: 12px 22px;
  --cc-shadow: 0 8px 32px rgba(3, 12, 8, .6);
  --cc-backdrop: rgba(5, 16, 11, .72);
  --cc-max-width: 440px;
  --cc-offset: 20px;
  --cc-z: 9999;
}

/* Foco visible: separado del fondo con un anillo interior oscuro */
.cc-btn:focus-visible,
.cc-close:focus-visible,
.cc-float:focus-visible,
.cc-link:focus-visible,
.cc-switch input:focus-visible + .cc-switch__track,
.cc-modal__dialog:focus-visible { outline: 2px solid #CCDA47; outline-offset: 3px; }

/* ---------- Botones ---------- */
.cc-btn {
  min-height: 48px;
  font-weight: 700;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  white-space: nowrap;
  transition: background-color 180ms cubic-bezier(.4, 0, .2, 1),
              border-color 180ms cubic-bezier(.4, 0, .2, 1),
              color 180ms cubic-bezier(.4, 0, .2, 1),
              transform 120ms cubic-bezier(.4, 0, .2, 1);
}
.cc-btn:active { transform: scale(.97); }
.cc-btn--choice:hover { transform: translateY(-1px); }
.cc-btn--secondary { border-width: 1.5px; }
.cc-btn--secondary:hover { border-color: #CCDA47; }

/* ---------- Banner: barra ancha centrada ---------- */
[data-cc-layout="bar"] .cc-banner {
  left: 50%; right: auto; bottom: 20px;
  width: min(1120px, calc(100% - 40px));
  transform: translateX(-50%);
  border-width: 1px;
  border-radius: var(--cc-radius);
  padding: 16px 22px;
  gap: 24px;
  background: rgba(10, 23, 18, .96);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  animation: hip-cc-in 320ms cubic-bezier(.16, 1, .3, 1);
}
/* Icono flat de galleta (mascara SVG en Wattle) */
[data-cc-layout="bar"] .cc-banner::before {
  content: "";
  flex: 0 0 28px; width: 28px; height: 28px; align-self: center;
  background: #CCDA47;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5zm-3.5 6a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm-1 5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm5 2a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5zm-3.5 6a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm-1 5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3zm5 2a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.cc-banner__title { margin-bottom: 3px; }
.cc-banner__text { font-size: 12.5px; max-width: 65ch; text-wrap: pretty; }
[data-cc-layout="bar"] .cc-banner__actions { gap: 10px; }

@media (max-width: 900px) {
  [data-cc-layout="bar"] .cc-banner {
    display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding: 18px;
  }
  [data-cc-layout="bar"] .cc-banner::before { display: none; }
  [data-cc-layout="bar"] .cc-banner__actions { flex-wrap: wrap; margin-top: 0; gap: 8px; }
  /* Configurar arriba a todo el ancho; Rechazar y Aceptar en fila debajo */
  .cc-banner__actions .cc-btn--secondary { order: 0; flex: 1 1 100%; }
  .cc-banner__actions .cc-btn--choice { order: 1; flex: 1 1 calc(50% - 4px); }
}
@media (max-width: 640px) {
  .cc-btn { letter-spacing: .08em; padding-left: 12px; padding-right: 12px; }
}

/* ---------- Modal de preferencias ---------- */
.cc-modal__dialog { background: #0A1712; }
.cc-modal__title { letter-spacing: -.01em; }
.cc-modal__actions { gap: 10px; }
.cc-modal__actions .cc-btn--secondary { order: 0; flex: 1 1 100%; }
@media (min-width: 641px) {
  .cc-modal__actions .cc-btn--secondary { flex: 1 1 auto; order: 2; }
}
.cc-cat__title { color: #F5F7EE; }
.cc-cat__always { color: #CCDA47; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.cc-switch__track { transition: background-color 180ms cubic-bezier(.4, 0, .2, 1); }
.cc-switch__track::after { transition: transform 180ms cubic-bezier(.4, 0, .2, 1), background-color 180ms cubic-bezier(.4, 0, .2, 1); box-shadow: none; }
.cc-switch input:checked + .cc-switch__track::after { background: #06130D; }
.cc-table th, .cc-table td { border-bottom-color: rgba(22, 104, 71, .24); }

/* ---------- Boton flotante: izquierda, para no chocar con WhatsApp (dcha, 28px) ---------- */
.cc-float {
  left: 20px; right: auto; bottom: 20px;
  width: 48px; height: 48px;
  background: #0A1712; color: #CCDA47;
  border: 1.5px solid rgba(204, 218, 71, .55);
  box-shadow: 0 6px 20px rgba(3, 12, 8, .55);
  transition: border-color 180ms cubic-bezier(.4, 0, .2, 1), transform 120ms cubic-bezier(.4, 0, .2, 1);
}
.cc-float:hover { border-color: #CCDA47; }
.cc-float:active { transform: scale(.97); }

/* ---------- Animacion y movimiento reducido ---------- */
@keyframes hip-cc-in {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  [data-cc-layout="bar"] .cc-banner { animation: none; }
  .cc-btn, .cc-float, .cc-switch__track, .cc-switch__track::after { transition: none; }
  .cc-btn:active, .cc-btn--choice:hover, .cc-float:active { transform: none; }
}

/* ---------- WhatsApp flotante: su contenedor (168x311, con el QR oculto) tapaba los enlaces del pie.
   Solo el boton recibe clics; el QR sigue saliendo al pasar el raton por el boton. ---------- */
#wa-float { pointer-events: none !important; }
#wa-float #wa-btn { pointer-events: auto; }

/* ==========================================================================
   Responsive completo: notch/barra de gestos, pantallas de 320 px y apaisado.
   Regla: nada se corta ni queda inalcanzable; lo que no cabe, hace scroll dentro.
   ========================================================================== */

/* Zonas seguras (iPhone con notch o barra de gestos) y altura maxima del banner */
[data-cc-layout="bar"] .cc-banner {
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
}
.cc-float { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: calc(20px + env(safe-area-inset-left, 0px)); }
.cc-modal__dialog { overscroll-behavior: contain; }
.cc-modal__body { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.cc-modal__actions { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
.cc-table { display: block; max-width: 100%; overflow-x: auto; }

/* Movil estrecho (<= 380 px): banner mas compacto, botones tactiles de 44 px */
@media (max-width: 380px) {
  [data-cc-layout="bar"] .cc-banner { width: calc(100% - 24px); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); padding: 14px; gap: 10px; }
  .cc-banner__title { font-size: 14px; }
  .cc-banner__text { font-size: 12px; line-height: 1.45; }
  .cc-banner__actions { gap: 6px; }
  .cc-btn { min-height: 44px; font-size: 12px; letter-spacing: .06em; }
  .cc-modal { padding: 12px; }
  .cc-modal__dialog { max-height: calc(100dvh - 24px); }
  .cc-modal__header { padding: 14px 14px 0; }
  .cc-modal__body { padding: 10px 14px; }
  .cc-modal__actions { padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px)); gap: 6px; }
  .cc-float { left: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}

/* Pantalla baja (movil apaisado, teclado abierto): botones en fila, cuerpo con espacio real */
@media (max-height: 520px) {
  [data-cc-layout="bar"] .cc-banner { padding: 10px 14px; gap: 8px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); max-height: calc(100dvh - 20px); }
  [data-cc-layout="bar"] .cc-banner::before { display: none; }
  .cc-banner__title { margin-bottom: 2px; }
  .cc-banner__text { font-size: 12px; line-height: 1.4; }
  .cc-banner__actions { flex-wrap: nowrap; margin-top: 0; gap: 8px; }
  .cc-banner__actions .cc-btn--secondary,
  .cc-banner__actions .cc-btn--choice { order: 0; flex: 1 1 0; min-width: 0; }
  .cc-btn { min-height: 40px; padding-left: 8px; padding-right: 8px; }
  .cc-modal { padding: 8px; }
  .cc-modal__dialog { max-height: calc(100dvh - 16px); }
  .cc-modal__header { padding: 10px 16px 0; }
  .cc-modal__body { padding: 8px 16px; }
  .cc-modal__actions { flex-wrap: nowrap; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); gap: 8px; }
  .cc-modal__actions .cc-btn--secondary,
  .cc-modal__actions .cc-btn--choice { order: 0; flex: 1 1 0; min-width: 0; }
}
