/* UnboundPrint cookie consent banner + modal.
 * Design: brand-consistent with homepage-v2 (Mulish body, Rammetto One
 * headings, magenta accent, navy text, surface-alt backdrop). Banner
 * sits bottom-centred, slides up on entry, never covers navigation at
 * the top. Buttons use equal visual weight for accept / reject (GDPR).
 */

.ub-cc-root {
  position: relative;
  z-index: 9500; /* below PixelTool modal (9999) but above most content */
}

/* ── Banner ──────────────────────────────────────────────────── */

.ub-cc-banner {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, calc(100% + 40px));
  width: min(960px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid var(--ub-border, #D6DCE8);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 41, 61, 0.18);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  transition: transform .32s cubic-bezier(0.2, 0, 0.2, 1),
              opacity   .22s ease;
  opacity: 0;
  color: var(--ub-navy, #00293D);
  font-family: 'Mulish', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
.ub-cc-banner--enter {
  transform: translate(-50%, 0);
  opacity: 1;
}
.ub-cc-banner__text {
  flex: 1 1 340px;
  min-width: 0;
}
.ub-cc-banner__text strong {
  font-weight: 700;
}
.ub-cc-banner__link {
  color: var(--ub-magenta, #CE2984);
  text-decoration: underline;
  font-weight: 600;
}
.ub-cc-banner__link:hover {
  color: var(--ub-magenta-dark, #A82070);
}
.ub-cc-banner__actions {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  flex: 0 0 auto;
}

/* ── Shared buttons ──────────────────────────────────────────── */

.ub-cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  min-height: 40px;
  border-radius: 9999px;
  border: 2px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .16s ease, border-color .16s ease,
              color .16s ease, transform .08s ease;
}
.ub-cc-btn:active { transform: translateY(1px); }
.ub-cc-btn:focus-visible {
  outline: 3px solid var(--ub-magenta, #CE2984);
  outline-offset: 2px;
}
.ub-cc-btn--primary {
  background: var(--ub-magenta, #CE2984);
  border-color: var(--ub-magenta, #CE2984);
  color: #fff;
}
.ub-cc-btn--primary:hover {
  background: var(--ub-magenta-dark, #A82070);
  border-color: var(--ub-magenta-dark, #A82070);
}
/* Secondary (reject) is equally prominent to primary — GDPR requires
   that rejecting be as easy as accepting. Same padding + font + height,
   only the colour style differs (outline on navy). */
.ub-cc-btn--secondary {
  background: #fff;
  border-color: var(--ub-navy, #00293D);
  color: var(--ub-navy, #00293D);
}
.ub-cc-btn--secondary:hover {
  background: var(--ub-navy, #00293D);
  color: #fff;
}
.ub-cc-btn--ghost {
  background: transparent;
  color: var(--ub-magenta, #CE2984);
  border-color: var(--ub-magenta, #CE2984);
}
.ub-cc-btn--ghost:hover {
  background: var(--ub-magenta, #CE2984);
  color: #fff;
}
.ub-cc-btn--link {
  background: transparent;
  border-color: transparent;
  color: var(--ub-text-muted, #6B7A99);
  padding: 10px 6px;
  text-decoration: underline;
  min-height: 40px;
}
.ub-cc-btn--link:hover {
  color: var(--ub-navy, #00293D);
}

/* ── Modal ───────────────────────────────────────────────────── */

.ub-cc-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 41, 61, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9600;
  opacity: 0;
  transition: opacity .22s ease;
}
.ub-cc-modal--enter { opacity: 1; }
.ub-cc-modal__panel {
  background: #fff;
  color: var(--ub-navy, #00293D);
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 48px);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 41, 61, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Mulish', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  transform: translateY(12px) scale(0.98);
  transition: transform .22s cubic-bezier(0.2, 0, 0.2, 1);
}
.ub-cc-modal--enter .ub-cc-modal__panel {
  transform: translateY(0) scale(1);
}
.ub-cc-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--ub-border, #D6DCE8);
}
.ub-cc-modal__title {
  margin: 0;
  font-family: 'Rammetto One', cursive, system-ui, sans-serif;
  font-weight: 400;
  font-size: 22px;
  color: var(--ub-navy, #00293D);
}
.ub-cc-modal__close {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--ub-text-muted, #6B7A99);
  font-size: 26px;
  line-height: 1;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.ub-cc-modal__close:hover {
  background: var(--ub-surface-alt, #F0F4F8);
  color: var(--ub-navy, #00293D);
}
.ub-cc-modal__intro {
  margin: 0;
  padding: 16px 22px 0;
  color: var(--ub-text-muted, #6B7A99);
  font-size: 14px;
}
.ub-cc-modal__list {
  overflow-y: auto;
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Category row ────────────────────────────────────────────── */

.ub-cc-cat {
  border: 1px solid var(--ub-border, #D6DCE8);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
}
.ub-cc-cat__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.ub-cc-cat__label {
  font-weight: 700;
  font-size: 15px;
  color: var(--ub-navy, #00293D);
}
.ub-cc-cat__desc {
  margin: 0;
  color: var(--ub-text-muted, #6B7A99);
  font-size: 13px;
  line-height: 1.55;
}

/* Toggle switch */
.ub-cc-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.ub-cc-switch input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.ub-cc-switch__slider {
  position: absolute;
  inset: 0;
  background: #D6DCE8;
  border-radius: 999px;
  transition: background-color .18s ease;
}
.ub-cc-switch__slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0, 41, 61, 0.25);
  transition: transform .18s ease;
}
.ub-cc-switch input:checked + .ub-cc-switch__slider {
  background: var(--ub-magenta, #CE2984);
}
.ub-cc-switch input:checked + .ub-cc-switch__slider::before {
  transform: translateX(18px);
}
.ub-cc-switch input:disabled + .ub-cc-switch__slider {
  opacity: 0.7;
  cursor: not-allowed;
}
.ub-cc-switch input:focus-visible + .ub-cc-switch__slider {
  outline: 3px solid var(--ub-magenta, #CE2984);
  outline-offset: 2px;
}

/* ── Per-cookie disclosure (EU transparency requirement) ──── */

.ub-cc-cat__details {
  margin-top: 10px;
  border-top: 1px dashed var(--ub-border, #D6DCE8);
  padding-top: 10px;
}
.ub-cc-cat__details-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ub-magenta, #CE2984);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  list-style: none;
}
.ub-cc-cat__details-toggle::-webkit-details-marker { display: none; }
.ub-cc-cat__details-toggle::before {
  content: "▸";
  transition: transform .15s ease;
}
.ub-cc-cat__details[open] > .ub-cc-cat__details-toggle::before {
  transform: rotate(90deg);
}
.ub-cc-cat__loading,
.ub-cc-cat__empty {
  margin: 10px 0 0;
  color: var(--ub-text-muted, #6B7A99);
  font-size: 13px;
}
.ub-cc-cookies {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 12px;
}
.ub-cc-cookies thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ub-text-muted, #6B7A99);
  padding: 6px 8px;
  border-bottom: 1px solid var(--ub-border, #D6DCE8);
  background: var(--ub-surface-alt, #F0F4F8);
}
.ub-cc-cookies td {
  padding: 8px;
  border-bottom: 1px solid #F0F4F8;
  vertical-align: top;
  color: var(--ub-navy, #00293D);
  line-height: 1.45;
}
.ub-cc-cookies tr:last-child td {
  border-bottom: 0;
}
.ub-cc-cookies code {
  background: var(--ub-surface-alt, #F0F4F8);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11.5px;
}
.ub-cc-cookies__tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #FDECEC;
  color: #9B1C1C;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Modal footer ───────────────────────────────────────────── */

.ub-cc-modal__footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: 16px 22px;
  border-top: 1px solid var(--ub-border, #D6DCE8);
  background: var(--ub-surface-alt, #F0F4F8);
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 640px) {
  .ub-cc-banner {
    bottom: 12px;
    padding: 16px 18px;
    gap: 12px;
  }
  .ub-cc-banner__actions {
    width: 100%;
    justify-content: stretch;
  }
  .ub-cc-banner__actions .ub-cc-btn {
    flex: 1 1 auto;
  }
  .ub-cc-btn--link { flex-basis: 100% !important; padding: 4px 0; }
  .ub-cc-modal__footer {
    justify-content: stretch;
  }
  .ub-cc-modal__footer .ub-cc-btn {
    flex: 1 1 auto;
  }
}

/* Reduced-motion users get instant state changes. */
@media (prefers-reduced-motion: reduce) {
  .ub-cc-banner,
  .ub-cc-modal,
  .ub-cc-modal__panel { transition: none !important; }
}
