/* Premenné pre konzistentnosť (použijú sa ak chýbajú nadradené) */
:root {
  --cookie-bg: #ffffff;
  --cookie-text: #1f2937;
  --cookie-muted: #6b7280;
  --cookie-border: #e5e7eb;
  --cookie-overlay: rgba(0, 0, 0, 0.5);
  --cookie-primary: #5ec4ab;
}

.jamal-hidden {
  display: none !important;
}

/* Hlavný Banner */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(24px);
  width: calc(100% - 48px);
  max-width: 900px;
  background: var(--cookie-bg);
  border: 1px solid var(--cookie-border);
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  z-index: 9999998;
  padding: 24px;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.38s ease,
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.42s;
}

.cookie-banner.cookie-banner-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition:
    opacity 0.38s ease,
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s;
}

.cookie-banner-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cookie-title {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--cookie-text);
}

.cookie-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--cookie-muted);
}

.cookie-content a {
  color: var(--cookie-text);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.cookie-banner .btn-sm {
  padding: 8px 14px;
  font-size: 14px;
}

/* Modálne okno */
.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cookie-modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--cookie-overlay);
  backdrop-filter: blur(4px);
}

.cookie-modal-content {
  position: relative;
  background: var(--cookie-bg);
  width: calc(100% - 32px);
  max-width: 560px;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.cookie-modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cookie-modal-header h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--cookie-text);
}

.cookie-modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.cookie-modal-close:hover {
  color: var(--cookie-text);
}

.cookie-modal-body {
  padding: 24px;
  overflow-y: auto;
}

.cookie-modal-desc {
  margin: 0 0 24px 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--cookie-muted);
}

.cookie-modal-desc a {
  color: var(--cookie-text);
}

.cookie-category {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid #f3f4f6;
}

.cookie-category:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cookie-category-info {
  padding-right: 24px;
}

.cookie-category-info strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--cookie-text);
  margin-bottom: 4px;
}

.cookie-category-info p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--cookie-muted);
}

.cookie-modal-footer {
  padding: 20px 24px 24px;
}

/* Explicitný override pre tlačidlo v modále podľa návrhu */
.cookie-modal-footer .btn {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  background-color: #0c0;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s;
  box-shadow: none;
}

.cookie-modal-footer .btn:hover {
  color: var(--text);
  background-color: rgba(17, 17, 17, 0.06);
}

/* Toggle Switch komponent */
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e2e8f0;
  transition: 0.3s;
  border-radius: 24px;
}

.cookie-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.cookie-toggle input:checked + .cookie-slider {
  background-color: #0c0;
}

.cookie-toggle input:focus + .cookie-slider {
  box-shadow: 0 0 0 2px rgba(94, 196, 171, 0.2);
}

.cookie-toggle input:checked + .cookie-slider:before {
  transform: translateX(20px);
}

.cookie-toggle input:disabled + .cookie-slider {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Responzivita */
@media (max-width: 768px) {
  .cookie-banner {
    bottom: auto;
    top: 50%;
    transform: translate(-50%, calc(-50% + 18px)) scale(0.98);
    max-height: 90vh;
    overflow-y: auto;
  }

  .cookie-banner.cookie-banner-visible {
    transform: translate(-50%, -50%) scale(1);
  }

  .cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-actions {
    flex-direction: column;
    width: 100%;
  }

  .cookie-actions button {
    width: 100%;
    justify-content: center;
  }

  .cookie-category {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .cookie-category-info {
    padding-right: 0;
  }
}