/* Brúfol — banner de consentimiento y modal de cookies (paleta neutra) */

.brufol-cookiebar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9998;
  padding: 16px;
  pointer-events: none;
}

.brufol-cookiebar[hidden],
.brufol-consent-known .brufol-cookiebar {
  display: none !important;
}

.brufol-cookiebar__inner {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 18px 22px;
  border: 1px solid #334155;
  border-radius: 14px;
  background:
    radial-gradient(circle at 92% 10%, rgba(59, 130, 246, 0.18), transparent 45%),
    linear-gradient(135deg, #1E293B, #0F172A);
  color: #E2E8F0;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.4);
}

.brufol-cookiebar__text {
  flex: 1 1 520px;
  min-width: 0;
}

.brufol-cookiebar__title {
  margin: 0 0 6px;
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.25;
}

.brufol-cookiebar__text p:not(.brufol-cookiebar__title) {
  margin: 0 0 8px;
  color: #CBD5E1;
  font-size: 0.86rem;
  line-height: 1.55;
}

.brufol-cookiebar__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 !important;
  font-size: 0.8rem !important;
}

.brufol-cookiebar__links a {
  color: #93C5FD;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.brufol-cookiebar__links a:hover {
  color: #FFFFFF;
}

.brufol-cookiebar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.brufol-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.brufol-btn--primary {
  background: #2563EB;
  border-color: #2563EB;
  color: #FFFFFF;
}

.brufol-btn--primary:hover {
  background: #1D4ED8;
  border-color: #1D4ED8;
  color: #FFFFFF;
}

.brufol-btn--ghost {
  background: transparent;
  border-color: #475569;
  color: #E2E8F0;
}

.brufol-btn--ghost:hover {
  background: rgba(59, 130, 246, 0.16);
  border-color: #3B82F6;
  color: #FFFFFF;
}

.brufol-btn--outline {
  background: transparent;
  border-color: #2563EB;
  color: #2563EB;
}

.brufol-btn--outline:hover {
  background: #EFF6FF;
  border-color: #1D4ED8;
  color: #1D4ED8;
}

.brufol-linkbtn {
  padding: 6px 4px;
  border: 0;
  background: none;
  color: #93C5FD;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.brufol-linkbtn:hover {
  color: #FFFFFF;
}

/* Modal */
.brufol-cookiemodal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.brufol-cookiemodal.is-visible {
  display: flex;
}

.brufol-cookiemodal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.brufol-cookiemodal__dialog {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 26px;
  border: 1px solid #D1D5DB;
  border-radius: 16px;
  background: #FFFFFF;
  color: #1F2937;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
}

.brufol-cookiemodal__dialog h2 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 1.45rem;
}

.brufol-cookiemodal__intro {
  margin: 0 0 18px;
  color: #6B7280;
  font-size: 0.9rem;
}

.brufol-cookielist {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.brufol-cookiecat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  background: #FFFFFF;
}

.brufol-cookiecat__text strong {
  display: block;
  margin-bottom: 3px;
  color: #111827;
  font-size: 0.92rem;
}

.brufol-cookiecat__text p {
  margin: 0;
  color: #6B7280;
  font-size: 0.82rem;
  line-height: 1.5;
}

.brufol-cookiecat__state {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 999px;
  background: #F3F4F6;
  color: #374151;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brufol-cookiemodal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Interruptor */
.brufol-switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  cursor: pointer;
}

.brufol-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.brufol-switch__slider {
  position: relative;
  display: block;
  width: 44px;
  height: 25px;
  border-radius: 999px;
  background: #D1D5DB;
  transition: background 0.2s ease;
}

.brufol-switch__slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.brufol-switch input:checked + .brufol-switch__slider {
  background: #2563EB;
}

.brufol-switch input:checked + .brufol-switch__slider::after {
  transform: translateX(19px);
}

.brufol-switch input:focus-visible + .brufol-switch__slider {
  outline: 3px solid #3B82F6;
  outline-offset: 2px;
}

/* Espacio para la barra fija: el pie marrón se extiende bajo el banner */
body.brufol-cookiebar-open .site-footer {
  padding-bottom: 200px;
}

/* Botón de reapertura */
.brufol-cookie-reopen {
  padding: 0;
  border: 0;
  background: none;
  color: #BFDBFE;
  font-family: var(--font-body);
  font-size: 0.8rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.brufol-cookie-reopen:hover {
  color: #FFFFFF;
}

.entry-content .brufol-cookie-reopen {
  color: #2563EB;
  font-size: 0.95rem;
  font-weight: 600;
}

.entry-content .brufol-cookie-reopen:hover {
  color: #1D4ED8;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

/* Responsive */
@media (max-width: 782px) {
  .brufol-cookiebar {
    padding: 10px;
  }

  .brufol-cookiebar__inner {
    padding: 16px;
  }

  .brufol-cookiebar__actions {
    width: 100%;
  }

  .brufol-cookiebar__actions .brufol-btn {
    flex: 1 1 auto;
  }

  .brufol-cookiemodal__dialog {
    padding: 20px;
  }

  .brufol-cookiecat {
    align-items: flex-start;
  }

  body.brufol-cookiebar-open .site-footer {
    padding-bottom: 340px;
  }
}

@media (max-width: 480px) {
  .brufol-cookiebar__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .brufol-cookiebar__actions .brufol-btn,
  .brufol-cookiebar__actions .brufol-linkbtn {
    width: 100%;
    text-align: center;
  }

  .brufol-cookiemodal__actions {
    flex-direction: column;
  }

  .brufol-cookiemodal__actions .brufol-btn {
    width: 100%;
  }
}
