/* =============================================================
   cookies.css — Banner de consentimiento de cookies SaaSTi
   Incluir en todas las páginas junto con cookies.js
   ============================================================= */

/* ─── BANNER PRINCIPAL ─── */
#cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 2rem));
  z-index: 9999;
  width: min(720px, calc(100vw - 2rem));
  background: white;
  border: 1px solid #E4E5EC;
  border-radius: 14px;
  box-shadow: 0 16px 60px rgba(26,26,46,0.15), 0 4px 16px rgba(26,26,46,0.08);
  padding: 1.75rem 2rem;
  font-family: 'Century Gothic', 'Trebuchet MS', Futura, 'Gill Sans', sans-serif;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.35s ease;
  opacity: 0;
  pointer-events: none;
}

#cookie-banner.cb-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

#cookie-banner.cb-hiding {
  transform: translateX(-50%) translateY(calc(100% + 2rem));
  opacity: 0;
}

/* Layout interno */
.cb-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.cb-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.cb-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1A1A2E;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}

.cb-desc {
  font-size: 0.78rem;
  color: #6E6E8A;
  line-height: 1.65;
}

.cb-desc a {
  color: #CC2218;
  text-decoration: none;
  font-weight: 600;
}

.cb-desc a:hover { text-decoration: underline; }

/* Panel de preferencias (expandible) */
.cb-prefs {
  display: none;
  flex-direction: column;
  gap: 0.6rem;
  margin: 1rem 0;
  padding: 1rem;
  background: #F7F8FA;
  border: 1px solid #E4E5EC;
  border-radius: 8px;
}

.cb-prefs.cb-prefs-open { display: flex; }

.cb-pref-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.cb-pref-info strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #1A1A2E;
  margin-bottom: 0.15rem;
}

.cb-pref-info span {
  font-size: 0.73rem;
  color: #6E6E8A;
  line-height: 1.5;
}

/* Toggle switch */
.cb-toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

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

.cb-toggle-slider {
  position: absolute;
  inset: 0;
  background: #E4E5EC;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.25s;
}

.cb-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.25s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.cb-toggle input:checked + .cb-toggle-slider { background: #CC2218; }
.cb-toggle input:checked + .cb-toggle-slider::before { transform: translateX(18px); }
.cb-toggle input:disabled + .cb-toggle-slider { opacity: 0.5; cursor: not-allowed; }

/* Botones */
.cb-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1.25rem;
}

.cb-btn {
  font-family: 'Century Gothic', 'Trebuchet MS', Futura, 'Gill Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.6rem 1.25rem;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1.5px solid transparent;
  white-space: nowrap;
}

.cb-btn-accept {
  background: #CC2218;
  color: white;
  border-color: #CC2218;
}

.cb-btn-accept:hover {
  background: #A81915;
  border-color: #A81915;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(204,34,24,0.28);
}

.cb-btn-reject {
  background: white;
  color: #6E6E8A;
  border-color: #E4E5EC;
}

.cb-btn-reject:hover {
  border-color: #CC2218;
  color: #CC2218;
}

.cb-btn-config {
  background: none;
  color: #6E6E8A;
  border: none;
  padding: 0.6rem 0.5rem;
  font-size: 0.75rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cb-btn-config:hover { color: #CC2218; }

.cb-btn-save {
  background: #1A1A2E;
  color: white;
  border-color: #1A1A2E;
}

.cb-btn-save:hover {
  background: #2d2d4a;
  border-color: #2d2d4a;
}

/* ─── BOTÓN FLOTANTE (reabrir preferencias) ─── */
#cookie-float-btn {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 9998;
  width: 40px;
  height: 40px;
  background: white;
  border: 1px solid #E4E5EC;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(26,26,46,0.12);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
  font-family: inherit;
}

#cookie-float-btn:hover {
  border-color: #CC2218;
  box-shadow: 0 6px 20px rgba(204,34,24,0.2);
  transform: scale(1.08);
}

#cookie-float-btn.cfb-visible { display: flex; }

/* ─── RESPONSIVE ─── */
@media (max-width: 600px) {
  #cookie-banner {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 14px 14px 0 0;
    transform: translateY(calc(100% + 1px));
    padding: 1.5rem 1.25rem;
  }

  #cookie-banner.cb-visible {
    transform: translateY(0);
  }

  #cookie-banner.cb-hiding {
    transform: translateY(calc(100% + 1px));
  }

  .cb-actions { flex-direction: column; }
  .cb-btn { width: 100%; text-align: center; }
  .cb-btn-config { width: auto; }

  #cookie-float-btn {
    bottom: 1rem;
    left: 1rem;
  }
}
