/* ============================================================
   Component: Cookie Consent Banner
============================================================ */

#cookie-consent-banner {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40000;

  display: none;
  flex-direction: column;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 24px;

  overflow: hidden;
  overscroll-behavior: contain;

  font-family: var(--font);
  color: var(--text-dark);

  background: rgb(var(--rgb-white) / .78);
  border: 1px solid rgb(var(--rgb-blue) / .16);
  border-radius: 18px;

  /* box-shadow:
    0 22px 60px rgb(var(--rgb-blue) / .12),
    inset 0 0 0 1px rgb(var(--rgb-white) / .48); */

  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

#cookie-consent-banner::before {
  content: "";
  position: absolute;
  top: -48px;
  right: -44px;
  width: 150px;
  height: 150px;
  border-radius: 24px;
  transform: rotate(35deg);
  background: linear-gradient(
    135deg,
    rgb(var(--rgb-teal) / .32),
    rgb(var(--rgb-blue) / .22)
  );
  filter: blur(12px);
  pointer-events: none;
}

#cookie-consent-banner h3,
#cookie-consent-banner p,
#cookie-consent-banner .cookie-consent-options,
#cookie-consent-banner .cookie-consent-buttons {
  position: relative;
  z-index: 1;
}

#cookie-consent-banner h3 {
  margin: 0 0 12px;
  color: var(--color-black);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

#cookie-consent-banner p {
  margin: 0 0 20px;
  color: rgb(var(--rgb-ink) / .68);
  font-size: 0.78rem;
  line-height: 1.7;
}

#cookie-consent-banner .cookie-consent-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
  padding: 16px;

  background: rgb(var(--rgb-blue) / .045);
  border: 1px solid rgb(var(--rgb-blue) / .10);
  border-radius: 14px;
}

#cookie-consent-banner label {
  display: flex;
  align-items: center;
  gap: 10px;

  color: rgb(var(--rgb-ink) / .78);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
}

#cookie-consent-banner label input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 16px;
  accent-color: var(--color-blue);
}

#cookie-consent-banner label input:disabled {
  opacity: .55;
  cursor: not-allowed;
}

#cookie-consent-banner .cookie-consent-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#cookie-consent-banner .cookie-consent-buttons button {
  appearance: none;
  min-height: 42px;
  padding: 10px 14px;

  border-radius: 999px;
  border: 1px solid transparent;

  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;

  transition:
    transform .18s ease,
    box-shadow .18s ease,
    background .18s ease,
    border-color .18s ease,
    color .18s ease,
    filter .18s ease;
}

#cookie-consent-banner .cookie-consent-buttons button:hover {
  transform: translateY(-1px);
}

#cookie-consent-banner .cookie-consent-buttons button:focus-visible {
  outline: none;
  /* box-shadow: 0 0 0 4px rgb(var(--rgb-blue) / .10); */
}

/* Reject All */
#cookie-consent-banner .cookie-consent-buttons button:nth-of-type(1) {
  background: transparent;
  color: rgb(var(--rgb-ink) / .58);
  border-color: rgb(var(--rgb-blue) / .14);
}

/* Accept Selection */
#cookie-consent-banner .cookie-consent-buttons button:nth-of-type(2) {
  background: rgb(var(--rgb-white) / .42);
  color: var(--color-blue);
  border-color: rgb(var(--rgb-blue) / .24);
}

/* Accept All */
#cookie-consent-banner .cookie-consent-buttons button:nth-of-type(3) {
  color: var(--color-white);
  background: linear-gradient(90deg, var(--color-blue), var(--color-teal));
  /* box-shadow: 0 10px 28px rgb(var(--rgb-blue) / .20); */
}

#cookie-consent-banner .cookie-consent-buttons button:nth-of-type(1):hover,
#cookie-consent-banner .cookie-consent-buttons button:nth-of-type(2):hover {
  color: var(--color-blue);
  background: rgb(var(--rgb-white) / .56);
  border-color: rgb(var(--rgb-blue) / .28);
}

#cookie-consent-banner .cookie-consent-buttons button:nth-of-type(3):hover {
  filter: brightness(1.05);
  /* box-shadow: 0 14px 34px rgb(var(--rgb-blue) / .28); */
}

@media (max-width: 900px) {
  #cookie-consent-banner {
    right: 20px;
    left: 20px;
    bottom: 20px;
    width: auto;
    max-height: calc(100dvh - 40px);
    padding: 20px;
  }
}

@media (max-width: 600px) {
  #cookie-consent-banner {
    right: 12px;
    left: 12px;
    bottom: 12px;
    padding: 16px;
    border-radius: 16px;
  }

  #cookie-consent-banner h3 {
    font-size: 0.98rem;
  }

  #cookie-consent-banner p {
    font-size: 0.76rem;
    margin-bottom: 14px;
  }

  #cookie-consent-banner .cookie-consent-options {
    grid-template-columns: 1fr;
    padding: 12px;
    margin-bottom: 14px;
  }

  #cookie-consent-banner .cookie-consent-buttons {
    grid-template-columns: 1fr;
  }

  #cookie-consent-banner .cookie-consent-buttons button {
    min-height: 44px;
  }
}