/* ============================================================
   Cookie Banner — Grafmen — pill/capsule style
   Matowe szkło, zaokrąglenia 12px, dwa przyciski: [Prywatność] [Zamknij].
   ============================================================ */

/* Kontener — wrapper dla pill + panelu info (absolute wewnątrz fixed) */
#cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  left: max(24px, env(safe-area-inset-left, 0px));
  z-index: 9000;
  display: inline-block;

  /* animacja wejścia/wyjścia */
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#cookie-banner.cb-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#cookie-banner.cb-hiding {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

/* ── Kapsułka / Pasek Prywatności (matowe szkło) ── */
.cb-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 46px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-body);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
  white-space: nowrap;
}

/* Fallback dla przeglądarek bez obsługi backdrop-filter */
@supports not ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
  .cb-pill {
    background: rgba(250, 250, 252, 0.96);
  }
}

/* Przycisk "Prywatność" — subtelny, interaktywny */
.cb-btn-privacy,
.cb-btn-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 34px;
  padding: 0 12px;
  background: none;
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: #4b4b54;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.cb-btn-privacy:hover,
.cb-btn-text:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #09090b;
}

.cb-btn-privacy[aria-expanded="true"],
.cb-btn-text[aria-expanded="true"] {
  background: rgba(0, 0, 0, 0.06);
  color: var(--orange, #ff6400);
  font-weight: 600;
}

.cb-btn-privacy:focus-visible,
.cb-btn-text:focus-visible {
  outline: 2px solid var(--orange, #ff6400);
  outline-offset: 2px;
}

/* Przycisk "Zamknij" — zaokrąglenie 8px, białe tło */
.cb-btn-close,
.cb-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 34px;
  padding: 0 14px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: #09090b;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.cb-btn-close:hover,
.cb-btn-primary:hover {
  background: #f5f5f7;
  border-color: rgba(0, 0, 0, 0.14);
}

.cb-btn-close:focus-visible,
.cb-btn-primary:focus-visible {
  outline: 2px solid var(--orange, #ff6400);
  outline-offset: 2px;
}

/* ── Panel Informacyjny (pojawia się nad kapsułką) ── */
.cb-info-panel {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  width: 300px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  padding: 16px;
  font-family: var(--font-body);
}

.cb-info-panel[hidden] {
  display: none;
}

.cb-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.cb-info-title {
  font-size: 13px;
  font-weight: 600;
  color: #09090b;
}

.cb-info-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
  color: #72727a;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.cb-info-close:hover {
  background: #f1f1f3;
  color: #09090b;
}

.cb-info-close:focus-visible {
  outline: 2px solid var(--orange, #ff6400);
  outline-offset: 2px;
}

.cb-info-text {
  font-size: 13px;
  line-height: 1.55;
  color: #62626b;
  margin: 0 0 12px;
}

.cb-info-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--orange, #ff6400);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.cb-info-link:hover {
  text-decoration: none;
  color: #e05800;
}

.cb-info-link:focus-visible {
  outline: 2px solid var(--orange, #ff6400);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Mobile ── */
@media (max-width: 820px) {
  #cookie-banner {
    /* nad dolnym paskiem fluid glass menu i przyciskiem powrotu */
    bottom: max(72px, calc(72px + env(safe-area-inset-bottom, 0px)));
    left: max(16px, env(safe-area-inset-left, 0px));
  }

  .cb-info-panel {
    width: min(300px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
  }
}
