/* ===========================================================
   Cookie Consent - Medicler
   Estilos del banner y del panel de configuración de cookies.
   =========================================================== */

:root {
  --cc-graphite: #2b2b28;
  --cc-sand: #f4f1ec;
  --cc-text: #2b2b28;
  --cc-text-soft: #6b6b66;
  --cc-white: #ffffff;
  --cc-border: rgba(43, 43, 40, 0.12);
  --cc-accent: #2b2b28;
}

#cc-banner, #cc-modal, #cc-launcher {
  font-family: Arial, Helvetica, sans-serif;
  box-sizing: border-box;
}
#cc-banner *, #cc-modal *, #cc-launcher * {
  box-sizing: border-box;
}

/* ---------- Banner inferior ---------- */
#cc-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99998;
  background: var(--cc-white);
  border-top: 1px solid var(--cc-border);
  box-shadow: 0 -6px 24px rgba(0,0,0,0.08);
  padding: 20px 24px;
  display: none;
  animation: cc-slide-up .35s ease-out;
}
#cc-banner.cc-visible { display: block; }

@keyframes cc-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.cc-banner-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.cc-banner-text {
  flex: 1 1 380px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--cc-text);
}
.cc-banner-text strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
  letter-spacing: .2px;
}
.cc-banner-text a {
  color: var(--cc-text);
  text-decoration: underline;
}
.cc-banner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  flex: 0 0 auto;
}

/* ---------- Botones (misma prominencia Aceptar / Rechazar, según guía AEPD) ---------- */
.cc-btn {
  border: 1px solid var(--cc-graphite);
  background: var(--cc-white);
  color: var(--cc-graphite);
  padding: 11px 20px;
  font-size: 13px;
  letter-spacing: .04em;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s ease, background-color .15s ease;
}
.cc-btn:hover { opacity: .85; }
.cc-btn-primary {
  background: var(--cc-graphite);
  color: var(--cc-white);
}
.cc-btn-link {
  border: none;
  background: none;
  color: var(--cc-text-soft);
  text-decoration: underline;
  padding: 11px 4px;
  font-size: 13px;
  cursor: pointer;
}

/* ---------- Overlay + Modal de configuración ---------- */
#cc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,20,18,0.45);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#cc-overlay.cc-visible { display: flex; }

#cc-modal {
  background: var(--cc-white);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.cc-modal-header {
  background: var(--cc-graphite);
  color: var(--cc-white);
  padding: 20px 24px;
}
.cc-modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: .3px;
}
.cc-modal-body { padding: 20px 24px; }
.cc-modal-body > p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--cc-text);
  margin: 0 0 18px;
}
.cc-modal-body > p a { color: var(--cc-text); }

.cc-category {
  border-bottom: 1px solid var(--cc-border);
  padding: 16px 0;
}
.cc-category:first-of-type { border-top: 1px solid var(--cc-border); }
.cc-category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cc-category-title {
  font-size: 14px;
  font-weight: bold;
  color: var(--cc-text);
}
.cc-category-desc {
  font-size: 12.5px;
  color: var(--cc-text-soft);
  margin-top: 6px;
  line-height: 1.5;
}
.cc-tag-always {
  font-size: 11px;
  color: var(--cc-text-soft);
  letter-spacing: .04em;
}

/* Toggle switch */
.cc-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
}
.cc-switch input { opacity: 0; width: 0; height: 0; }
.cc-switch .cc-slider {
  position: absolute;
  inset: 0;
  background: #cfcac0;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .15s ease;
}
.cc-switch .cc-slider::before {
  content: "";
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; top: 3px;
  background: var(--cc-white);
  border-radius: 50%;
  transition: transform .15s ease;
}
.cc-switch input:checked + .cc-slider { background: var(--cc-graphite); }
.cc-switch input:checked + .cc-slider::before { transform: translateX(18px); }
.cc-switch input:disabled + .cc-slider { opacity: .55; cursor: not-allowed; }

.cc-modal-footer {
  padding: 16px 24px 22px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--cc-border);
}
.cc-modal-footer .cc-btn { flex: 1 1 auto; }

/* ---------- Botón flotante para reabrir preferencias ---------- */
#cc-launcher {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 99997;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--cc-graphite);
  color: var(--cc-white);
  border: none;
  cursor: pointer;
  font-size: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
#cc-launcher.cc-visible { display: flex; }

@media (max-width: 640px) {
  .cc-banner-inner { flex-direction: column; align-items: stretch; }
  .cc-banner-actions { justify-content: stretch; }
  .cc-banner-actions .cc-btn, .cc-banner-actions .cc-btn-link { flex: 1 1 auto; text-align: center; }
}
