/* Banner de consentiment de cookies — Pexalia.
   Fitxer compartit: s'inclou a totes les pàgines públiques (index.html, auth.html,
   privacy.html, terms.html, cookies.html). Fa servir els mateixos tokens visuals
   que la resta del lloc (amb valors de reserva perquè funcioni igual a les
   pàgines legals, que no defineixen totes les variables d'index.html). */

.pex-cc-banner,
.pex-cc-modal {
  --cc-bg: var(--bg-raised, #fff);
  --cc-text: var(--text, #000);
  --cc-text-soft: var(--text-soft, #666);
  --cc-border: var(--border-strong, #ddd);
  --cc-pop: var(--pop, #e31c23);
  --cc-radius: var(--radius-m, 10px);
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
}

.pex-cc-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
}
.pex-cc-banner.hidden { display: none; }

.pex-cc-card {
  pointer-events: auto;
  width: 100%;
  max-width: 760px;
  background: var(--cc-bg);
  color: var(--cc-text);
  border: 1px solid var(--cc-border);
  border-radius: 16px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.35);
  padding: 20px 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  animation: pexCcSlideUp 0.35s ease;
}
@keyframes pexCcSlideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .pex-cc-card { animation: none; }
}

.pex-cc-text { flex: 1 1 320px; min-width: 0; }
.pex-cc-text p { margin: 0; font-size: 0.88rem; line-height: 1.5; color: var(--cc-text-soft); }
.pex-cc-text a { color: var(--cc-text); text-decoration: underline; font-weight: 500; }

.pex-cc-actions { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }

.pex-cc-btn {
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  font-family: inherit;
}
.pex-cc-btn-ghost { background: transparent; border-color: var(--cc-border); color: var(--cc-text); }
.pex-cc-btn-ghost:hover { border-color: var(--cc-text); }
.pex-cc-btn-primary { background: #000; color: #fff; }
.pex-cc-btn-primary:hover { background: var(--cc-pop); }
.pex-cc-btn:focus-visible { outline: 2px solid var(--cc-pop); outline-offset: 2px; }

/* Panell de preferències */
.pex-cc-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.5);
}
.pex-cc-modal.hidden { display: none; }

.pex-cc-modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--cc-bg);
  color: var(--cc-text);
  border-radius: 16px;
  border: 1px solid var(--cc-border);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.4);
  padding: 24px;
}
.pex-cc-modal-card h2 { font-size: 1.15rem; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.01em; }
.pex-cc-modal-card > p { margin: 0 0 20px; font-size: 0.85rem; color: var(--cc-text-soft); line-height: 1.5; }

.pex-cc-category {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--cc-border);
}
.pex-cc-category:first-of-type { border-top: none; }
.pex-cc-category-info h3 { font-size: 0.92rem; font-weight: 600; margin: 0 0 4px; }
.pex-cc-category-info p { font-size: 0.8rem; color: var(--cc-text-soft); margin: 0; line-height: 1.45; }

.pex-cc-switch { position: relative; flex-shrink: 0; width: 40px; height: 24px; }
.pex-cc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pex-cc-switch input:disabled { cursor: not-allowed; }
.pex-cc-switch-track {
  position: absolute; inset: 0; border-radius: 999px; background: var(--cc-border);
  transition: background 0.15s ease;
}
.pex-cc-switch-thumb {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}
.pex-cc-switch input:checked ~ .pex-cc-switch-track { background: var(--cc-pop); }
.pex-cc-switch input:checked ~ .pex-cc-switch-thumb { transform: translateX(16px); }
.pex-cc-switch input:disabled ~ .pex-cc-switch-track { opacity: 0.55; }

.pex-cc-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.pex-cc-modal-actions .pex-cc-btn { flex: 1 1 auto; text-align: center; }

.pex-cc-manage-link {
  background: transparent; border: none; padding: 0; margin: 0;
  color: var(--cc-text); text-decoration: underline; font: inherit;
  font-size: inherit; cursor: pointer;
}
