/* ══════════════════════════════════════════════════
   Cookie Consent Banner
   PIPEDA + Quebec Law 25 compliant
   ══════════════════════════════════════════════════ */

/* ── Banner wrapper ──────────────────────────────── */
.tsc-cookie {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  padding: 0 16px 16px;
  pointer-events: none;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tsc-cookie--visible {
  transform: translateY(0);
  pointer-events: auto;
}

/* ── Inner card ──────────────────────────────────── */
.tsc-cookie__inner {
  max-width: 780px;
  margin: 0 auto;
  background: var(--color-card, #FAFBFD);
  border: 1px solid var(--color-border, #E2E6EC);
  border-radius: 16px;
  box-shadow: 0 -4px 32px rgba(30, 58, 95, 0.14), 0 2px 8px rgba(0,0,0,0.06);
  padding: 24px 28px 20px;
}

/* ── Header ──────────────────────────────────────── */
.tsc-cookie__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.tsc-cookie__icon {
  display: flex;
  align-items: center;
  color: var(--color-primary, #1E3A5F);
  flex-shrink: 0;
}

.tsc-cookie__title {
  font-family: var(--font-display, 'Playfair Display', serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary, #1E3A5F);
  margin: 0;
}

/* ── Description ─────────────────────────────────── */
.tsc-cookie__desc {
  font-size: 0.875rem;
  color: var(--color-text-muted, #5A6270);
  line-height: 1.65;
  margin: 0 0 16px;
}

.tsc-cookie__desc strong {
  color: var(--color-text, #1E2328);
  font-weight: 700;
}

.tsc-cookie__desc a {
  color: var(--color-primary, #1E3A5F);
  text-decoration: underline;
}

.tsc-cookie__desc a:hover {
  color: var(--color-secondary, #B22234);
}

/* ── Cookie categories ───────────────────────────── */
.tsc-cookie__cats {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--color-border, #E2E6EC);
  border: 1px solid var(--color-border, #E2E6EC);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}

.tsc-cookie__cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  background: var(--color-card, #FAFBFD);
}

.tsc-cookie__cat:first-child { border-radius: 10px 10px 0 0; }
.tsc-cookie__cat:last-child  { border-radius: 0 0 10px 10px; }

.tsc-cookie__cat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.tsc-cookie__cat-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text, #1E2328);
  cursor: default;
}

label.tsc-cookie__cat-name { cursor: pointer; }

.tsc-cookie__cat-desc {
  font-size: 0.78rem;
  color: var(--color-text-muted, #5A6270);
  line-height: 1.5;
}

/* "Always on" badge */
.tsc-cookie__always-on {
  font-size: 0.72rem;
  font-weight: 700;
  color: #2d5a3a;
  background: rgba(74, 124, 89, 0.12);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Toggle switch ───────────────────────────────── */
.tsc-cookie__toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.tsc-cookie__toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.tsc-cookie__slider {
  position: absolute;
  inset: 0;
  background: var(--color-border, #E2E6EC);
  border-radius: 999px;
  transition: background 0.25s;
}

.tsc-cookie__slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.25s;
}

.tsc-cookie__toggle input:checked + .tsc-cookie__slider {
  background: var(--color-primary, #1E3A5F);
}

.tsc-cookie__toggle input:checked + .tsc-cookie__slider::before {
  transform: translateX(20px);
}

.tsc-cookie__toggle input:focus-visible + .tsc-cookie__slider {
  outline: 2px solid var(--color-accent, #D4A843);
  outline-offset: 2px;
}

/* ── Action buttons ──────────────────────────────── */
.tsc-cookie__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tsc-cookie__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
}

.tsc-cookie__btn--outline {
  background: transparent;
  border-color: var(--color-border, #E2E6EC);
  color: var(--color-text, #1E2328);
}

.tsc-cookie__btn--outline:hover {
  border-color: var(--color-primary, #1E3A5F);
  color: var(--color-primary, #1E3A5F);
  background: rgba(30, 58, 95, 0.05);
}

.tsc-cookie__btn--primary {
  background: var(--color-primary, #1E3A5F);
  border-color: var(--color-primary, #1E3A5F);
  color: #fff;
  margin-left: auto;
}

.tsc-cookie__btn--primary:hover {
  background: #16304f;
  border-color: #16304f;
}

/* ── Legal text ──────────────────────────────────── */
.tsc-cookie__legal {
  font-size: 0.75rem;
  color: var(--color-text-muted, #5A6270);
  line-height: 1.6;
  margin: 0;
}

.tsc-cookie__reopen-inline {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: inherit;
  color: var(--color-primary, #1E3A5F);
  text-decoration: underline;
  cursor: pointer;
  display: inline;
}

.tsc-cookie__reopen-inline:hover {
  color: var(--color-secondary, #B22234);
}

/* ── Footer "Cookie Settings" link ──────────────── */
button#tsc-cookie-reopen,
.tsc-cookie-reopen-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: inherit;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  display: inline;
}

button#tsc-cookie-reopen:hover,
.tsc-cookie-reopen-link:hover {
  text-decoration: underline;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 600px) {
  .tsc-cookie__inner {
    padding: 18px 16px 16px;
    border-radius: 12px 12px 0 0;
  }

  .tsc-cookie {
    padding: 0;
  }

  .tsc-cookie__actions {
    flex-direction: column;
  }

  .tsc-cookie__btn--primary {
    margin-left: 0;
  }

  .tsc-cookie__cats {
    gap: 0;
  }
}
