/* Bimmer Privacy — usa las variables de color de la web (con valores de respaldo). */
.bp-banner,
.bp-modal,
.bp-reopen,
.bp-cookie-table {
  --bp-blue: var(--blue-m, #00afef);
  --bp-purple: var(--purple-m, #3d4095);
  --bp-orange: var(--orange, #fea120);
  --bp-dark: var(--dark, #222330);
  --bp-deep: var(--deep-dark, #060716);
  --bp-light: var(--light, #f4f4f4);
  --bp-muted: var(--gris-medio, #979fb4);
}

/* Botones: mismo mecanismo que .cta--primary / .cta--secondary / .cta--tertiary de la web.
   El degradado va en un ::after del doble de alto anclado abajo, así su centro queda en el borde
   superior del botón; al pasar el ratón baja y se amplía. */
.bp-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 24px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background-color: transparent;
  font-family: "Saira", sans-serif;
  font-size: 14px;
  font-style: italic;
  font-weight: 600;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  cursor: pointer;
  transition: all .3s ease;
}
.bp-btn:hover { color: #fff; transform: scale(1.1); }
.bp-btn:focus-visible { outline: 2px solid var(--bp-orange); outline-offset: 2px; }
.bp-btn--primary,
.bp-btn--secondary {
  border-bottom: 3px solid;
}
.bp-btn--primary::after,
.bp-btn--secondary::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: -1;
  width: 100%;
  height: 200%;
  transition: all .3s ease;
}
.bp-btn--primary:hover::after,
.bp-btn--secondary:hover::after {
  bottom: -50%;
  transform: scale(1.6);
}
.bp-btn--primary {
  border-bottom-color: var(--primary, #1d7ac4);
  box-shadow: var(--neon-blue, 0 10px 20px -8px rgba(29, 122, 196, .5));
}
.bp-btn--primary::after { background: radial-gradient(ellipse at center, var(--bp-blue), var(--bp-purple)); }
.bp-btn--primary:hover { box-shadow: var(--neon-blue-hover, 0 10px 30px -5px rgba(29, 122, 196, .7)); }
.bp-btn--secondary {
  border-bottom-color: #ff7b00;
  box-shadow: var(--neon-orange, 0 10px 20px -8px rgba(254, 161, 32, .5));
}
.bp-btn--secondary::after { background: radial-gradient(ellipse at center, var(--bp-orange), var(--red-m, #ed3237)); }
.bp-btn--secondary:hover { box-shadow: var(--neon-orange-hover, 0 10px 30px -5px rgba(254, 161, 32, .7)); }
.bp-btn--outline {
  border: 1px solid var(--bp-blue);
}
.bp-btn--outline:hover {
  background-color: rgba(0, 175, 239, .12);
  box-shadow: var(--neon-blue, 0 10px 20px -8px rgba(29, 122, 196, .5));
}

/* Banner (primera capa) */
.bp-banner {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 99998;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(460px, calc(100vw - 40px));
  padding: 22px;
  border-top: 1px solid rgba(151, 159, 180, .45);
  border-radius: 14px;
  background: linear-gradient(134deg, rgba(34, 35, 48, .96), rgba(6, 7, 22, .97));
  box-shadow: 0 25px 55px -10px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 175, 239, .15);
  backdrop-filter: blur(10px);
  color: var(--bp-light);
  font-size: 14px;
  line-height: 1.55;
  animation: bp-in .5s cubic-bezier(.2, .8, .2, 1) both;
}
.bp-banner[hidden] { display: none; }
.bp-banner__title {
  margin: 0 0 6px;
  font-family: "Saira", sans-serif;
  font-size: 20px;
  font-style: italic;
  font-weight: 700;
  color: #fff;
}
.bp-banner__text { margin: 0; color: var(--bp-muted); }
.bp-banner__text a { color: var(--bp-blue); }
.bp-banner__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.bp-banner__actions .bp-btn { flex: 1 1 auto; padding: 8px 16px; white-space: nowrap; }

/* Panel de preferencias (segunda capa) */
.bp-modal {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-top: 1px solid rgba(151, 159, 180, .45);
  border-radius: 16px;
  background: linear-gradient(134deg, #222330, #060716);
  color: var(--bp-light);
  box-shadow: 0 30px 70px -10px rgba(0, 0, 0, .7);
}
.bp-modal::backdrop { background: rgba(6, 7, 22, .75); backdrop-filter: blur(4px); }
.bp-modal__inner { display: flex; flex-direction: column; gap: 16px; padding: 24px; margin: 0; }
.bp-modal__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.bp-modal__title { margin: 0; font-family: "Saira", sans-serif; font-size: 24px; font-style: italic; font-weight: 700; color: #fff; }
.bp-modal__close { width: 40px; height: 40px; border: 1px solid var(--bp-blue); border-radius: 50%; background: transparent; color: #fff; font-size: 22px; cursor: pointer; }
.bp-modal__intro { margin: 0; color: var(--bp-muted); font-size: 14px; }
.bp-modal__intro a { color: var(--bp-blue); }
.bp-modal__cats { display: flex; flex-direction: column; gap: 12px; }
.bp-cat { padding: 14px 16px; border-radius: 10px; background: rgba(255, 255, 255, .04); border-top: 1px solid rgba(151, 159, 180, .2); }
.bp-cat__row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.bp-cat__label { font-weight: 600; color: #fff; cursor: pointer; }
.bp-cat__desc { margin: 6px 0 0; font-size: 13px; color: var(--bp-muted); }
.bp-cat__list { margin-top: 8px; font-size: 12px; color: var(--bp-muted); }
.bp-cat__list summary { cursor: pointer; color: var(--bp-blue); }
.bp-cat__list ul { margin: 8px 0 0; padding-left: 18px; }
.bp-cat__list li { margin-bottom: 4px; }
.bp-modal__id { margin: 0; font-size: 12px; color: var(--bp-muted); }
.bp-modal__id code { color: var(--bp-light); word-break: break-all; }
.bp-modal__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.bp-modal__actions .bp-btn { flex: 1 1 auto; white-space: nowrap; }

/* Interruptor */
.bp-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.bp-switch input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.bp-switch input:disabled { cursor: not-allowed; }
.bp-switch__track { position: absolute; inset: 0; border-radius: 26px; background: #3a3c4e; transition: background-color .25s ease; }
.bp-switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .25s ease; }
.bp-switch input:checked + .bp-switch__track { background: linear-gradient(90deg, var(--bp-blue), var(--bp-purple)); }
.bp-switch input:checked + .bp-switch__track::after { transform: translateX(20px); }
.bp-switch input:disabled + .bp-switch__track { opacity: .6; }
.bp-switch input:focus-visible + .bp-switch__track { outline: 2px solid var(--bp-orange); outline-offset: 2px; }

/* Botón flotante para volver a abrir las preferencias */
.bp-reopen {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 99990;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--bp-blue);
  border-radius: 50%;
  background: rgba(6, 7, 22, .85);
  color: var(--bp-blue);
  cursor: pointer;
  transition: box-shadow .2s ease, transform .2s ease;
}
.bp-reopen:hover { transform: scale(1.08); box-shadow: 0 0 18px rgba(0, 175, 239, .45); }
.bp-reopen svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.bp-reopen svg circle { fill: currentColor; stroke: none; }
.bp-banner:not([hidden]) ~ .bp-reopen { display: none; }

/* Tabla de cookies de la política */
.bp-cookie-table { display: flex; flex-direction: column; gap: 12px; margin: 24px 0; }
.bp-cookie-table__cat { border-radius: 12px; background: rgba(255, 255, 255, .04); border-top: 1px solid rgba(151, 159, 180, .25); padding: 4px 18px; }
.bp-cookie-table__cat summary { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; cursor: pointer; font-weight: 600; color: #fff; }
.bp-cookie-table__count { min-width: 28px; padding: 2px 8px; border-radius: 999px; background: rgba(0, 175, 239, .15); color: var(--bp-blue); font-size: 12px; text-align: center; }
.bp-cookie-table__desc, .bp-cookie-table__empty { margin: 0 0 12px; font-size: 14px; color: var(--bp-muted); }
.bp-cookie-table__item { display: grid; grid-template-columns: 130px 1fr; gap: 4px 16px; margin: 0 0 14px; padding: 12px 0 0; border-top: 1px solid rgba(151, 159, 180, .15); font-size: 14px; }
.bp-cookie-table__item dt { color: var(--bp-muted); }
.bp-cookie-table__item dd { margin: 0; }
.bp-cookie-table__note { font-size: 13px; color: var(--bp-muted); }
.bp-tag { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: rgba(254, 161, 32, .15); color: var(--bp-orange); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.bp-tag--own { background: rgba(0, 175, 239, .15); color: var(--bp-blue); }

@keyframes bp-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

@media (max-width: 767px) {
  .bp-banner { left: 12px; right: 12px; bottom: 12px; width: auto; padding: 18px; }
  .bp-cookie-table__item { grid-template-columns: 1fr; }
  .bp-cookie-table__item dt { margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .bp-banner { animation: none; }
}
