/* ==========================================================================
   SILENT ATLAS — COOKIE CONSENT & GOOGLE CONSENT MODE V2
   Estetyczny baner cookies klasy premium (Dark Obsidian & Warm Gold)
   ========================================================================== */

/* Kontener główny banera */
#sac-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  width: calc(100% - 48px);
  max-width: 480px;
  pointer-events: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Karta banera */
.sac-banner-card {
  pointer-events: auto;
  position: relative;
  background: rgba(22, 19, 16, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(223, 180, 126, 0.24);
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7),
              0 0 30px rgba(223, 180, 126, 0.12),
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: #f5ede4;
  transform: translateY(30px) scale(0.97);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.38s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.38s ease;
  overflow: hidden;
}

#sac-root.sac-active .sac-banner-card {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
}

/* Subtelny ambientowy złoty blask w rogu karty */
.sac-banner-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(223, 180, 126, 0.22) 0%, rgba(223, 180, 126, 0) 70%);
  pointer-events: none;
  border-radius: 50%;
}

/* Nagłówek */
.sac-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.sac-brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sac-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(223, 180, 126, 0.18) 0%, rgba(223, 180, 126, 0.05) 100%);
  border: 1px solid rgba(223, 180, 126, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #dfb47e;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.sac-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sac-brand-tag {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #dfb47e;
  text-transform: uppercase;
}

.sac-title {
  margin: 0;
  font-family: 'Cinzel', serif;
  font-size: 16px;
  font-weight: 600;
  color: #f5ede4;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

/* Pigułka zgodności z Consent Mode v2 */
.sac-v2-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(223, 180, 126, 0.10);
  border: 1px solid rgba(223, 180, 126, 0.25);
  font-size: 10px;
  font-weight: 600;
  color: #edd8b6;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.sac-v2-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
}

/* Treść opisowa */
.sac-description {
  font-size: 13px;
  line-height: 1.55;
  color: #b5a99e;
  margin: 0 0 18px 0;
}

.sac-description strong {
  color: #f5ede4;
  font-weight: 500;
}

/* Grupa głównych przycisków */
.sac-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sac-btn-group-primary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Style przycisków */
.sac-btn {
  position: relative;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.22s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.sac-btn:focus-visible {
  outline: 2px solid #dfb47e;
  outline-offset: 2px;
}

/* Przycisk akceptacji wszystkich oraz tylko niezbędne — zbalansowane (zakaz technik dark patterns) */
.sac-btn-accept,
.sac-btn-reject {
  background: rgba(36, 31, 26, 0.85);
  color: #f5ede4;
  border: 1px solid rgba(223, 180, 126, 0.35);
  box-shadow: none;
}

.sac-btn-accept:hover,
.sac-btn-reject:hover {
  background: rgba(52, 45, 37, 0.98);
  border-color: rgba(223, 180, 126, 0.65);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 10px rgba(223, 180, 126, 0.12);
}

.sac-btn-accept:active,
.sac-btn-reject:active {
  transform: translateY(0);
}

/* Link do polityki prywatności w treści banera */
.sac-privacy-link {
  color: #dfb47e;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease;
}

.sac-privacy-link:hover {
  color: #eed8b6;
}

/* Przycisk dostosuj preferencje */
.sac-btn-customize {
  background: transparent;
  color: #c4b5a5;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12.5px;
  font-weight: 500;
  padding: 8px 12px;
}

.sac-btn-customize:hover {
  background: rgba(223, 180, 126, 0.08);
  border-color: rgba(223, 180, 126, 0.2);
  color: #dfb47e;
}

/* ==========================================================================
   WIDOK SZCZEGÓŁOWYCH PREFERENCJI (MODAL / EXPANDED)
   ========================================================================== */
.sac-preferences-view {
  display: none;
  animation: sacFadeIn 0.28s ease;
}

#sac-root.sac-customizing .sac-summary-view {
  display: none;
}

#sac-root.sac-customizing .sac-preferences-view {
  display: block;
}

@keyframes sacFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.sac-pref-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(223, 180, 126, 0.15);
}

.sac-back-btn {
  background: none;
  border: none;
  color: #dfb47e;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.sac-back-btn:hover {
  background: rgba(223, 180, 126, 0.1);
  color: #eed8b6;
}

.sac-pref-title {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 600;
  color: #f5ede4;
  margin: 0;
}

/* Lista kategorii cookies */
.sac-categories-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 16px;
}

/* Pasek przewijania */
.sac-categories-list::-webkit-scrollbar {
  width: 4px;
}
.sac-categories-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
}
.sac-categories-list::-webkit-scrollbar-thumb {
  background: rgba(223, 180, 126, 0.25);
  border-radius: 4px;
}

.sac-category-item {
  background: rgba(30, 26, 22, 0.65);
  border: 1px solid rgba(223, 180, 126, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.sac-category-item:hover {
  background: rgba(36, 31, 26, 0.85);
  border-color: rgba(223, 180, 126, 0.24);
}

.sac-category-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.sac-cat-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sac-cat-title {
  font-size: 13px;
  font-weight: 600;
  color: #f5ede4;
}

.sac-cat-badge-required {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(223, 180, 126, 0.15);
  color: #dfb47e;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid rgba(223, 180, 126, 0.28);
}

.sac-cat-desc {
  font-size: 11.5px;
  line-height: 1.45;
  color: #9c8e82;
  margin: 0;
}

/* Własne przełączniki (Toggle Switch) */
.sac-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

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

.sac-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #2b2520;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 24px;
}

.sac-slider::before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: #8f8275;
  transition: 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.sac-switch input:checked + .sac-slider {
  background-color: #c99a61;
  border-color: #dfb47e;
  box-shadow: 0 0 10px rgba(223, 180, 126, 0.35);
}

.sac-switch input:checked + .sac-slider::before {
  transform: translateX(18px);
  background-color: #12100e;
}

.sac-switch input:disabled + .sac-slider {
  cursor: not-allowed;
  opacity: 0.65;
}

/* Przyciski w widoku preferencji */
.sac-pref-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

/* ==========================================================================
   PŁYWAJĄCY PRZYCISK TRIGGER ("Zarządzaj cookies")
   ========================================================================== */
#sac-trigger {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 99998;
  height: 38px;
  padding: 0 13px;
  background: rgba(22, 19, 16, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(223, 180, 126, 0.3);
  border-radius: 20px;
  color: #dfb47e;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.03em;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 14px rgba(223, 180, 126, 0.12);
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.95);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#sac-trigger.sac-trigger-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

#sac-trigger:hover {
  background: rgba(30, 26, 22, 0.98);
  border-color: #dfb47e;
  color: #eed8b6;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.65), 0 0 20px rgba(223, 180, 126, 0.25);
  transform: translateY(-2px);
}

#sac-trigger:focus-visible {
  outline: 2px solid #dfb47e;
  outline-offset: 2px;
}

.sac-trigger-icon {
  width: 15px;
  height: 15px;
  display: block;
}

/* ==========================================================================
   SILENT ATLAS — STOPKA W CAŁEJ DOMENIE (DOMAIN-WIDE LUXURY FOOTER)
   ========================================================================== */
#sa-footer,
.sa-footer {
  width: 100% !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  padding: 48px 24px 40px !important;
  margin: 40px 0 0 0 !important;
  border-top: 1px solid rgba(223, 180, 126, 0.12) !important;
  background: transparent !important;
  position: relative !important;
  text-align: center !important;
}

#sa-footer::before,
.sa-footer::before {
  content: '' !important;
  position: absolute !important;
  top: -1px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: min(500px, 80%) !important;
  height: 1px !important;
  background: linear-gradient(90deg, transparent, rgba(223, 180, 126, 0.45), transparent) !important;
  pointer-events: none !important;
}

.sa-footer-brand {
  font-family: 'Cinzel', serif !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: 0.2em !important;
  color: #dfb47e !important;
  margin: 0 !important;
  text-shadow: 0 0 16px rgba(223, 180, 126, 0.25) !important;
}

.sa-footer-links {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  gap: 12px 14px !important;
  font-size: 13px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.sa-footer-link,
.sa-footer-cookie-btn {
  color: #a89a8c !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  background: none !important;
  border: none !important;
  padding: 4px 6px !important;
  margin: 0 !important;
  cursor: pointer !important;
  transition: color 0.2s ease, transform 0.2s ease !important;
  line-height: 1.4 !important;
  opacity: 1 !important;
}

.sa-footer-link:hover,
.sa-footer-cookie-btn:hover {
  color: #dfb47e !important;
  text-decoration: underline !important;
  text-underline-offset: 4px !important;
  transform: translateY(-1px) !important;
}

.sa-footer-sep {
  color: rgba(223, 180, 126, 0.3) !important;
  user-select: none !important;
  font-size: 12px !important;
}

.sa-footer-copy {
  font-size: 11.5px !important;
  color: #74685e !important;
  letter-spacing: 0.02em !important;
  margin-top: 4px !important;
}

@media (max-width: 640px) {
  #sa-footer,
  .sa-footer {
    padding: 36px 16px 32px !important;
    gap: 10px !important;
  }
  .sa-footer-links {
    gap: 8px 10px !important;
    font-size: 12px !important;
  }
  .sa-footer-link,
  .sa-footer-cookie-btn {
    font-size: 12px !important;
    padding: 3px 4px !important;
  }
}

/* ==========================================================================
   MOBILNOŚĆ I RESPONSYWNOŚĆ
   ========================================================================== */
@media (max-width: 640px) {
  #sac-root {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
  }

  .sac-banner-card {
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    padding: 20px 18px max(20px, env(safe-area-inset-bottom));
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7);
  }

  .sac-btn-group-primary {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .sac-btn {
    padding: 12px 14px;
    font-size: 13.5px;
  }

  .sac-categories-list {
    max-height: 230px;
  }

  #sac-trigger {
    bottom: max(16px, env(safe-area-inset-bottom));
    left: 16px;
    padding: 0 10px;
    height: 34px;
    font-size: 11px;
  }
}
