/* ===== Widgety: cookies + dostępność (jak na stronach abonenckich) ===== */

/* Cookie Popup */
.cookie-popup,
.cookie-settings {
  position: fixed;
  inset: 0;
  animation: cookieFadeIn .3s ease-out;
}

.cookie-popup { z-index: 99999; }
.cookie-settings { z-index: 100000; }

.cookie-popup-backdrop,
.cookie-settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.cookie-popup-modal,
.cookie-settings-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25);
  animation: cookieSlideUp .3s ease-out;
}

.cookie-popup-modal {
  padding: 40px;
  max-width: 500px;
  width: 90%;
  text-align: center;
}

.cookie-settings-modal {
  max-width: 700px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
}

.cookie-popup-icon { font-size: 60px; margin-bottom: 20px; }

.cookie-popup-header h2 {
  margin: 0 0 15px;
  font-size: 28px;
  font-weight: 700;
  color: #1f2937;
}

.cookie-popup-header p {
  margin: 0 0 30px;
  color: #6b7280;
  font-size: 16px;
  line-height: 1.6;
}

.cookie-popup-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.cookie-popup-actions button {
  width: 100%;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .3s;
  border: none;
}

.btn-accept-all { background: var(--blue); color: #fff; }
.btn-accept-all:hover { background: var(--blue-dark); transform: translateY(-1px); box-shadow: 0 10px 20px -10px rgba(15, 98, 254, .5); }

.btn-reject { background: #f3f4f6; color: #374151; border: 2px solid #e5e7eb; }
.btn-reject:hover { background: #e5e7eb; }

.btn-settings { background: transparent; color: var(--blue); border: 2px solid var(--blue); }
.btn-settings:hover { background: var(--blue); color: #fff; }

.cookie-popup-links { font-size: 14px; }

.cookie-popup-links a { color: #6b7280; text-decoration: underline; }
.cookie-popup-links a:hover { color: var(--blue); }

/* Cookie Settings modal */
.close-button {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 30px;
  color: #6b7280;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all .3s;
  z-index: 1;
}

.close-button:hover { background: #f3f4f6; color: #1f2937; }

.cookie-settings-header {
  padding: 40px 40px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.cookie-settings-header h2 { margin: 0 0 10px; font-size: 24px; font-weight: 700; color: #1f2937; }
.cookie-settings-header p { margin: 0; color: #6b7280; font-size: 16px; }

.cookie-settings-body { padding: 30px 40px; }

.cookie-category {
  margin-bottom: 25px;
  padding-bottom: 25px;
  border-bottom: 1px solid #e5e7eb;
}

.cookie-category:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }

.cookie-category-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.cookie-category-info { flex: 1; }

.cookie-category-info h3 { margin: 0 0 8px; font-size: 18px; font-weight: 600; color: #1f2937; }
.cookie-category-info p { margin: 0 0 10px; color: #6b7280; font-size: 14px; line-height: 1.5; }

.cookie-details { margin-top: 10px; font-size: 14px; color: #6b7280; }
.cookie-details summary { cursor: pointer; color: var(--blue); font-weight: 500; }
.cookie-details ul { margin: 10px 0 0 20px; padding: 0; list-style: disc; }
.cookie-details li { margin: 5px 0; }

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

.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background-color: #cbd5e1;
  transition: .4s;
  border-radius: 26px;
}

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

input:checked + .slider { background-color: var(--blue); }
input:checked + .slider:before { transform: translateX(24px); }

.cookie-toggle input[type="checkbox"]:disabled + label { color: #9ca3af; }

.cookie-settings-footer {
  padding: 20px 40px 30px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.cookie-settings-footer button {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .3s;
}

.cookie-settings-footer .btn-secondary { background: #fff; border: 2px solid #e5e7eb; color: #374151; }
.cookie-settings-footer .btn-secondary:hover { background: #f3f4f6; }

.cookie-settings-footer .btn-primary { background: var(--blue); border: none; color: #fff; }
.cookie-settings-footer .btn-primary:hover { background: var(--blue-dark); }

body.cookie-popup-open { overflow: hidden; }

/* ===== Pływający stos (prawy dolny róg): czat → cookies → dostępność =====
   Wszystkie przyciski równe: 60px, ten sam styl. */

/* Własny przycisk czatu (natywna ikonka Tawk bywa bardzo mała — używamy Tawk_API) */
.chat-launcher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(15, 98, 254, .4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .3s ease;
  animation: cookieSlideInRight .5s ease-out .5s both;
}

.chat-launcher:hover {
  background: var(--blue-dark);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(15, 98, 254, .5);
}

.chat-launcher:active { transform: scale(.95); }

/* Pływający przycisk ustawień cookies */
.cookie-settings-button {
  position: fixed;
  bottom: 88px;
  right: 20px;
  left: auto;
  z-index: 9999;
  animation: cookieSlideInRight .5s ease-out .5s both;
}

.cookie-settings-button button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(15, 98, 254, .4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .3s ease;
}

.cookie-settings-button button:hover {
  background: var(--blue-dark);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(15, 98, 254, .5);
}

.cookie-settings-button button:active { transform: scale(.95); }

/* Widget dostępności (a11y-widget.js) pozycjonuje własny przycisk sam —
   ten sam rozmiar i styl co pozostałe w stosie (60px / 39px na mobile). */

/* Mobile: cały stos pomniejszony o ~35% (60 → 39px), pozycje przeliczone */
@media (max-width: 768px) {
  .chat-launcher {
    width: 39px;
    height: 39px;
  }

  .chat-launcher svg { width: 18px; height: 18px; }

  .cookie-settings-button { bottom: 67px; }

  .cookie-settings-button button {
    width: 39px;
    height: 39px;
  }

  .cookie-settings-button button svg { width: 18px; height: 18px; }
}

@keyframes cookieFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cookieSlideUp {
  from { transform: translate(-50%, calc(-50% + 20px)); opacity: 0; }
  to { transform: translate(-50%, -50%); opacity: 1; }
}

@keyframes cookieSlideInRight {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 640px) {
  .cookie-popup-modal { padding: 30px 20px; width: 95%; }
  .cookie-popup-header h2 { font-size: 24px; }
  .cookie-settings-modal { width: 95%; max-height: 90vh; }
  .cookie-settings-header,
  .cookie-settings-body,
  .cookie-settings-footer { padding-left: 20px; padding-right: 20px; }
  .cookie-category-header { flex-direction: column; gap: 15px; }
  .cookie-settings-footer { flex-direction: column; }
  .cookie-settings-footer button { width: 100%; }
}

@media (prefers-contrast: high) {
  .cookie-popup-backdrop,
  .cookie-settings-backdrop { background: rgba(0, 0, 0, .9); }
  .btn-reject,
  .btn-settings { border-width: 3px; }
}
