/* Phone World Cookie Consent – all selectors prefixed .pwcc to avoid theme clashes. */

.pwcc {
  --pwcc-accent: #B02123;
  --pwcc-ink: #2B2B2B;
  --pwcc-muted: #5f5f5f;
  --pwcc-line: #e3e3e3;
  --pwcc-bg: #ffffff;
  --pwcc-radius: 10px;
  font-family: inherit;
  color: var(--pwcc-ink);
  line-height: 1.45;
}

.pwcc [hidden] { display: none !important; }
.pwcc *, .pwcc *::before, .pwcc *::after { box-sizing: border-box; }

/* ---------- banner ---------- */

.pwcc-banner {
  position: fixed;
  z-index: 2147483000;
  background: var(--pwcc-bg);
  color: var(--pwcc-ink);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, .14);
}

.pwcc--bar .pwcc-banner { left: 0; right: 0; bottom: 0; border-top: 4px solid var(--pwcc-accent); }
.pwcc--bar .pwcc-banner__inner {
  max-width: 1200px; margin: 0 auto; padding: 18px 20px;
  display: flex; gap: 24px; align-items: center;
}
.pwcc--bar .pwcc-banner__text { flex: 1 1 auto; }

.pwcc--box .pwcc-banner {
  left: 16px; bottom: 16px; width: min(420px, calc(100vw - 32px));
  border-radius: var(--pwcc-radius); border-top: 4px solid var(--pwcc-accent);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .2);
}
.pwcc--box .pwcc-banner__inner { padding: 18px; }
.pwcc--box .pwcc-banner__actions { margin-top: 14px; }

.pwcc-banner__title { font-size: 1.05rem; font-weight: 700; margin: 0 0 4px; color: var(--pwcc-ink); }
.pwcc-banner__msg { font-size: .9rem; margin: 0; color: var(--pwcc-muted); }

.pwcc-banner__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 0 0 auto; }
.pwcc--box .pwcc-banner__actions .pwcc-btn--primary,
.pwcc--box .pwcc-banner__actions .pwcc-btn--secondary { flex: 1 1 0; }
.pwcc--box .pwcc-banner__actions .pwcc-btn--link { flex: 1 1 100%; }

/* ---------- buttons ---------- */
/* Accept and Reject are deliberately the same size and weight (ICO guidance). */

.pwcc-btn {
  appearance: none; cursor: pointer;
  font: inherit; font-size: .9rem; font-weight: 600;
  min-height: 44px; padding: 10px 18px;
  border-radius: 6px; border: 2px solid transparent;
  line-height: 1.2; text-align: center; white-space: nowrap;
  transition: filter .15s ease, background-color .15s ease;
}
.pwcc-btn:focus-visible, .pwcc-close:focus-visible, .pwcc-float:focus-visible,
.pwcc-link:focus-visible, .pwcc-switch input:focus-visible + .pwcc-switch__track {
  outline: 3px solid var(--pwcc-accent); outline-offset: 2px;
}
.pwcc-btn--primary { background: var(--pwcc-accent); color: #fff; }
.pwcc-btn--secondary { background: var(--pwcc-ink); color: #fff; }
.pwcc-btn--primary:hover, .pwcc-btn--secondary:hover { filter: brightness(1.12); }
.pwcc-btn--link {
  background: transparent; color: var(--pwcc-ink);
  text-decoration: underline; text-underline-offset: 3px; padding-left: 8px; padding-right: 8px;
}

.pwcc-link { color: var(--pwcc-accent); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- dialog ---------- */

html.pwcc-lock, html.pwcc-lock body { overflow: hidden; }

.pwcc-overlay {
  position: fixed; inset: 0; z-index: 2147483001;
  background: rgba(20, 20, 20, .55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.pwcc-dialog {
  background: var(--pwcc-bg); color: var(--pwcc-ink);
  width: min(560px, 100%); max-height: calc(100vh - 32px);
  border-radius: var(--pwcc-radius); border-top: 4px solid var(--pwcc-accent);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .3);
}
.pwcc-dialog:focus { outline: none; }
.pwcc-dialog__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--pwcc-line);
}
.pwcc-dialog__title { font-size: 1.1rem; font-weight: 700; margin: 0; color: var(--pwcc-ink); }
.pwcc-close {
  appearance: none; background: none; border: 0; cursor: pointer;
  font-size: 28px; line-height: 1; width: 44px; height: 44px; margin: -8px -10px -8px 0;
  color: var(--pwcc-muted); border-radius: 6px;
}
.pwcc-dialog__body { padding: 8px 20px; overflow-y: auto; }
.pwcc-dialog__policy { font-size: .875rem; margin: 12px 0 8px; }
.pwcc-dialog__actions {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end;
  padding: 14px 20px; border-top: 1px solid var(--pwcc-line);
}

.pwcc-cat { padding: 14px 0; border-bottom: 1px solid var(--pwcc-line); }
.pwcc-cat:last-of-type { border-bottom: 0; }
.pwcc-cat__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0; cursor: pointer; }
.pwcc-cat__name { font-weight: 700; font-size: .95rem; }
.pwcc-cat__always { font-size: .8rem; font-weight: 600; color: #1d7a3a; }
.pwcc-cat__desc { font-size: .85rem; color: var(--pwcc-muted); margin: 6px 0 0; }

/* ---------- toggle switch ---------- */

.pwcc-switch { position: relative; display: inline-flex; flex: 0 0 auto; }
.pwcc-switch input {
  position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer;
}
.pwcc-switch__track {
  width: 46px; height: 26px; border-radius: 13px; background: #b9b9b9;
  position: relative; transition: background-color .15s ease;
}
.pwcc-switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s ease;
}
.pwcc-switch input:checked + .pwcc-switch__track { background: var(--pwcc-accent); }
.pwcc-switch input:checked + .pwcc-switch__track::after { transform: translateX(20px); }

/* ---------- floating settings button ---------- */

.pwcc-float {
  position: fixed; left: 16px; bottom: 16px; z-index: 2147482999;
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  background: var(--pwcc-ink); color: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .25); opacity: .85;
}
.pwcc-float:hover { opacity: 1; }

/* ---------- mobile ---------- */

@media (max-width: 767px) {
  .pwcc--bar .pwcc-banner__inner { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; }
  .pwcc-banner__actions { width: 100%; }
  .pwcc-banner__actions .pwcc-btn--primary,
  .pwcc-banner__actions .pwcc-btn--secondary { flex: 1 1 0; }
  .pwcc-banner__actions .pwcc-btn--link { flex: 1 1 100%; }
  .pwcc-banner__msg { font-size: .85rem; }
  .pwcc-dialog__actions .pwcc-btn { flex: 1 1 100%; }
  .pwcc-overlay { align-items: flex-end; padding: 0; }
  .pwcc-dialog { border-radius: var(--pwcc-radius) var(--pwcc-radius) 0 0; max-height: 92vh; }
}

@media (prefers-reduced-motion: reduce) {
  .pwcc * { transition: none !important; }
}
