/* ══════════════════════════════════════════════════════════════════════════
   Cookie Consent Banner — KalkulatorTempa.pl
══════════════════════════════════════════════════════════════════════════ */

/* Domyślnie ukryty — JS pokaże go tylko gdy brak zgody */
#cookie-banner {
  display: none;
}

#cookie-banner.cookie-visible {
  display: flex;
}

#cookie-banner.cookie-hidden {
  display: flex; /* musi być flex podczas animacji wyjścia */
  animation: cookie-slide-down 0.28s cubic-bezier(0.55, 0, 1, 0.45) both;
}

/* ── Layout banera ───────────────────────────────────────────────────────── */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;

  /* Glass */
  background: rgba(14, 14, 26, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.50);

  padding: 14px 16px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));

  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;

  animation: cookie-slide-up 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cookie-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}
@keyframes cookie-slide-down {
  from { transform: translateY(0);   opacity: 1; }
  to   { transform: translateY(110%); opacity: 0; }
}

/* Ikona */
.cookie-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
  padding-top: 2px;
}

/* Tekst */
.cookie-text {
  flex: 1;
  min-width: 180px;
  font-size: 0.81rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.5;
}

.cookie-text a {
  color: rgba(255, 120, 60, 0.90);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
  transition: color 0.15s;
}
.cookie-text a:hover { color: #ff7340; }

/* Przyciski */
.cookie-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex-shrink: 0;
  width: 100%;
}

/* Wspólne style przycisków */
.cookie-btn-all,
.cookie-btn-essential {
  display: block;
  width: 100%;
  padding: 10px 18px;
  font-size: 0.80rem;
  font-weight: 800;
  font-family: var(--font, 'Inter', sans-serif);
  letter-spacing: 0.01em;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

/* Akceptuję wszystkie — pomarańczowy primary */
.cookie-btn-all {
  color: #ffffff;
  background: linear-gradient(135deg, #ff4500 0%, #e03c00 100%);
  border: 1.5px solid rgba(255, 100, 50, 0.6);
  box-shadow: 0 2px 12px rgba(255, 69, 0, 0.35);
}
.cookie-btn-all:hover {
  background: linear-gradient(135deg, #ff5a1a 0%, #ff4500 100%);
  box-shadow: 0 4px 20px rgba(255, 69, 0, 0.55);
  transform: translateY(-1px);
}
.cookie-btn-all:active { transform: translateY(0); }

/* Tylko niezbędne — szklany secondary */
.cookie-btn-essential {
  color: rgba(255, 255, 255, 0.70);
  background: rgba(255, 255, 255, 0.07);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
}
.cookie-btn-essential:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.30);
  color: rgba(255, 255, 255, 0.90);
}

/* Light mode */
html:not(.dark) #cookie-banner {
  background: rgba(20, 20, 40, 0.94);
}

/* ── Tablet/Desktop ≥ 560px ──────────────────────────────────────────────── */
@media (min-width: 560px) {
  #cookie-banner {
    align-items: center;
    gap: 14px;
    flex-wrap: nowrap;
  }

  .cookie-text {
    font-size: 0.84rem;
    min-width: 220px;
  }

  .cookie-actions {
    flex-direction: row;
    width: auto;
    gap: 8px;
  }

  .cookie-btn-all,
  .cookie-btn-essential {
    width: auto;
    padding: 10px 20px;
    font-size: 0.82rem;
  }
}

@media (min-width: 768px) {
  #cookie-banner {
    padding: 16px 32px;
    padding-bottom: 16px;
    gap: 20px;
  }

  .cookie-btn-all,
  .cookie-btn-essential {
    padding: 10px 22px;
    font-size: 0.84rem;
  }
}
