.legal-links {
  display: flex;
  flex-direction: row !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 4vw, 54px);
  margin: 0;
  font-size: 12px;
  line-height: inherit;
  max-height: none !important;
  overflow: visible !important;
  position: static !important;
  inset: auto !important;
  width: auto;
  background: transparent !important;
  border-top: 0 !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.legal-links a {
  display: inline;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: inherit;
  opacity: 0.72;
  font: inherit;
  font-weight: inherit;
  margin: 0 !important;
  outline: 0;
  padding: 0 !important;
  text-decoration: none;
  transform: none !important;
  width: auto !important;
}

.legal-links a:hover,
.legal-links a:focus-visible {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 1;
  outline: 0;
  text-decoration: underline;
  transform: none !important;
}

footer:has(.legal-links) {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  gap: clamp(12px, 4vw, 54px) !important;
  text-align: center;
}

footer:has(.site-footer-brand) {
  flex-direction: row !important;
  gap: 10px clamp(14px, 4vw, 54px) !important;
  overflow: hidden;
  margin-bottom: 0 !important;
  padding-bottom: clamp(8px, 1.6vw, 18px) !important;
}

footer:has(.legal-links) .footer-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

footer:has(.legal-links) .texto-footer-derechos,
footer:has(.legal-links) > span,
footer:has(.legal-links) > p:not(.site-footer-brand) {
  width: auto !important;
  margin: 0 !important;
}

.site-footer-brand {
  flex-basis: 100%;
  width: min(1120px, calc(100% - 44px)) !important;
  margin: clamp(8px, 1.4vw, 16px) auto 0 !important;
  background-image: none;
  color: #8d7fba;
  -webkit-text-fill-color: #909090;
  filter: none;
  font-family: var(--font-ui);
  font-size: clamp(54px, 12.8vw, 144px);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 0.82;
  text-align: center;
  text-transform: lowercase;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.bottom-blur {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 200px;
  z-index: 40;
  opacity: 1;
  pointer-events: none;
  user-select: none;
}

.bottom-blur__inner,
.bottom-blur__inner > div {
  position: absolute;
  inset: 0;
}

.bottom-blur__inner {
  overflow: hidden;
}

.bottom-blur__inner > div {
  pointer-events: none;
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  -webkit-mask-image: var(--mask);
  mask-image: var(--mask);
}

.legal-page {
  --bg: #0b0b0f;
  --fg: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.64);
  --soft: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.14);
  --a: #f29e1e;
  --b: #9b59b6;
  min-height: 100vh;
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font-family: var(--font-ui);
  line-height: 1.6;
}

.legal-page * {
  box-sizing: border-box;
}

.legal-shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(34px, 6vw, 72px) 0 30px;
}

.legal-hero {
  margin-bottom: 22px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
}

.legal-back-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--fg);
  font-size: 13px;
  font-weight: 800;
  opacity: 0.74;
  text-decoration: none;
}

.legal-back-link:hover,
.legal-back-link:focus-visible {
  opacity: 1;
}

.legal-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.legal-page h1 {
  margin: 0 0 10px;
  font-size: clamp(34px, 7vw, 72px);
  line-height: 0.95;
  letter-spacing: 0;
}

.legal-page h2 {
  margin: 0 0 10px;
  font-size: clamp(18px, 3vw, 24px);
  line-height: 1.15;
  letter-spacing: 0;
}

.legal-page p,
.legal-page li {
  color: var(--muted);
}

.legal-page p {
  margin: 0 0 12px;
}

.legal-page ul {
  margin: 0 0 12px;
  padding-left: 20px;
}

.legal-section {
  margin-top: 14px;
  padding: clamp(18px, 3vw, 24px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.legal-page .note {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(242, 158, 30, 0.3);
  border-radius: 12px;
  background: rgba(242, 158, 30, 0.08);
  color: rgba(255, 255, 255, 0.74);
}

.legal-page .small-print {
  color: rgba(255, 255, 255, 0.48);
  font-size: 13px;
}

.legal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 26px 0 0;
}

.legal-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 13px 18px;
  border: 1px solid rgba(242, 158, 30, 0.45);
  border-radius: 18px;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 0.14s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.legal-button.secondary {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.legal-button:hover,
.legal-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(242, 158, 30, 0.74);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
  outline: none;
}

.legal-page footer {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 42px;
  color: rgba(255, 255, 255, 0.62);
  text-align: center;
}

@media (max-width: 560px) {
  footer:has(.legal-links) {
    gap: 10px 16px !important;
  }

  .legal-links {
    gap: 10px 16px;
  }

  footer:has(.legal-links) .legal-links {
    flex-wrap: nowrap;
    gap: clamp(8px, 2.7vw, 14px);
    font-size: clamp(10.5px, 2.75vw, 12px);
    line-height: 1.3;
    white-space: nowrap;
  }

  .site-footer-brand {
    width: min(1120px, calc(100% - 36px)) !important;
    margin-top: 10px !important;
    font-size: clamp(42px, 13.8vw, 60px);
    line-height: 0.86;
    white-space: nowrap;
  }

  .legal-actions {
    display: grid;
  }

  .legal-button {
    width: 100%;
  }
}

@media (max-width: 768px) {
  footer:has(.legal-links) {
    flex-direction: column !important;
    gap: 8px !important;
  }

  footer:has(.legal-links) .footer-center,
  footer:has(.legal-links) .texto-footer-derechos,
  footer:has(.legal-links) > span,
  footer:has(.legal-links) > p:not(.site-footer-brand) {
    width: 100% !important;
    justify-content: center;
    text-align: center;
  }

  footer:has(.legal-links) .legal-links {
    width: min(100%, 420px);
    flex-direction: row !important;
    flex-wrap: nowrap;
    justify-content: center;
    gap: clamp(12px, 4vw, 28px);
    font-size: clamp(11px, 2.9vw, 12px);
    line-height: 1.3;
    white-space: nowrap;
  }
}

@media (max-width: 560px) and (orientation: portrait) {
  body.immersive-ambient-page:has(main.wrap footer .legal-links) {
    min-height: 100svh;
    height: auto;
    align-items: center;
    padding: max(24px, env(safe-area-inset-top)) 14px max(24px, env(safe-area-inset-bottom));
  }

  body.immersive-ambient-page main.wrap:has(footer .legal-links) {
    padding: 22px 20px 18px;
  }

  footer:has(.legal-links):not(:has(.site-footer-brand)) {
    flex-direction: column !important;
    gap: 8px !important;
    margin-top: 12px !important;
    padding-top: 12px !important;
  }

  footer:has(.legal-links):not(:has(.site-footer-brand)) .legal-links {
    width: 100%;
    gap: clamp(8px, 2.7vw, 14px);
  }

  footer:has(.legal-links):has(.site-footer-brand) {
    flex-direction: column !important;
    gap: 8px !important;
    padding-bottom: calc(44px + env(safe-area-inset-bottom)) !important;
    overflow: visible;
    position: relative;
    z-index: 45;
  }

  footer:has(.legal-links):has(.site-footer-brand) .footer-center,
  footer:has(.legal-links):has(.site-footer-brand) .legal-links,
  footer:has(.legal-links):has(.site-footer-brand) .site-footer-brand {
    flex-basis: auto;
    order: initial;
  }

  footer:has(.legal-links):has(.site-footer-brand) .footer-center {
    order: 1;
  }

  footer:has(.legal-links):has(.site-footer-brand) .legal-links {
    order: 2;
    width: min(100%, 360px);
    flex-direction: row !important;
    gap: clamp(8px, 2.7vw, 14px);
    position: relative;
    z-index: 2;
  }

  footer:has(.legal-links):has(.site-footer-brand) .site-footer-brand {
    order: 3;
    width: min(1120px, calc(100% - 36px)) !important;
    margin-top: 6px !important;
  }

  footer:has(.site-footer-brand) {
    padding-bottom: calc(44px + env(safe-area-inset-bottom)) !important;
  }

  footer:has(.site-footer-brand) .site-footer-brand {
    margin-bottom: 0 !important;
  }

  .bottom-blur {
    height: 86px;
  }
}

@media (max-width: 360px) and (orientation: portrait) {
  footer:has(.legal-links) .legal-links {
    flex-wrap: wrap;
    white-space: normal;
  }
}
