/* =========================
 GALIKA COOKIE CONSENT v1
 Self-hosted | RGPD + LOPDGDD + AEPD
 ========================= */

  :root{
    --gb-z: 9999;
    --gb-bg: #0b1220;
    --gb-card: #0f172a;
    --gb-text: #222;
    --gb-muted:#94a3b8;
    --gb-line:#1f2a44;
    --gb-white:#ffffff;
    --gb-btn:#ffffff;
    --gb-btnText:#0b1220;
    --gb-btnGhost: transparent;
    --gb-focus:#60a5fa;
    --gb-shadow: 0 20px 60px rgba(0,0,0,.45);
    --gb-radius: 18px;
    --gb-radiusSm: 12px;
    --gb-font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  }

  .gbc-hidden{ display:none !important; }

  /* Banner */
	.gbc-banner{
	  position: fixed;
	  inset: 0;
	  z-index: var(--gb-z);
	  display: flex;
	  align-items: center;
	  justify-content: center;
	  padding: 18px;
	  background: rgba(0,0,0,.6);
	  backdrop-filter: blur(6px);
	}

	/* La tarjeta del aviso centrada */
	.gbc-banner__card{
	  font-family: var(--gb-font);
	  width: min(980px, 100%);
	  background: rgba(255,255,255,.95);
	  color: var(--gb-text);
	  border: 1px solid rgba(148,163,184,.18);
	  box-shadow: var(--gb-shadow);
	  border-radius: 20px;
	  padding: 20px;
	}

	/* En desktop, que el texto y botones respiren */
	.gbc-row{
	  display: grid;
	  grid-template-columns: 1fr;
	  gap: 14px;
	  align-items: start;
	}
	@media (min-width: 860px){
	  .gbc-row{ grid-template-columns: 1.6fr .9fr; align-items: center; }
	}

  .gbc-title{
    font-weight: 900;
    letter-spacing: -.02em;
    margin: 0 0 6px;
    font-size: 16px;
  }
  .gbc-text{
    margin: 0;
    color: var(--gb-text);
    font-size: 13.5px;
    line-height: 1.35rem;
  }
  .gbc-links{
    margin-top: 8px;
    display:flex;
    gap: 12px;
    flex-wrap: wrap;
  }
  .gbc-link{
    color: #222;
    text-decoration: underline;
    font-size: 13px;
	font-weight: bold;
    cursor: pointer;
  }
  .gbc-actions{
    display:flex;
    gap: 10px;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  @media (min-width: 860px){
    .gbc-actions{ justify-content: flex-end; }
  }
  .gbc-btn{
    font-family: var(--gb-font);
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 800;
    border: 1px solid rgba(255,255,255,.14);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    outline: none;
  }
  .gbc-btn:focus-visible{
    box-shadow: 0 0 0 3px rgba(96,165,250,.35);
    border-color: rgba(96,165,250,.7);
  }
  /* AEPD: aceptar y rechazar al mismo nivel (estilo equivalente) */
  .gbc-btn--primary{
    background: rgb(65 180 0 / 60%);
    color: var(--gb-btnText);
    border-color: rgba(255,255,255,.3);
  }
  .gbc-btn--secondary{
    background: rgb(255 0 0 / 50%);
    color: var(--gb-text);
    border-color: rgba(255,255,255,.3);
  }
  .gbc-btn--ghost{
    background: transparent;
    color: #222;
    border-color: rgba(0,0,0,.3);
  }

  /* Modal */
  .gbc-modalOverlay{
    position: fixed;
    inset: 0;
    z-index: calc(var(--gb-z) + 1);
    background: rgba(0,0,0,.55);
    display:flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
  }
  .gbc-modal{
    font-family: var(--gb-font);
    width: min(980px, 100%);
    background: rgba(255,255,255,.95);
    color: var(--gb-text);
    border: 1px solid rgba(148,163,184,.18);
    border-radius: 22px;
    box-shadow: var(--gb-shadow);
    overflow: hidden;
  }
  .gbc-modalHeader{
	  background: rgba(210,210,210,.3);
    padding: 16px 18px;
    border-bottom: 1px solid rgba(148,163,184,.16);
    display:flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
  }
  .gbc-modalHeader h2{
    margin:0;
	color: #222;
    font-size: 16px;
    font-weight: 950;
    letter-spacing: -.02em;
  }
  .gbc-close{
    background: transparent;
    border: 1px solid rgba(255,255,255,.18);
    color: #222;
    border-radius: 999px;
    padding: 8px 10px;
    cursor: pointer;
    font-weight: 900;
  }
  .gbc-body{
    padding: 16px 18px 18px;
    display:grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }
  @media (min-width: 900px){
	  .gbc-body{ grid-template-columns: .85fr 1.15fr; }
	}

  .gbc-card{
    border: 1px solid rgba(148,163,184,.16);
    border-radius: 18px;
    padding: 14px;
	color: #222;
  }
  .gbc-card h3{
    color: #222;
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 900;
  }
  .gbc-card p{
    margin:0;
    color: var(--gb-text);
    font-size: 13px;
    line-height: 1.35rem;
  }

  /* Toggles */
  .gbc-toggleRow{
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid rgba(148,163,184,.25);
  }
  .gbc-toggleRow:first-of-type{ border-top: none; padding-top: 2px; }
  .gbc-toggleMeta {
		display:flex;
		flex-direction: column;
		gap: 4px;
  }
  .gbc-toggleMeta .t {
    font-weight: 900;
    font-size: 13.5px;
  }
  .gbc-toggleMeta .d {
    color: var(--gb-text);
    font-size: 12.5px;
  }
  .gbc-switch {
    position: relative;
    width: 46px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.3);
    background: rgba(85,85,85,.25);
    cursor: pointer;
    flex: 0 0 auto;
  }
	.gbc-switch[data-on="1"] {
		background: rgb(0 177 7 / 60%);	
	}
  .gbc-switch::after{
    content:"";
    position:absolute;
    top: 50%;
    left: 4px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #fff;
    transition: left .18s ease;
  }
  .gbc-switch[data-on="1"]::after{ left: 22px; }

  /* Tabla cookies */
  .gbc-table{
    width:100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 12.5px;
  }
  .gbc-table th, .gbc-table td{
    text-align:left;
    vertical-align: top;
    padding: 10px 8px;
    border-top: 1px solid rgba(148,163,184,.12);
    color: #333;
  }
  .gbc-table th { color: #222; font-weight: 900; }
  .gbc-badge {
    display:inline-block;
    padding: 3px 8px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    font-weight: 900;
    font-size: 11px;
    color: #222;
    background: rgba(255,255,255,.08);
  }

  .gbc-footer{
    padding: 14px 18px 18px;
    border-top: 1px solid rgba(148,163,184,.16);
    display:flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  /* Botón flotante "Cambiar cookies" */
  .gbc-fab{
    position: fixed;
    left: 14px;
    bottom: 85px;
    z-index: var(--gb-z);
    color: #e2e8f0;
    padding: 4px 6px;
    font-family: var(--gb-font);
    font-weight: 900;
    font-size: 28px;
    cursor: pointer;
	display: flex;
    align-items: center;
  }
  .gbc-fab span {
	  font-size: 14px;
	  color: #222;
	  margin-left: 2px;
  }
  /* Bloqueo total de scroll e interacción del fondo */
	body.gbc-lock{
	  overflow: hidden !important;
	  height: 100vh;
	  touch-action: none;
	}
	
	/* ===== Fix modal en móvil: evitar que se corte ===== */
.gbc-modal{
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 36px); /* 18px padding overlay arriba + abajo */
}

.gbc-modalHeader,
.gbc-footer{
  flex: 0 0 auto;
}

.gbc-body{
  flex: 1 1 auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* En móviles pequeños, menos padding en overlay para ganar alto útil */
@media (max-width: 480px){
  .gbc-modalOverlay{
    padding: 10px;
  }
  .gbc-modal{
    max-height: calc(100dvh - 20px);
    border-radius: 18px;
  }
}

@media (max-width: 480px){
  .gbc-table{
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* ===== Modal: que en móvil ocupe TODO el ancho útil ===== */
.gbc-modalOverlay{
  padding: 10px;                 /* menos margen en móvil */
}

.gbc-modal{
  width: 100%;
  max-width: 100%;
  border-radius: 18px;
}

/* Si el navegador soporta safe-area (iPhone notch), respétalo */
@supports (padding: max(0px)){
  .gbc-modalOverlay{
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
}

/* ===== Tabla: sin scroll horizontal en móvil ===== */
.gbc-table{
  width: 100%;
  table-layout: fixed;            /* clave: obliga a encajar en el ancho */
}

.gbc-table th,
.gbc-table td{
  white-space: normal;            /* permite saltos de línea */
  overflow-wrap: anywhere;        /* rompe palabras largas */
  word-break: break-word;
}

/* En móvil, reducimos “ruido”: quitamos columnas secundarias */
@media (max-width: 640px){
  .gbc-table{
    font-size: 12px;
  }
  .gbc-table th, .gbc-table td{
    padding: 8px 6px;
  }

  /* Ocultar Proveedor (3ª) y Duración (4ª) */
  .gbc-table th:nth-child(3),
  .gbc-table td:nth-child(3),
  .gbc-table th:nth-child(4),
  .gbc-table td:nth-child(4){
    display: none;
  }

  /* Badge más compacto */
  .gbc-badge{
    font-size: 10px;
    padding: 2px 6px;
  }
}

@media (max-width: 640px){
  .gbc-footer{
    justify-content: center;
    gap: 8px;
  }
  .gbc-btn{
    padding: 10px 12px;
    font-size: 12.5px;
  }
}
