/* ==========================================================================
   styles-consent.css — banner y panel de consentimiento de cookies
   Pieza de Milton. Prefijo propio `.gx-consent-*`, sin tokens nuevos:
   reutiliza los de :root de styles-burdeos.css (DESIGN.md de Lola).
   Reglas respetadas: sin barras laterales de acento, radio y sombra de marca,
   Raleway, intervención selectiva en burdeos.
   ========================================================================== */

.gx-consent-hidden {
  display: none !important;
}

/* FMT-005 (S3): mientras el banner fijo existe, reserva su altura al hacer
   scroll por foco y al final de la página (WCAG 2.4.11). consent.js pone la
   clase en <html> y mide --gx-consent-h al crear el banner. */
html.gx-consent-activo {
  scroll-padding-bottom: calc(var(--gx-consent-h, 0px) + 16px);
}

html.gx-consent-activo body {
  padding-bottom: var(--gx-consent-h, 0px);
}

/* --------------------------------------------------------------------------
   Barra inferior
   -------------------------------------------------------------------------- */

.gx-consent-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9000;
  /* Marfil dominante de la web (#f3f1ed, el fondo suave de sus secciones). */
  background: #f3f1ed;
  border-top: 3px solid var(--wine, #702c36);
  box-shadow: 0 -14px 40px rgba(43, 43, 43, 0.14);
  font-family: Raleway, "Segoe UI", Arial, sans-serif;
  color: var(--graphite, #2b2b2b);
  animation: gx-consent-rise 0.28s ease-out both;
}

@keyframes gx-consent-rise {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.gx-consent-bar__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.gx-consent-bar__text {
  flex: 1 1 auto;
  min-width: 0;
}

.gx-consent-bar__title {
  margin: 0 0 6px;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--graphite, #2b2b2b);
}

.gx-consent-bar__copy {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--gray, #616160);
  max-width: 62ch;
}

.gx-consent-bar__copy a {
  color: var(--wine, #702c36);
  text-underline-offset: 0.18em;
}

.gx-consent-bar__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --------------------------------------------------------------------------
   Botones — «Aceptar», «Rechazar» y «Configurar» (y los tres del panel) son
   idénticos en forma, tamaño, color y peso: la misma jerarquía visual, así que
   rechazar es exactamente tan fácil como aceptar.
   -------------------------------------------------------------------------- */

.gx-consent-btn {
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 13px 26px;
  min-width: 132px;
  border-radius: var(--radius, 6px);
  border: 1.5px solid var(--wine, #702c36);
  cursor: pointer;
  text-align: center;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.gx-consent-btn {
  background: var(--paper, #ffffff);
  color: var(--wine, #702c36);
}

.gx-consent-btn:hover {
  background: var(--wine, #702c36);
  color: #ffffff;
}

.gx-consent-btn:focus-visible,
.gx-consent-open:focus-visible,
.gx-consent-switch input:focus-visible + .gx-consent-switch__track {
  outline: 2px solid var(--wine, #702c36);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Panel de preferencias
   -------------------------------------------------------------------------- */

.gx-consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: rgba(6, 6, 6, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.gx-consent-panel {
  background: #f3f1ed;
  border-radius: var(--radius, 6px);
  box-shadow: var(--shadow, 0 18px 50px rgba(43, 43, 43, 0.12));
  width: 100%;
  max-width: 640px;
  margin: auto;
  font-family: Raleway, "Segoe UI", Arial, sans-serif;
  color: var(--graphite, #2b2b2b);
}

.gx-consent-panel__head {
  position: relative;
  padding: 28px 64px 18px 32px;
  border-bottom: 1px solid rgba(43, 43, 43, 0.12);
}

.gx-consent-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radius, 6px);
  background: none;
  color: var(--gray, #616160);
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.gx-consent-close:hover {
  color: var(--graphite, #2b2b2b);
  background: rgba(43, 43, 43, 0.06);
}

.gx-consent-close:focus-visible {
  outline: 2px solid var(--wine, #702c36);
  outline-offset: 2px;
}

.gx-consent-panel__title {
  margin: 0 0 8px;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.gx-consent-panel__intro {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--gray, #616160);
}

.gx-consent-panel__body {
  padding: 8px 32px 4px;
}

.gx-consent-group {
  padding: 20px 0;
  border-bottom: 1px solid rgba(43, 43, 43, 0.12);
  display: flex;
  gap: 22px;
  align-items: flex-start;
}

.gx-consent-group:last-child {
  border-bottom: 0;
}

.gx-consent-group__text {
  flex: 1 1 auto;
}

.gx-consent-group__name {
  margin: 0 0 5px;
  font-size: 0.98rem;
  font-weight: 700;
}

.gx-consent-group__desc {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.58;
  color: var(--gray, #616160);
}

.gx-consent-group__fixed {
  flex: 0 0 auto;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray, #616160);
  padding-top: 3px;
  white-space: nowrap;
}

/* Interruptor */

.gx-consent-switch {
  flex: 0 0 auto;
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.gx-consent-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.gx-consent-switch__track {
  width: 46px;
  height: 26px;
  border-radius: 13px;
  background: #d6d2ca;
  border: 1px solid transparent;
  position: relative;
  transition: background-color 0.2s ease;
}

.gx-consent-switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(43, 43, 43, 0.3);
  transition: transform 0.2s ease;
}

.gx-consent-switch input:checked + .gx-consent-switch__track {
  background: var(--wine, #702c36);
}

.gx-consent-switch input:checked + .gx-consent-switch__track::after {
  transform: translateX(20px);
}

.gx-consent-panel__foot {
  padding: 20px 32px 28px;
  border-top: 1px solid rgba(43, 43, 43, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.gx-consent-panel__foot .gx-consent-btn {
  flex: 1 1 0;
  min-width: 0;
  padding-inline: 12px;
}

.gx-consent-note {
  padding: 0 32px 22px;
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--gray, #616160);
}

.gx-consent-note a {
  color: var(--wine, #702c36);
}

/* --------------------------------------------------------------------------
   Enlace «Preferencias de cookies» del pie: se comporta como el resto de
   enlaces de la franja legal, pero es un botón real.
   -------------------------------------------------------------------------- */

.gx-consent-open {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.gx-consent-open:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Estado guardado (aviso breve tras elegir)
   -------------------------------------------------------------------------- */

.gx-consent-saved {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 9000;
  background: var(--graphite, #2b2b2b);
  color: #ffffff;
  font-family: Raleway, "Segoe UI", Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: var(--radius, 6px);
  box-shadow: var(--shadow, 0 18px 50px rgba(43, 43, 43, 0.12));
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .gx-consent-bar__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding: 20px 22px calc(20px + env(safe-area-inset-bottom, 0px));
  }

  .gx-consent-bar__actions {
    flex-wrap: wrap;
    gap: 10px;
  }

  .gx-consent-bar__actions .gx-consent-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 14px 10px;
  }

  .gx-consent-bar__copy {
    font-size: 0.86rem;
  }
}

@media (max-width: 620px) {
  .gx-consent-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .gx-consent-panel {
    max-width: none;
    border-radius: var(--radius, 6px) var(--radius, 6px) 0 0;
    max-height: 92vh;
    overflow-y: auto;
  }

  .gx-consent-panel__head,
  .gx-consent-panel__body,
  .gx-consent-panel__foot,
  .gx-consent-note {
    padding-left: 22px;
    padding-right: 22px;
  }

  .gx-consent-panel__foot {
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }

  .gx-consent-panel__foot {
    flex-direction: column;
    align-items: stretch;
  }

  .gx-consent-panel__foot .gx-consent-btn {
    flex: 0 0 auto;
    padding: 14px 12px;
  }

  .gx-consent-panel__head {
    padding-right: 58px;
  }
}

/* El botón flotante «Seguir» de TARIC sube por encima del aviso mientras está
   a la vista (sin tocar styles-taric.css). */
html.gx-consent-activo .taric-page .taric-seguir {
  bottom: calc(var(--gx-consent-h, 0px) + max(20px, env(safe-area-inset-bottom)));
}

@media (prefers-reduced-motion: reduce) {
  .gx-consent-bar,
  .gx-consent-switch__track,
  .gx-consent-switch__track::after,
  .gx-consent-btn {
    animation: none !important;
    transition: none !important;
  }
}
