/* ==========================================================================
   GUÍA DEL PROPIETARIO — Sistema de cookies RGPD
   Estética Apple-Inmperson
   ========================================================================== */

/* Variables de paleta (heredan de las landings) */
:root {
  --gdp-cookie-ink: #393d46;
  --gdp-cookie-ink-soft: #5a5e68;
  --gdp-cookie-ink-muted: #86888f;
  --gdp-cookie-blue: #137fc7;
  --gdp-cookie-blue-deep: #1f5daa;
  --gdp-cookie-blue-bright: #05a4e6;
  --gdp-cookie-blue-bg: #e8f4fc;
  --gdp-cookie-paper: #ffffff;
  --gdp-cookie-paper-soft: #f5f5f7;
  --gdp-cookie-line: #d2d2d7;
  --gdp-cookie-line-soft: #e8e8ed;
}

/* === BANNER PRINCIPAL === */
.gdp-cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  max-width: 560px;
  margin: 0 auto;
  background: var(--gdp-cookie-paper);
  border: 1px solid var(--gdp-cookie-line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 12px 32px -8px rgba(57, 61, 70, 0.16), 0 4px 12px -4px rgba(57, 61, 70, 0.08);
  z-index: 9999;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--gdp-cookie-ink-soft);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;

  /* Animación de entrada */
  transform: translateY(20px);
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gdp-cookie-banner.visible {
  transform: translateY(0);
  opacity: 1;
}

.gdp-cookie-banner.hidden {
  display: none !important;
}

/* Header con icono */
.gdp-cookie-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.gdp-cookie-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(180deg, var(--gdp-cookie-blue-deep) 0%, var(--gdp-cookie-blue-bright) 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.gdp-cookie-icon svg {
  width: 18px;
  height: 18px;
}

.gdp-cookie-title {
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--gdp-cookie-ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Texto */
.gdp-cookie-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--gdp-cookie-ink-soft);
  margin-bottom: 20px;
}

.gdp-cookie-text a {
  color: var(--gdp-cookie-blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.gdp-cookie-text a:hover {
  border-bottom-color: var(--gdp-cookie-blue);
}

.gdp-cookie-text strong {
  color: var(--gdp-cookie-ink);
  font-weight: 600;
}

/* Botones — TODOS misma jerarquía visual (RGPD AEPD 2022) */
.gdp-cookie-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gdp-cookie-actions.three-col {
  grid-template-columns: 1fr 1fr 1fr;
}

.gdp-cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 100px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, color 0.15s;
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
}

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

/* Botón "Aceptar todas" */
.gdp-cookie-btn-primary {
  background: var(--gdp-cookie-blue);
  color: white;
  border-color: var(--gdp-cookie-blue);
}

.gdp-cookie-btn-primary:hover {
  background: var(--gdp-cookie-blue-deep);
  border-color: var(--gdp-cookie-blue-deep);
}

/* Botón "Rechazar todas" — MISMA jerarquía visual que aceptar */
.gdp-cookie-btn-secondary {
  background: var(--gdp-cookie-paper);
  color: var(--gdp-cookie-ink);
  border-color: var(--gdp-cookie-ink);
}

.gdp-cookie-btn-secondary:hover {
  background: var(--gdp-cookie-ink);
  color: var(--gdp-cookie-paper);
  border-color: var(--gdp-cookie-ink);
}

/* Botón "Configurar" — secundario sutil pero accesible */
.gdp-cookie-btn-tertiary {
  background: var(--gdp-cookie-paper-soft);
  color: var(--gdp-cookie-ink);
  border-color: var(--gdp-cookie-line);
}

.gdp-cookie-btn-tertiary:hover {
  background: var(--gdp-cookie-line-soft);
  border-color: var(--gdp-cookie-ink-muted);
}

/* === MODAL DE CONFIGURACIÓN === */
.gdp-cookie-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(57, 61, 70, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 24px;
}

.gdp-cookie-modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.gdp-cookie-modal {
  background: var(--gdp-cookie-paper);
  border-radius: 24px;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--gdp-cookie-ink-soft);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.25);
}

.gdp-cookie-modal-overlay.visible .gdp-cookie-modal {
  transform: translateY(0) scale(1);
}

.gdp-cookie-modal-header {
  margin-bottom: 24px;
}

.gdp-cookie-modal h2 {
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--gdp-cookie-ink);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 10px;
}

.gdp-cookie-modal p.subtitle {
  font-size: 15px;
  color: var(--gdp-cookie-ink-soft);
  line-height: 1.5;
}

/* Categorías de cookies */
.gdp-cookie-category {
  background: var(--gdp-cookie-paper-soft);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
  transition: background 0.15s;
}

.gdp-cookie-category-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
}

.gdp-cookie-category-name {
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--gdp-cookie-ink);
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gdp-cookie-category-required {
  font-size: 10px;
  font-weight: 700;
  color: var(--gdp-cookie-blue);
  background: var(--gdp-cookie-blue-bg);
  padding: 3px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gdp-cookie-category-desc {
  font-size: 13px;
  color: var(--gdp-cookie-ink-soft);
  line-height: 1.5;
  margin-bottom: 10px;
}

.gdp-cookie-category-detail {
  font-size: 12px;
  color: var(--gdp-cookie-ink-muted);
  font-family: ui-monospace, monospace;
  line-height: 1.5;
}

/* Toggle switch (estilo Apple) */
.gdp-cookie-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}

.gdp-cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.gdp-cookie-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #c7c7cc;
  border-radius: 26px;
  transition: background 0.2s;
}

.gdp-cookie-toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.gdp-cookie-toggle input:checked + .gdp-cookie-toggle-slider {
  background: var(--gdp-cookie-blue);
}

.gdp-cookie-toggle input:checked + .gdp-cookie-toggle-slider::before {
  transform: translateX(18px);
}

.gdp-cookie-toggle input:disabled + .gdp-cookie-toggle-slider {
  background: var(--gdp-cookie-blue);
  opacity: 0.5;
  cursor: not-allowed;
}

.gdp-cookie-modal-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--gdp-cookie-line-soft);
}

/* === BOTÓN FLOTANTE PARA REVOCAR (siempre disponible) === */
.gdp-cookie-revoke-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 44px;
  height: 44px;
  background: var(--gdp-cookie-paper);
  border: 1px solid var(--gdp-cookie-line);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9998;
  color: var(--gdp-cookie-ink-soft);
  box-shadow: 0 4px 12px -2px rgba(57, 61, 70, 0.12);
  transition: all 0.2s;
  -webkit-appearance: none;
  appearance: none;
  padding: 0;
}

.gdp-cookie-revoke-btn:hover {
  background: var(--gdp-cookie-blue);
  border-color: var(--gdp-cookie-blue);
  color: white;
  transform: translateY(-2px);
}

.gdp-cookie-revoke-btn svg {
  width: 20px;
  height: 20px;
}

.gdp-cookie-revoke-btn.hidden {
  display: none;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .gdp-cookie-banner {
    bottom: 12px;
    left: 12px;
    right: 12px;
    padding: 22px;
    border-radius: 20px;
  }

  .gdp-cookie-actions,
  .gdp-cookie-actions.three-col,
  .gdp-cookie-modal-footer {
    grid-template-columns: 1fr;
  }

  .gdp-cookie-btn {
    padding: 13px 16px;
    font-size: 14px;
  }

  .gdp-cookie-modal {
    padding: 24px;
    border-radius: 20px;
    max-height: 90vh;
  }

  .gdp-cookie-modal h2 {
    font-size: 24px;
  }

  .gdp-cookie-revoke-btn {
    bottom: 12px;
    left: 12px;
  }
}

/* === DARK MODE preparado para futuro === */
@media (prefers-color-scheme: dark) {
  /* Por ahora forzamos light mode para coherencia con landings */
  /* Cuando hagamos dark mode global, este selector tomará control */
}
