/* ============================================
   Cookie Banner — 2Smart House
   Scoped under .tsh-cc / #tsh-cc-*
   Uses existing tokens from tsh-styles.css
   ============================================ */

.tsh-cc, .tsh-cc * { box-sizing: border-box; }

#tsh-cc-banner {
  position: fixed;
  z-index: 9999;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 560px;
  margin-left: auto;
  background: var(--paper, #fff);
  color: var(--ink, #1a1a17);
  border: 1px solid var(--line-soft, rgba(26,26,23,0.18));
  border-radius: var(--radius, 10px);
  box-shadow: 0 18px 48px -12px rgba(26,26,23,0.25), 0 4px 12px -4px rgba(26,26,23,0.12);
  padding: 22px 22px 20px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  transform: translateY(calc(100% + 24px));
  opacity: 0;
  transition: transform .35s ease, opacity .25s ease;
}
#tsh-cc-banner[data-visible="true"] {
  transform: translateY(0);
  opacity: 1;
}

#tsh-cc-banner h3 {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--ink, #1a1a17);
}
#tsh-cc-banner p {
  margin: 0 0 14px;
  color: var(--ink-soft, #5a5751);
}
#tsh-cc-banner a {
  color: var(--ink, #1a1a17);
  text-decoration: underline;
  text-decoration-color: var(--accent, #D40634);
  text-underline-offset: 3px;
}

.tsh-cc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tsh-cc-btn {
  appearance: none;
  border: 1px solid var(--line, #1a1a17);
  background: var(--paper, #fff);
  color: var(--ink, #1a1a17);
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.005em;
  padding: 10px 16px;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.tsh-cc-btn:hover { background: var(--bg-2, #ede7d8); }
.tsh-cc-btn--primary {
  background: var(--accent, #D40634);
  border-color: var(--accent, #D40634);
  color: #fff;
}
.tsh-cc-btn--primary:hover {
  background: var(--accent-deep, #a30329);
  border-color: var(--accent-deep, #a30329);
}
.tsh-cc-btn--ghost {
  border-color: var(--line-soft, rgba(26,26,23,0.18));
  color: var(--ink-soft, #5a5751);
}
.tsh-cc-btn--ghost:hover { color: var(--ink, #1a1a17); }

/* ── Preferences modal ──────────────────── */

#tsh-cc-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(26,26,23,0.55);
  backdrop-filter: blur(2px);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
#tsh-cc-modal[data-open="true"] { display: flex; }

.tsh-cc-modal-card {
  background: var(--paper, #fff);
  color: var(--ink, #1a1a17);
  border: 1px solid var(--line-soft, rgba(26,26,23,0.18));
  border-radius: var(--radius, 10px);
  width: 100%;
  max-width: 580px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}
.tsh-cc-modal-head {
  padding: 22px 24px 14px;
  border-bottom: 1px solid var(--line-soft, rgba(26,26,23,0.18));
}
.tsh-cc-modal-head h3 {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
}
.tsh-cc-modal-head p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft, #5a5751);
  line-height: 1.55;
}
.tsh-cc-modal-body {
  padding: 8px 24px 16px;
  overflow-y: auto;
  flex: 1;
}
.tsh-cc-modal-foot {
  padding: 14px 24px 18px;
  border-top: 1px solid var(--line-soft, rgba(26,26,23,0.18));
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.tsh-cc-cat {
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft, rgba(26,26,23,0.18));
}
.tsh-cc-cat:last-child { border-bottom: 0; }
.tsh-cc-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.tsh-cc-cat-head h4 {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.005em;
  margin: 0;
}
.tsh-cc-cat-desc {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ink-soft, #5a5751);
  line-height: 1.55;
}

/* Toggle switch */
.tsh-cc-toggle {
  position: relative;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}
.tsh-cc-toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.tsh-cc-toggle input:disabled { cursor: not-allowed; }
.tsh-cc-track {
  position: absolute;
  inset: 0;
  background: var(--bg-3, #e4dcc7);
  border-radius: 22px;
  transition: background .2s ease;
  pointer-events: none;
}
.tsh-cc-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--paper, #fff);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(26,26,23,0.25);
  transition: transform .2s ease;
}
.tsh-cc-toggle input:checked ~ .tsh-cc-track { background: var(--accent, #D40634); }
.tsh-cc-toggle input:checked ~ .tsh-cc-track::after { transform: translateX(16px); }
.tsh-cc-toggle input:disabled ~ .tsh-cc-track {
  background: var(--ink-faint, #8a857c);
  opacity: .55;
}
.tsh-cc-toggle input:focus-visible ~ .tsh-cc-track {
  outline: 2px solid var(--accent, #D40634);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  #tsh-cc-banner { padding: 18px; }
  .tsh-cc-actions { flex-direction: column; }
  .tsh-cc-btn { width: 100%; }
  .tsh-cc-modal-foot { flex-direction: column; }
  .tsh-cc-modal-foot .tsh-cc-btn { width: 100%; }
}
