/* =========================================================================
   COOKIE CONSENT — Banner + Modal
   HDXS Frost · CSS puro sin frameworks
   ========================================================================= */

/* --------------------------------------------------------------------------
   VARIABLES
   -------------------------------------------------------------------------- */
:root {
  --cc-bg: #0b2540;
  --cc-bg-card: #ffffff;
  --cc-text: #5c7189;
  --cc-text-dark: #0b2540;
  --cc-blue: #1456d6;
  --cc-blue-hover: #0a3d8f;
  --cc-border: #e2e8f0;
  --cc-radius: 14px;
  --cc-radius-sm: 10px;
  --cc-shadow: 0 20px 60px -12px rgba(11, 37, 64, 0.35);
  --cc-shadow-sm: 0 8px 30px -8px rgba(11, 37, 64, 0.18);
  --cc-ease: cubic-bezier(0.16, 0.84, 0.44, 1);
  --cc-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --cc-font-display: 'Space Grotesk', var(--cc-font);
}

/* --------------------------------------------------------------------------
   BANNER — Barra inferior fija
   Solo se outputea si PHP detectó que NO hay cookie cc_consent.
   La entrada se anima con CSS @keyframes; la salida con JS (.is-dismissed).
   -------------------------------------------------------------------------- */
@keyframes cc-slide-up {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cc-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--cc-bg);
  padding: 0;
  pointer-events: auto;
  animation: cc-slide-up 0.5s 0.3s var(--cc-ease) both;
}

.cc-banner.is-dismissed {
  animation: none;
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s var(--cc-ease), opacity 0.4s var(--cc-ease);
}

.cc-banner-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 28px;
}

/* Icono */
.cc-banner-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(20, 86, 214, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cc-banner-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--cc-blue);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Texto */
.cc-banner-text {
  flex: 1;
}

.cc-banner-text p {
  margin: 0;
  font-family: var(--cc-font);
  font-size: 14px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.75);
}

.cc-banner-text a {
  color: #8cb4f5;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cc-banner-text a:hover {
  color: #ffffff;
}

/* Botones */
.cc-banner-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cc-btn {
  font-family: var(--cc-font);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 100px;
  padding: 11px 22px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s var(--cc-ease);
  white-space: nowrap;
  line-height: 1;
}

.cc-btn:focus-visible {
  outline: 2px solid var(--cc-blue);
  outline-offset: 2px;
}

.cc-btn-accept {
  background: var(--cc-blue);
  color: #ffffff;
  border-color: var(--cc-blue);
}

.cc-btn-accept:hover {
  background: var(--cc-blue-hover);
  border-color: var(--cc-blue-hover);
}

.cc-btn-reject {
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.15);
}

.cc-btn-reject:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

.cc-btn-settings {
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  border-color: transparent;
  padding: 11px 14px;
}

.cc-btn-settings:hover {
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   MODAL — Panel de configuración
   -------------------------------------------------------------------------- */
.cc-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(7, 28, 56, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--cc-ease), visibility 0.3s;
}

.cc-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.cc-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 10001;
  width: 90%;
  max-width: 580px;
  max-height: 85vh;
  background: var(--cc-bg-card);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
  transform: translate(-50%, -50%) scale(0.95);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.35s var(--cc-ease), opacity 0.35s var(--cc-ease), visibility 0.35s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cc-modal.is-open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  visibility: visible;
}

/* Header */
.cc-modal-header {
  padding: 28px 28px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.cc-modal-header h2 {
  margin: 0;
  font-family: var(--cc-font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--cc-text-dark);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.cc-modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--cc-border);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.cc-modal-close:hover {
  background: #f5f8fc;
  border-color: #c9d6e4;
}

.cc-modal-close:focus-visible {
  outline: 2px solid var(--cc-blue);
  outline-offset: 2px;
}

.cc-modal-close svg {
  width: 16px;
  height: 16px;
  stroke: var(--cc-text);
  fill: none;
  stroke-width: 2;
}

/* Body */
.cc-modal-body {
  padding: 20px 28px;
  overflow-y: auto;
  flex: 1;
}

.cc-modal-body > p {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--cc-text);
}

/* Categoría */
.cc-category {
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius-sm);
  margin-bottom: 12px;
  transition: border-color 0.2s;
}

.cc-category:last-child {
  margin-bottom: 0;
}

.cc-category.is-active {
  border-color: rgba(20, 86, 214, 0.3);
}

.cc-category-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  user-select: none;
}

.cc-category-head:hover {
  background: #f9fbfd;
}

.cc-category-info {
  flex: 1;
}

.cc-category-name {
  font-family: var(--cc-font-display);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--cc-text-dark);
  margin-bottom: 2px;
}

.cc-category-desc {
  font-size: 12.5px;
  color: var(--cc-text);
  line-height: 1.5;
}

/* Toggle switch */
.cc-toggle {
  flex-shrink: 0;
  position: relative;
  width: 44px;
  height: 24px;
}

.cc-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cc-toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 100px;
  background: #d1d9e3;
  cursor: pointer;
  transition: background 0.25s;
}

.cc-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s var(--cc-ease);
}

.cc-toggle input:checked + .cc-toggle-track {
  background: var(--cc-blue);
}

.cc-toggle input:checked + .cc-toggle-track::after {
  transform: translateX(20px);
}

.cc-toggle input:focus-visible + .cc-toggle-track {
  outline: 2px solid var(--cc-blue);
  outline-offset: 2px;
}

.cc-toggle input:disabled + .cc-toggle-track {
  background: #b0bec5;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Footer del modal */
.cc-modal-footer {
  padding: 20px 28px 24px;
  border-top: 1px solid var(--cc-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.cc-btn-save {
  background: var(--cc-blue);
  color: #ffffff;
  border-color: var(--cc-blue);
}

.cc-btn-save:hover {
  background: var(--cc-blue-hover);
  border-color: var(--cc-blue-hover);
}

.cc-btn-accept-all {
  background: transparent;
  color: var(--cc-blue);
  border-color: var(--cc-border);
}

.cc-btn-accept-all:hover {
  border-color: var(--cc-blue);
}

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
  .cc-banner-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding: 20px;
  }

  .cc-banner-icon {
    display: none;
  }

  .cc-banner-actions {
    justify-content: stretch;
  }

  .cc-btn {
    flex: 1;
    text-align: center;
    padding: 12px 16px;
  }

  .cc-btn-settings {
    flex: 0 0 auto;
  }

  .cc-modal {
    width: 95%;
    max-height: 90vh;
  }

  .cc-modal-header,
  .cc-modal-body,
  .cc-modal-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .cc-modal-footer {
    flex-direction: column;
  }

  .cc-modal-footer .cc-btn {
    width: 100%;
    text-align: center;
  }
}

/* --------------------------------------------------------------------------
   UTILIDADES
   -------------------------------------------------------------------------- */
.cc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
