/* ==========================================================================
   Cookie Consent Banner
   Zgodny z RODO, PKE (ex art. 173 PT) i wytycznymi UODO 03/2025
   ========================================================================== */

.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--dark-green);
  color: var(--white);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 -2px 15px rgba(0,0,0,0.25);
  z-index: 1000;
  display: none;
  font-family: 'Open Sans', sans-serif;
  /* UODO: baner nie wyzszy niz 20% wysokosci ekranu */
  max-height: 20vh;
  overflow-y: auto;
}

.cookie-consent.active {
  display: block;
  animation: slideUp 0.5s ease;
}

.cookie-consent.expanded {
  max-height: 90vh;
}

.cookie-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.cookie-text {
  flex: 1;
  min-width: 280px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.cookie-text strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
  color: var(--accent-gold);
}

.cookie-text a {
  color: var(--accent-gold);
  text-decoration: underline;
  font-weight: 600;
}

.cookie-text a:hover,
.cookie-text a:focus {
  text-decoration: none;
}

/* Przyciski - rownowazne wizualnie (wymog UODO) */
.cookie-buttons {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.cookie-btn {
  padding: 0.7rem 1.4rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transition);
  border: 2px solid var(--accent-gold);
  min-width: 140px;
  text-align: center;
  font-family: inherit;
}

/* Akceptuj i Odrzuc - identyczna waga wizualna */
.cookie-btn-accept,
.cookie-btn-reject {
  background: var(--accent-gold);
  color: var(--dark-green);
}

.cookie-btn-accept:hover,
.cookie-btn-accept:focus,
.cookie-btn-reject:hover,
.cookie-btn-reject:focus {
  background: #FFC700;
  outline: none;
  transform: translateY(-1px);
}

.cookie-btn-settings {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.cookie-btn-settings:hover,
.cookie-btn-settings:focus {
  background: rgba(255,255,255,0.1);
  outline: none;
}

/* Panel ustawien */
.cookie-settings {
  display: none;
  width: 100%;
  padding-top: 1.25rem;
  margin-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.25);
}

.cookie-settings.active {
  display: block;
}

.cookie-categories {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

.cookie-category {
  background: rgba(255,255,255,0.08);
  padding: 1rem;
  border-radius: 6px;
}

.cookie-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  gap: 1rem;
}

.cookie-category-title {
  font-weight: 700;
  font-size: 1rem;
}

.cookie-category-description {
  font-size: 0.88rem;
  opacity: 0.95;
  line-height: 1.5;
}

/* Toggle switch */
.cookie-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  flex-shrink: 0;
}

.cookie-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #888;
  transition: 0.3s;
  border-radius: 26px;
}

.cookie-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.cookie-switch input:checked + .cookie-slider {
  background-color: var(--accent-gold);
}

.cookie-switch input:checked + .cookie-slider::before {
  transform: translateX(24px);
}

.cookie-switch input:disabled + .cookie-slider {
  background-color: var(--primary-green);
  cursor: not-allowed;
  opacity: 0.7;
}

.cookie-switch input:focus + .cookie-slider {
  box-shadow: 0 0 0 2px var(--accent-gold);
}

/* Floating settings button (po zamknieciu) */
.cookie-floating-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--dark-green);
  color: var(--accent-gold);
  border: 2px solid var(--accent-gold);
  cursor: pointer;
  font-size: 1.4rem;
  z-index: 999;
  display: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: var(--transition);
  align-items: center;
  justify-content: center;
}

.cookie-floating-btn.visible {
  display: flex;
}

.cookie-floating-btn:hover,
.cookie-floating-btn:focus {
  background: var(--primary-green);
  transform: scale(1.1);
  outline: none;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@media (max-width: 768px) {
  .cookie-consent {
    padding: 1rem;
    max-height: 35vh;
  }

  .cookie-content {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-text {
    text-align: center;
  }

  .cookie-buttons {
    flex-direction: column;
  }

  .cookie-btn {
    width: 100%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-consent {
    animation: none;
  }
  .cookie-slider,
  .cookie-slider::before,
  .cookie-floating-btn {
    transition: none;
  }
}
