/* ─── EGS Cookie Consent ─────────────────────────────────── */

/* Overlay backdrop */
#cookie-overlay {
  position: fixed; inset: 0;
  background: rgba(47,56,78,0.55);
  z-index: 99998;
  display: none;
  backdrop-filter: blur(2px);
}
#cookie-overlay.show { display: block; }

/* Banner (bottom bar — shown first) */
#cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #2F384E;
  color: #F1FCFE;
  z-index: 99999;
  padding: 1rem 1.5rem;
  display: none;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: 0 -4px 24px rgba(47,56,78,0.3);
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  line-height: 1.6;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}
#cookie-banner.show {
  display: flex;
  transform: translateY(0);
}
#cookie-banner p { margin: 0; flex: 1; min-width: 240px; }
#cookie-banner p a { color: #30D5F7; font-weight: 700; }
.cookie-banner-btns { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.cb-btn {
  border: none; border-radius: 24px; padding: 9px 20px;
  font-size: 12px; font-weight: 800; cursor: pointer;
  font-family: 'Nunito', sans-serif; white-space: nowrap;
  transition: transform 0.15s, opacity 0.15s;
}
.cb-btn:hover { transform: translateY(-1px); opacity: 0.9; }
.cb-accept  { background: #30D5F7; color: #2F384E; }
.cb-decline { background: rgba(255,255,255,0.12); color: #F1FCFE; }
.cb-manage  { background: transparent; color: #30D5F7; border: 1px solid #30D5F7; }

/* Modal */
#cookie-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  width: 520px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 48px rgba(47,56,78,0.25);
  z-index: 100000;
  display: none;
  flex-direction: column;
  font-family: 'Nunito', sans-serif;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.3s;
}
#cookie-modal.show {
  display: flex;
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}
.cm-header {
  padding: 1.4rem 1.6rem 1rem;
  border-bottom: 1px solid #e4eef5;
  display: flex; align-items: center; gap: 10px;
}
.cm-header-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: #F1FCFE; border: 2px solid #30D5F7;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 18px;
}
.cm-header h2 { color: #2F384E; font-size: 15px; font-weight: 800; margin: 0; }
.cm-header p  { color: #888; font-size: 11px; margin: 2px 0 0; }
.cm-body { padding: 1.2rem 1.6rem; overflow-y: auto; flex: 1; }
.cm-body > p { color: #666; font-size: 13px; line-height: 1.7; margin-bottom: 1.2rem; }

/* Toggle rows */
.cm-toggle-row {
  border: 1px solid #e4eef5;
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}
.cm-toggle-row:hover { border-color: #cce9f5; }
.cm-toggle-top {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.cm-toggle-label { font-size: 13px; font-weight: 800; color: #2F384E; }
.cm-toggle-desc  { font-size: 12px; color: #888; margin-top: 4px; line-height: 1.5; }
.cm-required-badge {
  font-size: 10px; font-weight: 800; color: #1b8a5a;
  background: #e0f5ec; border-radius: 10px; padding: 2px 8px;
  white-space: nowrap; flex-shrink: 0;
}

/* Toggle switch */
.cm-switch {
  position: relative; width: 42px; height: 24px; flex-shrink: 0;
}
.cm-switch input { opacity: 0; width: 0; height: 0; }
.cm-slider {
  position: absolute; inset: 0;
  background: #cdd8e3; border-radius: 24px; cursor: pointer;
  transition: background 0.2s;
}
.cm-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.cm-switch input:checked + .cm-slider { background: #30D5F7; }
.cm-switch input:checked + .cm-slider::before { transform: translateX(18px); }
.cm-switch input:disabled + .cm-slider { opacity: 0.6; cursor: not-allowed; }

/* Footer buttons */
.cm-footer {
  padding: 1rem 1.6rem 1.4rem;
  border-top: 1px solid #e4eef5;
  display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap;
}
.cm-btn {
  border: none; border-radius: 24px; padding: 10px 22px;
  font-size: 13px; font-weight: 800; cursor: pointer;
  font-family: 'Nunito', sans-serif; transition: transform 0.15s;
}
.cm-btn:hover { transform: translateY(-1px); }
.cm-btn-accept  { background: #30D5F7; color: #2F384E; }
.cm-btn-decline { background: #f4f7f9; color: #2F384E; border: 1px solid #e4eef5; }
.cm-btn-save    { background: #2F384E; color: #fff; }

/* Re-open cookie settings button (fixed bottom-left after consent) */
#cookie-reopen {
  position: fixed; bottom: 20px; left: 20px;
  width: 38px; height: 38px; border-radius: 50%;
  background: #2F384E; border: 2px solid #30D5F7;
  display: none; align-items: center; justify-content: center;
  cursor: pointer; z-index: 9980;
  box-shadow: 0 2px 10px rgba(47,56,78,0.25);
  transition: transform 0.2s;
}
#cookie-reopen:hover { transform: scale(1.1); }
#cookie-reopen.show { display: flex; }
#cookie-reopen svg { width: 16px; height: 16px; fill: #30D5F7; }

@media (max-width: 480px) {
  #cookie-banner { flex-direction: column; align-items: flex-start; }
  .cookie-banner-btns { width: 100%; }
  .cb-btn { flex: 1; text-align: center; }
}
