/* Aviso de cookies (Tuenweb Cookies 2.3+), mismo diseño que el plugin independiente.
 *
 * Colores y tamaños: variables CSS que el plugin rellena con lo puesto en Cookies CNF › Configuración general
 * (--tw-ck-bg, --tw-ck-color, --tw-ck-accent, --tw-ck-accent-color, --tw-ck-title-size, --tw-ck-text-size).
 * Cada web puede redefinirlas, o ajustar cualquier regla, en su CSS propio (wp-content/tuenweb-proyecto/css/).
 * Tabla de cookies: --tw-ct-*.
 */
.tw-cookie-banner,
.tw-cookie-modal,
.tw-cookie-reopen{
  --tw-ck-line: color-mix(in srgb, var(--tw-ck-color, #000) 18%, transparent);
  --tw-ck-muted: color-mix(in srgb, var(--tw-ck-color, #000) 75%, transparent);
  font-family: inherit;
  box-sizing: border-box;
}
.tw-cookie-banner *,
.tw-cookie-modal *{ box-sizing: border-box; }

/* Botones propios (sin depender de los de la web) */
.tw-cookie-btn{
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; margin: 0; border-radius: 4px; border: 2px solid var(--tw-ck-accent, #1a1a1a);
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; white-space: nowrap; cursor: pointer;
  text-transform: none; letter-spacing: normal; box-shadow: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.tw-cookie-btn--primary{ background: var(--tw-ck-accent, #1a1a1a); color: var(--tw-ck-accent-color, #fff); }
.tw-cookie-btn--primary:hover,
.tw-cookie-btn--primary:focus-visible{ background: transparent; color: var(--tw-ck-color, #000); }
.tw-cookie-btn--outline{ background: transparent; color: var(--tw-ck-color, #000); }
.tw-cookie-btn--outline:hover,
.tw-cookie-btn--outline:focus-visible{ background: var(--tw-ck-accent, #1a1a1a); color: var(--tw-ck-accent-color, #fff); }
.tw-cookie-btn:focus-visible,
.tw-cookie-modal__close:focus-visible,
.tw-cookie-reopen:focus-visible,
.tw-switch input:focus-visible + .tw-switch__track{ outline: 2px solid var(--tw-ck-accent, #1a1a1a); outline-offset: 2px; }

/* Aviso (barra inferior) */
.tw-cookie-banner{
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100000; /* por encima del formulario fijo del pie del tema (99999) */
  background: var(--tw-ck-bg, #fff); color: var(--tw-ck-color, #000);
  border-top: 1px solid var(--tw-ck-line);
  box-shadow: 0 -8px 24px rgba(0,0,0,.15);
}
.tw-cookie-banner[hidden]{ display: none; }
.tw-cookie-banner__inner{
  max-width: 1200px; margin: 0 auto; padding: 22px 32px;
  display: flex; align-items: center; gap: 32px; flex-wrap: wrap;
}
.tw-cookie-banner__text{ flex: 1 1 420px; min-width: 0; }
.tw-cookie-banner__title{ font-size: var(--tw-ck-title-size, 22px); font-weight: 700; line-height: 1.25; margin: 0 0 8px; color: inherit; }
.tw-cookie-banner__msg,
.tw-cookie-banner__msg p{ font-size: var(--tw-ck-text-size, 13px); line-height: 1.6; color: inherit; }
.tw-cookie-banner__msg p{ margin: 0 0 6px; }
.tw-cookie-banner__msg p:last-child{ margin-bottom: 0; }
.tw-cookie-banner a,
.tw-cookie-modal a{ color: inherit; text-decoration: underline; }
.tw-cookie-banner__actions{ display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }

@media (max-width: 720px){
  .tw-cookie-banner__inner{ padding: 18px 16px; gap: 16px; }
  .tw-cookie-banner__text{ flex-basis: 100%; }
  .tw-cookie-banner__actions{ margin-left: 0; width: 100%; }
  .tw-cookie-banner__actions .tw-cookie-btn{ flex: 1 1 auto; }
  .tw-cookie-banner__msg{ max-height: 40vh; overflow-y: auto; }
}

/* Configuración (ventana) */
.tw-cookie-modal{ position: fixed; inset: 0; z-index: 100001; display: flex; align-items: center; justify-content: center; padding: 16px; }
.tw-cookie-modal[hidden]{ display: none; }
.tw-cookie-modal__backdrop{ position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.tw-cookie-modal__panel{
  position: relative; background: var(--tw-ck-bg, #fff); color: var(--tw-ck-color, #000);
  max-width: 640px; width: 100%; max-height: 88vh; overflow-y: auto;
  padding: 36px 32px 28px; border-radius: 6px; box-shadow: 0 24px 60px rgba(0,0,0,.35);
  font-size: var(--tw-ck-text-size, 13px);
}
.tw-cookie-modal__title{ font-size: var(--tw-ck-title-size, 22px); font-weight: 700; line-height: 1.25; margin: 0 32px 18px 0; color: inherit; }
.tw-cookie-modal__close{
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; padding: 0;
  border: none; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; color: var(--tw-ck-muted);
}
.tw-cookie-modal__close:hover{ color: var(--tw-ck-color, #000); }

.tw-cookie-category{ padding: 16px 0; border-top: 1px solid var(--tw-ck-line); }
.tw-cookie-category:first-of-type{ border-top: none; padding-top: 0; }
.tw-cookie-category__head,
.tw-cookie-group__head{ display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.tw-cookie-category__title{ font-size: 15px; font-weight: 700; margin: 0; color: inherit; }
.tw-cookie-category__text p,
.tw-cookie-group__text p{ font-size: inherit; line-height: 1.6; margin: 0 0 6px; color: var(--tw-ck-muted); }

/* Grupos dentro de una categoría (Facebook, Google...) */
.tw-cookie-group{
  margin: 12px 0 0 16px; padding: 10px 14px; border-left: 2px solid var(--tw-ck-line);
  background: color-mix(in srgb, var(--tw-ck-color, #000) 3%, transparent);
}
.tw-cookie-group__title{ font-size: 14px; font-weight: 600; margin: 0; color: inherit; }

.tw-switch{ position: relative; display: inline-block; width: 44px; height: 24px; flex: 0 0 auto; margin: 0; }
.tw-switch input{ position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.tw-switch input:disabled{ cursor: not-allowed; }
.tw-switch__track{ position: absolute; inset: 0; background: var(--tw-ck-line); border-radius: 999px; transition: background .15s ease; }
.tw-switch__track::before{
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s ease;
}
.tw-switch input:checked + .tw-switch__track{ background: var(--tw-ck-accent, #1a1a1a); }
.tw-switch input:checked + .tw-switch__track::before{ transform: translateX(20px); }
.tw-switch input:disabled + .tw-switch__track{ opacity: .6; }
.tw-switch--sm{ width: 36px; height: 20px; }
.tw-switch--sm .tw-switch__track::before{ width: 14px; height: 14px; }
.tw-switch--sm input:checked + .tw-switch__track::before{ transform: translateX(16px); }

.tw-cookie-modal__more{ margin: 16px 0 0; font-size: inherit; color: var(--tw-ck-muted); }
.tw-cookie-modal__actions{ display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
@media (max-width: 520px){
  .tw-cookie-modal__panel{ padding: 30px 18px 20px; }
  .tw-cookie-modal__actions .tw-cookie-btn{ flex: 1 1 auto; }
  .tw-cookie-group{ margin-left: 4px; }
}

/* Botón flotante para volver a ver el aviso */
.tw-cookie-reopen{
  position: fixed; left: 16px; bottom: 16px; z-index: 9998;
  width: 44px; height: 44px; padding: 0; display: flex; align-items: center; justify-content: center;
  background: var(--tw-ck-bg, #fff); color: var(--tw-ck-accent, #1a1a1a);
  border: 1px solid var(--tw-ck-line); border-radius: 50%; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,.2); transition: transform .15s ease;
}
.tw-cookie-reopen[hidden]{ display: none; }
.tw-cookie-reopen:hover{ transform: scale(1.08); }
@media print{ .tw-cookie-banner, .tw-cookie-modal, .tw-cookie-reopen{ display: none !important; } }

/* Tabla de cookies de la política ([sc_tuenweb_cookies_cookies_table]). Móvil: una ficha por cookie. */
.tw-cookie-table-wrap{ margin: 1.5em 0; }
.tw-cookie-table{ width: 100%; border-collapse: collapse; font-size: var(--tw-ct-font-size, .92em); line-height: 1.5; }
.tw-cookie-table th,
.tw-cookie-table td{ padding: var(--tw-ct-pad, 10px 12px); border-bottom: 1px solid var(--tw-ct-border, rgba(0,0,0,.12)); text-align: left; vertical-align: top; }
.tw-cookie-table thead th{ background: var(--tw-ct-head-bg, rgba(0,0,0,.04)); color: var(--tw-ct-head-color, inherit); font-weight: 600; white-space: nowrap; }
.tw-cookie-table code{ font-size: .95em; white-space: nowrap; }
.tw-cookie-table small{ display: block; opacity: .75; }
.tw-cookie-table__nombre{ min-width: 130px; }
.tw-cookie-table__finalidad{ min-width: 260px; }
@media (max-width: 640px){
  .tw-cookie-table thead{ position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tw-cookie-table,
  .tw-cookie-table tbody,
  .tw-cookie-table td{ display: block; width: 100%; min-width: 0; }
  .tw-cookie-table tr{ display: flex; flex-direction: column; padding: 12px 0; border-bottom: 1px solid var(--tw-ct-border, rgba(0,0,0,.12)); }
  .tw-cookie-table td{ padding: 3px 0; border: 0; }
  .tw-cookie-table code{ white-space: normal; overflow-wrap: anywhere; }
  .tw-cookie-table td.tw-cookie-table__nombre{ order: -2; font-size: 1.05em; padding-bottom: 6px; }
  .tw-cookie-table td.tw-cookie-table__finalidad{ order: -1; }
  .tw-cookie-table td[data-label]::before{ content: attr(data-label) ": "; font-weight: 600; }
}
