/**
 * PropertyBin — cookie / preference centre
 * Attractive bottom sheet + floating reopen button.
 */
:root {
  --pb-consent-brand: #ff385c;
  --pb-consent-ink: #111827;
  --pb-consent-muted: #6b7280;
  --pb-consent-line: #e5e7eb;
  --pb-consent-sheet: #ffffff;
  --pb-consent-soft: #f9fafb;
  --pb-consent-radius: 20px;
  --pb-consent-safe-b: env(safe-area-inset-bottom, 0px);
  --pb-consent-tab: 56px;
}

.pb-consent-fab {
  position: fixed;
  left: max(12px, env(safe-area-inset-left, 0px));
  bottom: calc(var(--pb-consent-tab) + var(--pb-consent-safe-b) + 12px);
  z-index: 10050;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  min-height: 44px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
  color: var(--pb-consent-ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pb-consent-fab:hover { transform: translateY(-1px); box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16); }
.pb-consent-fab:active { transform: scale(0.97); }
.pb-consent-fab-icon { font-size: 16px; line-height: 1; }

@media (min-width: 901px) {
  .pb-consent-fab { bottom: 20px; left: 20px; }
}
@media (max-width: 900px) {
  .pb-consent-fab { bottom: calc(var(--pb-consent-tab) + var(--pb-consent-safe-b) + 10px); }
}

.pb-consent-root {
  position: fixed; inset: 0; z-index: 10060;
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none;
}
.pb-consent-root:not([hidden]) { pointer-events: auto; }
.pb-consent-root[hidden] { display: none !important; }

.pb-consent-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0; transition: opacity 0.28s ease;
}
.pb-consent-root.is-open .pb-consent-backdrop { opacity: 1; }

.pb-consent-sheet {
  position: relative;
  width: min(520px, 100%);
  max-height: min(92dvh, 720px);
  margin: 0 auto;
  background: var(--pb-consent-sheet);
  border-radius: var(--pb-consent-radius) var(--pb-consent-radius) 0 0;
  box-shadow: 0 -12px 48px rgba(15, 23, 42, 0.18);
  display: flex; flex-direction: column;
  transform: translateY(110%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  padding-bottom: max(12px, var(--pb-consent-safe-b));
}
.pb-consent-root.is-open .pb-consent-sheet { transform: translateY(0); }

@media (min-width: 640px) {
  .pb-consent-root { align-items: center; padding: 24px; }
  .pb-consent-sheet {
    border-radius: var(--pb-consent-radius);
    max-height: min(88vh, 680px);
    transform: translateY(24px) scale(0.98);
    opacity: 0;
    transition: transform 0.28s ease, opacity 0.28s ease;
  }
  .pb-consent-root.is-open .pb-consent-sheet {
    transform: translateY(0) scale(1); opacity: 1;
  }
}

.pb-consent-handle {
  width: 40px; height: 4px; border-radius: 999px;
  background: #d1d5db; margin: 10px auto 0; flex-shrink: 0;
}
@media (min-width: 640px) { .pb-consent-handle { display: none; } }

.pb-consent-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 20px 8px; flex-shrink: 0;
}
.pb-consent-brand { display: flex; gap: 12px; flex: 1; min-width: 0; }
.pb-consent-mark {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, #ff385c 0%, #e11d48 100%);
  color: #fff; font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 56, 92, 0.35);
}
.pb-consent-head h2 {
  margin: 0 0 4px; font-size: 18px; font-weight: 800;
  color: var(--pb-consent-ink); letter-spacing: -0.02em; line-height: 1.25;
}
.pb-consent-sub {
  margin: 0; font-size: 13px; line-height: 1.45; color: var(--pb-consent-muted);
}
.pb-consent-x {
  flex-shrink: 0; width: 36px; height: 36px; border: 0; border-radius: 999px;
  background: var(--pb-consent-soft); color: #6b7280; font-size: 22px;
  line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.pb-consent-x:hover { background: #f3f4f6; color: var(--pb-consent-ink); }

.pb-consent-body {
  flex: 1; overflow-y: auto; padding: 8px 20px 12px;
  -webkit-overflow-scrolling: touch;
}

.pb-consent-install {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; margin-bottom: 14px; border-radius: 14px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
}
.pb-consent-install[hidden] { display: none !important; }
.pb-consent-install-icon {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255, 56, 92, 0.2); color: #ff8fa3;
  display: flex; align-items: center; justify-content: center;
}
.pb-consent-install-copy {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
}
.pb-consent-install-copy strong { font-size: 14px; font-weight: 700; }
.pb-consent-install-copy span { font-size: 12px; opacity: 0.8; line-height: 1.35; }
.pb-consent-install-btn {
  flex-shrink: 0; border: 0; border-radius: 999px;
  background: var(--pb-consent-brand); color: #fff;
  font-size: 13px; font-weight: 700; padding: 10px 16px; min-height: 40px;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(255, 56, 92, 0.4);
}
.pb-consent-install-btn:hover { filter: brightness(1.05); }
.pb-consent-install-btn:disabled { opacity: 0.85; cursor: default; }

.pb-consent-cats {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.pb-consent-cat {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--pb-consent-line); background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.pb-consent-cat:hover { border-color: #d1d5db; background: var(--pb-consent-soft); }
.pb-consent-cat.is-locked { background: var(--pb-consent-soft); }
.pb-consent-cat-main { display: flex; gap: 10px; flex: 1; min-width: 0; }
.pb-consent-cat-icon {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 10px;
  background: #f3f4f6; display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.pb-consent-cat strong {
  display: block; font-size: 14px; font-weight: 700;
  color: var(--pb-consent-ink); margin-bottom: 2px;
}
.pb-consent-cat p {
  margin: 0; font-size: 12px; line-height: 1.4; color: var(--pb-consent-muted);
}
.pb-consent-badge {
  flex-shrink: 0; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: #059669; background: #d1fae5;
  padding: 4px 10px; border-radius: 999px;
}

.pb-consent-switch {
  position: relative; display: inline-block;
  width: 48px; height: 28px; flex-shrink: 0; cursor: pointer;
}
.pb-consent-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.pb-consent-slider {
  position: absolute; inset: 0; background: #d1d5db;
  border-radius: 999px; transition: background 0.2s ease;
}
.pb-consent-slider::before {
  content: ''; position: absolute;
  width: 22px; height: 22px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}
.pb-consent-switch input:checked + .pb-consent-slider { background: var(--pb-consent-brand); }
.pb-consent-switch input:checked + .pb-consent-slider::before { transform: translateX(20px); }
.pb-consent-switch input:focus-visible + .pb-consent-slider {
  outline: 2px solid var(--pb-consent-brand); outline-offset: 2px;
}

.pb-consent-legal {
  margin: 14px 0 0; font-size: 12px; color: var(--pb-consent-muted); line-height: 1.45;
}
.pb-consent-legal a { color: var(--pb-consent-brand); font-weight: 600; text-decoration: none; }
.pb-consent-legal a:hover { text-decoration: underline; }

.pb-consent-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 12px 20px 8px; border-top: 1px solid var(--pb-consent-line);
  flex-shrink: 0; background: #fff;
}
.pb-consent-btn {
  border: 0; border-radius: 12px; min-height: 48px;
  font-size: 14px; font-weight: 700; cursor: pointer; padding: 12px 14px;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.pb-consent-btn:active { transform: scale(0.98); }
.pb-consent-btn-ghost {
  grid-column: 1 / -1; background: transparent;
  color: var(--pb-consent-muted); border: 1px solid var(--pb-consent-line); order: 3;
}
.pb-consent-btn-ghost:hover { background: var(--pb-consent-soft); color: var(--pb-consent-ink); }
.pb-consent-btn-save { background: #f3f4f6; color: var(--pb-consent-ink); }
.pb-consent-btn-save:hover { background: #e5e7eb; }
.pb-consent-btn-primary {
  background: var(--pb-consent-brand); color: #fff;
  box-shadow: 0 4px 14px rgba(255, 56, 92, 0.35);
}
.pb-consent-btn-primary:hover { filter: brightness(1.05); }

@media (min-width: 480px) {
  .pb-consent-actions { grid-template-columns: 1.2fr 1fr 1fr; }
  .pb-consent-btn-ghost { grid-column: auto; order: 0; }
}

body.pb-consent-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .pb-consent-sheet, .pb-consent-backdrop, .pb-consent-fab { transition: none !important; }
}

@media (display-mode: standalone) {
  .pb-consent-fab { bottom: calc(var(--pb-consent-safe-b) + 16px); }
}
@media (display-mode: standalone) and (max-width: 900px) {
  .pb-consent-fab { bottom: calc(var(--pb-consent-tab) + var(--pb-consent-safe-b) + 10px); }
}
