/* cmp.css — Banner de consentimiento AHE (rediseñado v3) */

/* ============================================
   BANNER PRINCIPAL — PC: full-width abajo
   ============================================ */

#cmp-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: #ffffff;
  color: #333333;
  padding: 0;
  z-index: 99999;
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  border-top: 4px solid #000f9f;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  display: none;
}

#cmp-banner.visible {
  display: block;
}

#cmp-banner .cmp-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 30px;
  display: flex;
  align-items: center;
  gap: 30px;
}

#cmp-banner .cmp-text {
  flex: 1;
  min-width: 0;
}

#cmp-banner .cmp-text h3 {
  margin: 0 0 6px 0;
  font-size: 16px;
  font-weight: 700;
  color: #000f9f;
}

#cmp-banner .cmp-text p {
  margin: 0;
  color: #555555;
  font-size: 13px;
  line-height: 1.5;
}

#cmp-banner .cmp-text a {
  color: #000f9f;
  text-decoration: underline;
  font-weight: 600;
}

#cmp-banner .cmp-text a:hover {
  color: #00088a;
}

#cmp-banner .cmp-buttons {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

#cmp-banner button {
  padding: 11px 20px;
  border: 2px solid #000f9f;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}

/* Aceptar y Rechazar: MISMA prominencia (AEPD 2024) */
#cmp-accept {
  background: #000f9f;
  color: #ffffff;
}

#cmp-accept:hover {
  background: #00088a;
  border-color: #00088a;
}

#cmp-reject {
  background: #000f9f;
  color: #ffffff;
}

#cmp-reject:hover {
  background: #00088a;
  border-color: #00088a;
}

/* Configurar: opción secundaria */
#cmp-config {
  background: transparent;
  color: #000f9f;
  border-color: #cccccc;
}

#cmp-config:hover {
  border-color: #000f9f;
  background: #f5f5f5;
}

/* ============================================
   OVERLAY — fondo oscuro al abrir panel
   ============================================ */

#cmp-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99998;
  display: none;
  opacity: 0;
  transition: opacity 0.2s;
}

#cmp-overlay.visible {
  display: block;
  opacity: 1;
}

/* ============================================
   PANEL DE CONFIGURACIÓN — modal centrado
   ============================================ */

#cmp-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 640px;
  max-width: calc(100% - 40px);
  max-height: 85vh;
  background: #ffffff;
  color: #333333;
  z-index: 100000;
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 14px;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

#cmp-panel.visible {
  display: flex;
}

/* Header del panel */
#cmp-panel .cmp-panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  background: #000f9f;
  color: #ffffff;
}

#cmp-panel .cmp-panel-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
}

#cmp-panel .cmp-close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

#cmp-panel .cmp-close:hover {
  opacity: 1;
}

/* Body del panel */
#cmp-panel .cmp-panel-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

/* Categorías */
#cmp-panel .cmp-category {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 16px 18px;
  margin-bottom: 12px;
  transition: border-color 0.2s, background 0.2s;
}

#cmp-panel .cmp-category:hover {
  border-color: #000f9f;
  background: #fafbff;
}

#cmp-panel .cmp-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 6px;
}

#cmp-panel .cmp-category-header strong {
  font-size: 14px;
  font-weight: 700;
  color: #000f9f;
}

#cmp-panel .cmp-category p {
  margin: 0;
  color: #666666;
  font-size: 12px;
  line-height: 1.5;
}

/* ============================================
   TOGGLE SWITCH (estilo iOS) — v3 blindado
   ============================================ */

.cmp-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}

/* Ocultar completamente el checkbox nativo */
.cmp-toggle input[type="checkbox"] {
  position: absolute !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  overflow: hidden !important;
}

.cmp-toggle .cmp-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cccccc;
  transition: background-color 0.3s;
  border-radius: 24px;
}

.cmp-toggle .cmp-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: transform 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cmp-toggle input:checked + .cmp-slider {
  background-color: #000f9f;
}

.cmp-toggle input:checked + .cmp-slider:before {
  transform: translateX(20px);
}

.cmp-toggle input:disabled + .cmp-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Footer del panel — 3 botones */
#cmp-panel .cmp-panel-footer {
  padding: 16px 24px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  flex-shrink: 0;
  background: #f9f9f9;
}

#cmp-panel .cmp-panel-footer button {
  padding: 11px 18px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s;
  border: 2px solid transparent;
  flex: 1;
}

#cmp-reject-all {
  background: transparent;
  color: #000f9f;
  border-color: #000f9f;
}

#cmp-reject-all:hover {
  background: #f0f4ff;
}

#cmp-save {
  background: #ffffff;
  color: #000f9f;
  border-color: #000f9f;
}

#cmp-save:hover {
  background: #f0f4ff;
}

#cmp-accept-all {
  background: #000f9f;
  color: #ffffff;
  border-color: #000f9f;
}

#cmp-accept-all:hover {
  background: #00088a;
  border-color: #00088a;
}

/* ============================================
   ENLACE RETIRADA EN FOOTER
   ============================================ */

.cmp-withdraw-link {
  color: #cccccc;
  text-decoration: underline;
  cursor: pointer;
  font-size: 12px;
  margin-left: 8px;
}

.cmp-withdraw-link:hover {
  color: #ffffff;
}

/* ============================================
   RESPONSIVE — MÓVIL
   ============================================ */

@media (max-width: 768px) {
  #cmp-banner .cmp-content {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 14px;
  }
  
  #cmp-banner .cmp-text h3 {
    font-size: 15px;
  }
  
  #cmp-banner .cmp-text p {
    font-size: 12px;
  }
  
  #cmp-banner .cmp-buttons {
    flex-direction: column;
    gap: 8px;
  }
  
  #cmp-banner button {
    width: 100%;
    padding: 13px;
    font-size: 14px;
  }
  
  /* CAMBIO v3.x — panel como bottom sheet (patrón Google/Instagram/iOS) */
  #cmp-panel {
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    height: auto;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    border-radius: 12px 12px 0 0;
  }

  #cmp-panel .cmp-panel-header {
    padding: 16px 18px;
    border-radius: 12px 12px 0 0;
  }
  
  #cmp-panel .cmp-panel-header h3 {
    font-size: 15px;
  }
  
  #cmp-panel .cmp-panel-body {
    padding: 16px 18px;
  }
  
  #cmp-panel .cmp-category {
    padding: 14px 14px;
    margin-bottom: 10px;
  }
  
  /* CAMBIO v3.x — footer respeta safe-area de iOS (gesture bar) */
  #cmp-panel .cmp-panel-footer {
    flex-direction: column-reverse;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  }
  
  #cmp-panel .cmp-panel-footer button {
    width: 100%;
    padding: 13px;
  }
}
/* Aviso de Protección de Datos en Zona Privada */
.aviso-proteccion-datos {
    background-color: #f8f9fa;
    border-left: 4px solid #000f9f;
    padding: 15px 20px;
    margin-bottom: 30px;
    border-radius: 4px;
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}


.aviso-proteccion-datos p {
    margin: 0;
}

.aviso-proteccion-datos strong {
    color: #333;
}

.aviso-proteccion-datos a {
    color: #000f9f;
    text-decoration: underline;
    font-weight: 600;
}

.aviso-proteccion-datos a:hover {
    color: #00088a;
}