/**
 * Banner global de consentimiento de cookies.
 */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cookie-consent[hidden],
.cookie-consent__banner[hidden],
.cookie-consent__mini[hidden],
.cookie-consent__modal[hidden] {
  display: none !important;
}

body.has-cookie-consent-lock {
  overflow: hidden;
}

.cookie-consent {
  position: relative;
  z-index: 300;
}

.cookie-consent.cookie-consent--blocking {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: auto;
}

.cookie-consent.cookie-consent--blocking::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 31, 0.42);
}

.cookie-consent__banner {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  z-index: 1;
  width: min(100% - 2rem, 70rem);
  display: grid;
  gap: 1rem;
  padding: 1rem;
  transform: translateX(-50%);
  background: #303a42;
  color: #fff;
  border-radius: var(--radius-md);
  box-shadow: 0 1.25rem 3rem rgba(20, 28, 34, 0.25);
}

.cookie-consent__title {
  margin: 0 0 0.35rem;
  color: #fff;
  font-size: 0.9375rem;
  line-height: 1.35;
}

.cookie-consent__text {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.cookie-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.cookie-consent__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.cookie-consent__button--ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.72);
}

.cookie-consent__button--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

.cookie-consent__button--brand {
  background: var(--color-brand);
  color: #fff;
  border: 1px solid var(--color-brand);
}

.cookie-consent__button--brand:hover {
  background: var(--color-brand-hover);
  border-color: var(--color-brand-hover);
}

.cookie-consent__button--light {
  background: #fff;
  color: var(--color-text);
  border: 1px solid #dfe3e8;
}

.cookie-consent__button--light:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.cookie-consent__mini {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 0.9rem;
  background: #303a42;
  border-radius: var(--radius-md);
  box-shadow: 0 1rem 2.5rem rgba(20, 28, 34, 0.25);
}

.cookie-consent__mini-trigger,
.cookie-consent__mini-accept {
  border: 0;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.cookie-consent__mini-trigger {
  padding: 0;
  background: transparent;
  color: #fff;
  font-size: 0.875rem;
}

.cookie-consent__mini-accept {
  padding: 0.65rem 1rem;
  background: var(--color-brand);
  color: #fff;
}

.cookie-consent__modal {
  position: fixed;
  inset: 0;
  z-index: 310;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.cookie-consent__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 31, 0.48);
}

.cookie-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 48rem);
  max-height: min(45rem, calc(100vh - 2rem));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: 0 1.5rem 4rem rgba(20, 28, 34, 0.24);
}

.cookie-panel__header,
.cookie-panel__footer {
  padding: 1.5rem;
  border-color: #e6e8ec;
}

.cookie-panel__header {
  border-bottom: 1px solid #e6e8ec;
}

.cookie-panel__title {
  margin: 0;
  color: var(--color-brand);
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.2;
}

.cookie-panel__body {
  overflow: auto;
  padding: 1.5rem;
  background: #fff;
}

.cookie-item {
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.cookie-item__text {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.cookie-category {
  padding: 1.25rem;
  background: #f7f7f8;
  border-radius: var(--radius-md);
}

.cookie-category + .cookie-category {
  margin-top: 1rem;
}

.cookie-category__header {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.cookie-category__title,
.cookie-item__title {
  margin: 0;
  color: var(--color-text);
  line-height: 1.25;
}

.cookie-category__title {
  font-size: 1.25rem;
}

.cookie-item__title {
  margin-bottom: 0.65rem;
  font-size: 1rem;
}

.cookie-category__list {
  display: grid;
  gap: 0.85rem;
}

.cookie-switch {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  cursor: pointer;
}

.cookie-switch__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cookie-switch__track {
  width: 3.1rem;
  height: 1.75rem;
  border-radius: var(--radius-pill);
  background: #eceef1;
  transition: background var(--transition);
}

.cookie-switch__track::before {
  content: '';
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0.25rem 0.75rem rgba(20, 28, 34, 0.14);
  transition: transform var(--transition);
}

.cookie-switch__input:checked + .cookie-switch__track {
  background: var(--color-brand);
}

.cookie-switch__input:checked + .cookie-switch__track::before {
  transform: translateX(1.35rem);
}

.cookie-switch__input:disabled + .cookie-switch__track {
  background: #d9dde3;
  cursor: not-allowed;
}

.cookie-panel__footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-top: 1px solid #e6e8ec;
}

@media (min-width: 577px) {
  .cookie-panel__footer {
    flex-direction: row;
    justify-content: flex-end;
  }
}

@media (min-width: 768px) {
  .cookie-consent__banner {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 1.1rem 1.5rem;
  }

  .cookie-consent__actions {
    justify-content: flex-end;
  }
}
