/*!
 * Aviso de cookies · estilos
 * Diseño y desarrollo web: Luis Andreu Orenes · https://luisandreuorenes.com
 */

/* Colores y forma del aviso: adaptar a la marca solo con estas variables */
:root {
  --cc-fondo: #ffffff;
  --cc-texto: #1b1b1f;
  --cc-suave: #5b5b66;
  --cc-borde: #e3e3e8;
  --cc-acento: #4f46e5;
  --cc-acento-texto: #ffffff;
  --cc-radio: 12px;
  --cc-sombra: 0 12px 40px rgb(0 0 0 / .18);
}

.cc-banner,
.cc-panel {
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--cc-texto);
  background: var(--cc-fondo);
  border: 1px solid var(--cc-borde);
  border-radius: var(--cc-radio);
  box-shadow: var(--cc-sombra);
}

.cc-banner {
  position: fixed;
  z-index: 2147483000;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 64rem;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: center;
}
.cc-banner__texto { flex: 1 1 28rem; }
.cc-banner p, .cc-panel p { margin: 0; color: var(--cc-suave); }
.cc-banner a, .cc-panel a { color: var(--cc-acento); }

.cc-titulo {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: var(--cc-texto) !important;
}

.cc-acciones { display: flex; flex-wrap: wrap; gap: 8px; }

/* Aceptar y Rechazar tienen el MISMO estilo (criterio AEPD) */
.cc-btn {
  font: inherit;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  border: 2px solid var(--cc-acento);
  background: var(--cc-acento);
  color: var(--cc-acento-texto);
  cursor: pointer;
}
.cc-btn--secundario { background: transparent; color: var(--cc-acento); }
.cc-btn:focus-visible,
.cc-switch:focus-visible,
.cc-enlace:focus-visible { outline: 3px solid var(--cc-texto); outline-offset: 2px; }

.cc-panel {
  margin: auto; /* centrado aunque la web tenga un reset tipo * { margin: 0 } */
  width: min(36rem, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
}
.cc-panel::backdrop { background: rgb(0 0 0 / .45); }
.cc-panel__form { padding: 24px; display: grid; gap: 16px; }
.cc-panel h2 { font-size: 20px; }

.cc-categoria { border-top: 1px solid var(--cc-borde); padding-top: 14px; }
.cc-categoria__cabecera {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-weight: 600;
}

.cc-switch {
  appearance: none;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--cc-borde);
  position: relative;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
}
.cc-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / .3);
  transition: translate .2s;
}
.cc-switch:checked { background: var(--cc-acento); }
.cc-switch:checked::after { translate: 20px 0; }
.cc-switch:disabled { opacity: .6; cursor: not-allowed; }

/* Botón "Configurar cookies" del pie, con aspecto de enlace */
.cc-enlace {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 600px) {
  .cc-acciones { width: 100%; }
  .cc-acciones .cc-btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-switch, .cc-switch::after { transition: none; }
}
