/* =====================================================================
   SDTechnologist — Cookie Consent Banner & Preferences Panel
   Works on both the light (hp) and dark (main) page templates.
   ===================================================================== */

/* ── Banner ─────────────────────────────────────────────────────────── */
.sdt-cb {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  width: min(720px, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid #e3e3e7;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.08);
  padding: 1.1rem 1.35rem;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
.sdt-cb[hidden] { display: none; }

.sdt-cb-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.sdt-cb-text {
  flex: 1 1 260px;
  font-size: .875rem;
  line-height: 1.6;
  color: #3c3c46;
  margin: 0;
}

.sdt-cb-actions {
  display: flex;
  gap: .55rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── Shared button styles ───────────────────────────────────────────── */
.sdt-cb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: .8125rem;
  font-weight: 600;
  line-height: 1;
  padding: .55rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  text-decoration: none;
}

/* Reject — equal visual weight: outlined */
.sdt-cb-btn--reject {
  background: #fff;
  color: #3c3c46;
  border-color: #d1d1d8;
}
.sdt-cb-btn--reject:hover {
  border-color: #a0a0b0;
  background: #f7f7f9;
}

/* Manage — equal visual weight: subtle fill */
.sdt-cb-btn--manage {
  background: #f3f0ff;
  color: #6c47ff;
  border-color: #ddd5ff;
}
.sdt-cb-btn--manage:hover {
  background: #ebe5ff;
  border-color: #c4b5fd;
}

/* Accept — primary */
.sdt-cb-btn--accept {
  background: #6c47ff;
  color: #fff;
  border-color: #6c47ff;
  box-shadow: 0 1px 3px rgba(108,71,255,.25);
}
.sdt-cb-btn--accept:hover {
  background: #5b39e6;
  border-color: #5b39e6;
}

/* Save */
.sdt-cb-btn--save {
  background: #6c47ff;
  color: #fff;
  border-color: #6c47ff;
  box-shadow: 0 1px 3px rgba(108,71,255,.25);
}
.sdt-cb-btn--save:hover {
  background: #5b39e6;
  border-color: #5b39e6;
}

/* ── Preferences Panel overlay ──────────────────────────────────────── */
.sdt-cp[hidden] { display: none; }

.sdt-cp {
  position: fixed;
  inset: 0;
  z-index: 100000;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sdt-cp-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.sdt-cp-box {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,.22);
  width: min(540px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Panel header */
.sdt-cp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid #ececef;
}

.sdt-cp-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #1c1c1e;
  margin: 0;
}

.sdt-cp-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  color: #8b8d98;
  cursor: pointer;
  padding: .25rem;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.sdt-cp-close:hover { color: #1c1c1e; background: #f3f3f5; }

/* Panel body */
.sdt-cp-body {
  padding: .5rem 1.5rem;
  flex: 1;
}

.sdt-cp-cat {
  padding: 1rem 0;
  border-bottom: 1px solid #ececef;
}
.sdt-cp-cat:last-child { border-bottom: none; }

.sdt-cp-cat-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.sdt-cp-cat-info strong {
  font-size: .9375rem;
  font-weight: 600;
  color: #1c1c1e;
  display: block;
  margin-bottom: .3rem;
}

.sdt-cp-cat-info p {
  font-size: .8125rem;
  line-height: 1.55;
  color: #5e5f6e;
  margin: 0;
}

.sdt-cp-always-on {
  flex-shrink: 0;
  font-size: .75rem;
  font-weight: 600;
  color: #22c55e;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 99px;
  padding: .3rem .7rem;
  white-space: nowrap;
  margin-top: .1rem;
}

/* Panel footer */
.sdt-cp-foot {
  display: flex;
  gap: .55rem;
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid #ececef;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ── Toggle switch ──────────────────────────────────────────────────── */
.sdt-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin-top: .1rem;
}
.sdt-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.sdt-toggle-track {
  display: flex;
  align-items: center;
  width: 44px;
  height: 24px;
  background: #d1d1d8;
  border-radius: 99px;
  padding: 2px;
  transition: background .2s;
  position: relative;
}

.sdt-toggle-thumb {
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  transition: transform .2s;
  flex-shrink: 0;
}

.sdt-toggle input:checked + .sdt-toggle-track {
  background: #6c47ff;
}
.sdt-toggle input:checked + .sdt-toggle-track .sdt-toggle-thumb {
  transform: translateX(20px);
}
.sdt-toggle input:focus-visible + .sdt-toggle-track {
  outline: 2px solid #6c47ff;
  outline-offset: 2px;
}

/* ── Cookie Settings link (footer) ─────────────────────────────────── */
[data-cookie-settings] {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Mobile ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .sdt-cb {
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    border-radius: 14px 14px 0 0;
    border-bottom: none;
  }
  .sdt-cb-inner { flex-direction: column; align-items: stretch; }
  .sdt-cb-actions { justify-content: stretch; }
  .sdt-cb-btn { flex: 1; justify-content: center; }
  .sdt-cp-foot { justify-content: stretch; }
  .sdt-cp-foot .sdt-cb-btn { flex: 1; justify-content: center; }
}
