/* ================================================================
   DR. OULKADI — CONSENT BANNER + MODAL STYLES
   ----------------------------------------------------------------
   Diseño: spec en marketing/spec-consent-mode-v2-banner.md §3
   Paleta neutra premium · sans-serif del sistema · WCAG AA
   ================================================================ */

/* ---------- BANNER ---------------------------------------------- */
.cc-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 10000;
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.92rem;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 320ms ease, transform 320ms ease;
  pointer-events: none;
}
.cc-banner.cc-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.cc-banner__inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 22px;
  max-width: 1180px;
  margin: 0 auto;
}
.cc-banner__text { color: #374151; }
.cc-banner__text a {
  color: #1f2937;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cc-banner__text a:hover { color: #000; }
.cc-banner__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

@media (min-width: 768px) {
  .cc-banner__inner {
    flex-direction: row;
    align-items: center;
    gap: 24px;
  }
  .cc-banner__text { flex: 1; }
  .cc-banner__buttons { flex: 0 0 auto; flex-wrap: nowrap; }
}

/* ---------- BUTTONS (banner + modal) ---------------------------- */
.cc-btn {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
  white-space: nowrap;
}
.cc-btn:focus-visible {
  outline: 2px solid #1f2937;
  outline-offset: 2px;
}
/* Igual peso visual entre primary y secondary, según AEPD julio 2023.
   Diferenciamos por sutileza tonal, no por jerarquía. */
.cc-btn--primary {
  background: #1f2937;
  color: #ffffff;
  border-color: #1f2937;
}
.cc-btn--primary:hover { background: #111827; border-color: #111827; }
.cc-btn--secondary {
  background: #ffffff;
  color: #1f2937;
  border-color: #d1d5db;
}
.cc-btn--secondary:hover { border-color: #1f2937; }

/* ---------- MODAL ----------------------------------------------- */
.cc-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.cc-modal.cc-visible { display: flex; }
.cc-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
.cc-modal__content {
  position: relative;
  z-index: 1;
  background: #ffffff;
  color: #1f2937;
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 28px 28px 22px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.25);
}
.cc-modal__content:focus { outline: none; }
.cc-modal__title {
  margin: 0 0 6px 0;
  font-size: 1.4rem;
  font-weight: 600;
  color: #111827;
}
.cc-modal__intro {
  margin: 0 0 18px 0;
  color: #4b5563;
  font-size: 0.95rem;
  line-height: 1.55;
}

/* Filas de categorías */
.cc-modal__rows {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 22px;
}
.cc-row {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  background: #fafafa;
}
.cc-row__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.cc-row__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}
.cc-row__status {
  font-size: 0.8rem;
  color: #6b7280;
  font-style: italic;
}
.cc-row__desc {
  margin: 0;
  color: #4b5563;
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Toggle accesible */
.cc-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex: 0 0 auto;
}
.cc-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.cc-toggle__slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 999px;
  cursor: pointer;
  transition: background 160ms ease;
}
.cc-toggle__slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 160ms ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.cc-toggle input:checked + .cc-toggle__slider {
  background: #1f2937;
}
.cc-toggle input:checked + .cc-toggle__slider::before {
  transform: translateX(20px);
}
.cc-toggle input:focus-visible + .cc-toggle__slider {
  outline: 2px solid #1f2937;
  outline-offset: 2px;
}

/* Acciones del modal */
.cc-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 14px;
}
.cc-modal__foot {
  margin: 0;
  font-size: 0.85rem;
  color: #6b7280;
  text-align: center;
}
.cc-modal__foot a {
  color: #1f2937;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cc-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  border-radius: 6px;
}
.cc-modal__close:hover { color: #111827; background: #f3f4f6; }
.cc-modal__close:focus-visible { outline: 2px solid #1f2937; outline-offset: 2px; }

/* Bloquear scroll del body cuando el modal está abierto */
body.cc-modal-open { overflow: hidden; }
