/* ------------------------------------------------------------------
   Úvěrová pomoc — cookie lišta (GDPR consent)

   Vše je pod #upc-root, aby se to nepralo s GHL CSS na stránce.
   Lišta je ZÁMĚRNĚ pod survey modalem (z-index 2147482000 vs 2147483000)
   a při otevřeném modalu se schovává úplně.
   ------------------------------------------------------------------ */

#upc-root {
  --upc-accent: #18bd5b;
  --upc-accent-dark: #14a34e;
  --upc-text: #101828;
  --upc-muted: #475467;
  --upc-border: #d0d5dd;

  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2147482000;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#upc-root[hidden] { display: none !important; }
html.ups-modal-open #upc-root { display: none !important; }

#upc-root *,
#upc-root *::before,
#upc-root *::after { box-sizing: border-box; }

.upc-bar {
  background: #fff;
  border-top: 1px solid #eaecf0;
  box-shadow: 0 -8px 28px rgba(16, 24, 40, 0.14);
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  max-height: 85vh;
  overflow-y: auto;
  animation: upc-rise 0.22s ease-out;
}

@keyframes upc-rise {
  from { opacity: 0; transform: translateY(16px) }
  to   { opacity: 1; transform: none }
}

.upc-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1170px;
  margin: 0 auto;
}

.upc-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--upc-muted);
}
.upc-text a {
  color: var(--upc-accent-dark);
  font-weight: 600;
  text-decoration: underline;
}

.upc-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.upc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 18px;
  margin: 0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.upc-btn:focus-visible { outline: 2px solid var(--upc-accent); outline-offset: 2px; }

.upc-btn-primary { background: var(--upc-accent); color: #fff; }
.upc-btn-primary:hover { background: var(--upc-accent-dark); }

.upc-btn-secondary {
  background: #fff;
  border-color: var(--upc-border);
  color: #344054;
}
.upc-btn-secondary:hover { background: #f9fafb; border-color: #98a2b3; }

.upc-btn-ghost {
  background: transparent;
  color: var(--upc-muted);
  font-weight: 600;
  text-decoration: underline;
  padding: 11px 10px;
}
.upc-btn-ghost:hover { color: var(--upc-text); }

/* ---------- panel „Upravit" ---------- */

.upc-panel {
  max-width: 1170px;
  margin: 14px auto 0;
  padding-top: 14px;
  border-top: 1px solid #eaecf0;
}
.upc-panel[hidden] { display: none; }

.upc-cat {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
}
.upc-cat + .upc-cat { border-top: 1px solid #f2f4f7; }

.upc-cat input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--upc-accent);
  cursor: pointer;
}
.upc-cat input:disabled { cursor: not-allowed; opacity: 0.6; }

.upc-cat-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--upc-text);
}
.upc-cat-desc {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--upc-muted);
}

.upc-panel-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

/* ---------- mobil: kompaktní box, do ~30 % výšky ---------- */

@media (max-width: 640px) {
  #upc-root { left: 8px; right: 8px; bottom: 8px; }
  .upc-bar {
    border: 1px solid #eaecf0;
    border-radius: 14px;
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    max-height: 78vh;
  }
  .upc-inner { flex-direction: column; align-items: stretch; gap: 12px; }
  .upc-text { font-size: 12.5px; line-height: 1.5; }
  .upc-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  /* „Upravit" je na mobilu odkaz přes celou šířku, ať zbydou dvě velká tlačítka */
  .upc-actions .upc-btn-ghost {
    grid-column: 1 / -1;
    order: 2;
    min-height: 40px;
    padding: 8px 10px;
    font-size: 13px;
  }
  .upc-btn { font-size: 14px; padding: 11px 10px; }
  .upc-panel { margin-top: 12px; }
  .upc-panel-foot .upc-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .upc-bar { animation: none; }
}
