/* Banner de consentimiento de cookies (RGPD). Vive fuera de styles.css a
   propósito, con la misma convención que vidreum-bot.css: un widget que se
   automonta en document.body desde cookie-consent.js y se carga tal cual en
   las tres páginas de entrada (index.html, vidreum-studio.html,
   galeria-3d.html), sin depender de que dashboard.js exista en esa página. */

.cookie-consent {
  --cc-line: rgba(255, 255, 255, .12);
  --cc-text: #eaf3ff;
  --cc-muted: #9ca9b9;
  --cc-blue: #245dff;
  --cc-cyan: #00a8ff;
  position: fixed;
  z-index: 2147483000;
  right: 18px;
  bottom: 18px;
  left: auto;
  width: min(400px, calc(100vw - 28px));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  font-family: Arial, "Helvetica Neue", sans-serif;
}

.cookie-consent[hidden] {
  display: none;
}

.cookie-consent-banner,
.cookie-consent-panel {
  width: 100%;
  color: var(--cc-text);
  border: 1px solid var(--cc-line);
  border-radius: 16px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015)),
    #0b0d13;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(36, 93, 255, .08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: cookieConsentIn .35s cubic-bezier(.2, .9, .3, 1.1);
}

@keyframes cookieConsentIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-consent-banner,
  .cookie-consent-panel { animation: none; }
}

/* ------------------------------------------------------------------ */
/* Banner principal                                                    */
/* ------------------------------------------------------------------ */

.cookie-consent-banner {
  padding: 18px;
}

.cookie-consent-text {
  margin: 0 0 14px;
  color: var(--cc-muted);
  font-size: 13px;
  line-height: 1.55;
}

.cookie-consent-text a {
  color: #8fceff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-consent-text a:hover,
.cookie-consent-text a:focus-visible {
  color: #b8e0ff;
}

.cookie-consent-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Los dos botones principales comparten tamaño, tipografía y peso visual:
   el RGPD exige que rechazar sea tan fácil y visible como aceptar. Solo
   cambia el color de relleno para distinguirlos, nunca el tamaño. */
.cookie-consent-btn {
  height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .01em;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.cookie-consent-btn:hover {
  transform: translateY(-1px);
}

.cookie-consent-btn-solid {
  color: #fff;
  border: 1px solid rgba(105, 171, 255, .7);
  background: linear-gradient(135deg, rgba(42, 130, 235, .97), rgba(20, 79, 166, .98));
  box-shadow: 0 12px 30px rgba(13, 81, 169, .38);
}

.cookie-consent-btn-solid:hover,
.cookie-consent-btn-solid:focus-visible {
  box-shadow: 0 16px 38px rgba(13, 81, 169, .5);
}

.cookie-consent-btn-ghost {
  color: var(--cc-text);
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .04);
}

.cookie-consent-btn-ghost:hover,
.cookie-consent-btn-ghost:focus-visible {
  border-color: rgba(255, 255, 255, .4);
  background: rgba(255, 255, 255, .08);
}

.cookie-consent-configure {
  display: block;
  width: 100%;
  margin: 10px 0 0;
  padding: 4px 0 0;
  color: var(--cc-muted);
  border: 0;
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.cookie-consent-configure:hover,
.cookie-consent-configure:focus-visible {
  color: var(--cc-text);
}

.cookie-consent-btn:focus-visible,
.cookie-consent-configure:focus-visible,
.cookie-consent-icon-btn:focus-visible {
  outline: 2px solid #8fceff;
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Panel de configuración granular                                     */
/* ------------------------------------------------------------------ */

.cookie-consent-panel {
  padding: 16px 18px 18px;
}

.cookie-consent-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.cookie-consent-panel-header strong {
  font-size: 14px;
  font-weight: 800;
}

.cookie-consent-icon-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--cc-muted);
  border: 1px solid var(--cc-line);
  border-radius: 50%;
  background: rgba(255, 255, 255, .04);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.cookie-consent-icon-btn:hover {
  color: var(--cc-text);
  border-color: rgba(255, 255, 255, .4);
}

.cookie-consent-category {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--cc-line);
}

.cookie-consent-category:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.cookie-consent-category-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.cookie-consent-category-copy strong {
  font-size: 12.5px;
  font-weight: 800;
}

.cookie-consent-category-copy span {
  color: var(--cc-muted);
  font-size: 11.5px;
  line-height: 1.5;
}

/* Interruptor a medida (checkbox oculto + carril) en vez de <input> nativo:
   así se puede tintar de azul de marca en "activado" en cualquier navegador. */
.cookie-consent-toggle {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  margin-top: 2px;
}

.cookie-consent-toggle input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.cookie-consent-toggle span {
  position: absolute;
  inset: 0;
  border: 1px solid var(--cc-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  transition: background .2s ease, border-color .2s ease;
}

.cookie-consent-toggle span::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #cdd6e3;
  transition: transform .2s ease, background .2s ease;
}

.cookie-consent-toggle input:checked + span {
  border-color: rgba(105, 171, 255, .7);
  background: linear-gradient(135deg, rgba(42, 130, 235, .97), rgba(20, 79, 166, .98));
}

.cookie-consent-toggle input:checked + span::before {
  transform: translateX(16px);
  background: #fff;
}

.cookie-consent-toggle input:focus-visible + span {
  outline: 2px solid #8fceff;
  outline-offset: 2px;
}

.cookie-consent-toggle.is-locked {
  opacity: .6;
}

.cookie-consent-toggle.is-locked input {
  cursor: default;
}

.cookie-consent-panel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

@media (max-width: 640px) {
  .cookie-consent {
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
  }
}

/* index.html tiene un menú de navegación flotante en móvil
   (.mobile-bubble-menu, ver styles.css) que ocupa la franja inferior de la
   pantalla; sin este ajuste el banner quedaría encima de sus iconos.
   Mismo desplazamiento (84px) que ya usa vidreum-bot.css para ese menú, así
   quedan a la misma altura. No afecta a vidreum-studio.html ni a
   galeria-3d.html, que no tienen ese menú. */
@media (max-width: 980px) {
  body:has(.mobile-bubble-menu) .cookie-consent { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
