/* =============================================================
   Cookie Consent Widget styles
   Theme via CSS variables on :root or .cc-widget.
   ============================================================= */

:root {
  --cc-bg: #ffffff;
  --cc-fg: #1a1d21;
  --cc-fg-muted: #5a6168;
  --cc-border: #e2e5ea;
  --cc-primary: #2b6cb0;
  --cc-primary-fg: #ffffff;
  --cc-primary-hover: #245a96;
  --cc-track: #cbd2da;
  --cc-track-on: var(--cc-primary);
  --cc-thumb: #ffffff;
  --cc-shadow: 0 12px 40px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(15, 23, 42, 0.08);
  --cc-radius: 14px;
  --cc-radius-sm: 8px;
  --cc-z: 2147483000;
  --cc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.cc-widget {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: var(--cc-z);
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  font-family: var(--cc-font);
  color: var(--cc-fg);
  -webkit-font-smoothing: antialiased;
}

.cc-widget[hidden] { display: none; }

.cc-widget__panel {
  display: flex;
  flex-direction: column;
  background: var(--cc-bg);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
  overflow: hidden;
  max-height: inherit;
  outline: none;
  animation: cc-fade-in 220ms ease-out both;
}

.cc-widget--closing .cc-widget__panel {
  animation: cc-fade-out 180ms ease-in both;
}

@keyframes cc-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes cc-fade-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(8px); }
}

@media (prefers-reduced-motion: reduce) {
  .cc-widget__panel,
  .cc-widget--closing .cc-widget__panel { animation: none; }
}

/* ---- Head ---- */
.cc-widget__head {
  padding: 22px 24px 14px;
}

.cc-widget__title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--cc-fg);
}

.cc-widget__desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--cc-fg-muted);
}

.cc-widget__link {
  color: var(--cc-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cc-widget__link:hover { color: var(--cc-primary-hover); }

.cc-widget__link:focus-visible {
  outline: 2px solid var(--cc-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---- Categories ---- */
.cc-widget__categories {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 6px 24px 4px;
  overflow-y: auto;
  max-height: 38vh;
  border-top: 1px solid var(--cc-border);
}

.cc-cat {
  padding: 14px 0;
  border-bottom: 1px solid var(--cc-border);
}

.cc-cat:last-child { border-bottom: 0; }

.cc-cat__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.cc-cat__label {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.cc-cat__name {
  font-size: 14px;
  font-weight: 600;
}

.cc-cat__hint {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--cc-border);
  color: var(--cc-fg-muted);
}

.cc-cat__desc {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--cc-fg-muted);
}

/* ---- Toggle ---- */
.cc-toggle { position: relative; flex: 0 0 auto; }

.cc-toggle input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.cc-toggle input:disabled { cursor: not-allowed; }

.cc-toggle__track {
  display: inline-block;
  width: 38px;
  height: 22px;
  background: var(--cc-track);
  border-radius: 999px;
  position: relative;
  transition: background-color 160ms ease;
}

.cc-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--cc-thumb);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 160ms ease;
}

.cc-toggle input:checked ~ .cc-toggle__track {
  background: var(--cc-track-on);
}

.cc-toggle input:checked ~ .cc-toggle__track .cc-toggle__thumb {
  transform: translateX(16px);
}

.cc-toggle input:disabled ~ .cc-toggle__track {
  opacity: 0.7;
}

.cc-toggle input:focus-visible ~ .cc-toggle__track {
  outline: 2px solid var(--cc-primary);
  outline-offset: 2px;
}

/* ---- Actions ---- */
.cc-widget__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--cc-border);
  background: var(--cc-bg);
}

.cc-widget__actions .cc-btn:last-child {
  grid-column: 1 / -1;
}

.cc-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--cc-radius-sm);
  padding: 11px 14px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.cc-btn:focus-visible {
  outline: 2px solid var(--cc-primary);
  outline-offset: 2px;
}

.cc-btn--primary {
  background: var(--cc-primary);
  color: var(--cc-primary-fg);
}

.cc-btn--primary:hover { background: var(--cc-primary-hover); }

.cc-btn--ghost {
  background: transparent;
  color: var(--cc-fg);
  border-color: var(--cc-border);
}

.cc-btn--ghost:hover {
  border-color: var(--cc-fg-muted);
  color: var(--cc-fg);
}

/* ---- Mobile ---- */
@media (max-width: 520px) {
  .cc-widget {
    bottom: 12px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100vh - 24px);
  }
  .cc-widget__head { padding: 18px 18px 12px; }
  .cc-widget__categories { padding: 6px 18px 4px; max-height: 44vh; }
  .cc-widget__actions { grid-template-columns: 1fr; padding: 12px 14px 14px; }
  .cc-widget__actions .cc-btn:last-child { grid-column: auto; }
}

/* ---- Dark mode (optional, opt in via attribute) ---- */
[data-cc-theme="dark"] {
  --cc-bg: #15181c;
  --cc-fg: #e7eaee;
  --cc-fg-muted: #99a1ab;
  --cc-border: #2a2f36;
  --cc-track: #3a414a;
  --cc-thumb: #f3f5f8;
}

/* =============================================================
   ER-TEC brand theme + bottom-taskbar layout
   Overrides applied on top of the upstream template above.
   ============================================================= */
:root {
  --cc-bg: #ffffff;
  --cc-fg: oklch(0.18 0.015 250);
  --cc-fg-muted: oklch(0.42 0.015 250);
  --cc-border: oklch(0.90 0.008 250);
  --cc-primary: oklch(0.18 0.015 250);
  --cc-primary-fg: #ffffff;
  --cc-primary-hover: oklch(0.28 0.028 250);
  --cc-track: oklch(0.85 0.008 250);
  --cc-track-on: #A9D2FE;
  --cc-thumb: #ffffff;
  --cc-shadow: 0 -10px 30px rgba(15, 23, 42, 0.08), 0 -1px 0 oklch(0.90 0.008 250);
  --cc-radius: 0px;
  --cc-radius-sm: 999px;
  --cc-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Pin to bottom, full width — taskbar */
.cc-widget {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: auto;
  max-width: none;
  max-height: none;
}

.cc-widget__panel {
  display: grid;
  grid-template-columns: minmax(280px, 1.25fr) minmax(0, 1.6fr) auto;
  align-items: center;
  gap: 32px;
  padding: 16px clamp(20px, 4vw, 56px);
  border-radius: 0;
  border: 0;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow: var(--cc-shadow);
  overflow: visible;
  max-height: none;
  animation: cc-slide-up 280ms cubic-bezier(.2,.7,.2,1) both;
}

.cc-widget--closing .cc-widget__panel {
  animation: cc-slide-down 220ms ease-in both;
}

@keyframes cc-slide-up {
  from { opacity: 0; transform: translateY(100%); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cc-slide-down {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(100%); }
}

.cc-widget__head { padding: 0; }
.cc-widget__title {
  margin: 0 0 4px;
  font-family: "Inter Tight", var(--cc-font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.cc-widget__desc {
  font-size: 12.5px;
  line-height: 1.5;
}
.cc-widget__link {
  color: var(--cc-fg);
  text-decoration: none;
  border-bottom: 1px solid var(--cc-track-on);
}
.cc-widget__link:hover { color: var(--cc-track-on); }

/* Categories arranged horizontally */
.cc-widget__categories {
  flex-direction: row;
  flex-wrap: wrap;
  border-top: 0;
  padding: 0;
  margin: 0;
  max-height: none;
  overflow: visible;
  gap: 6px 28px;
}
.cc-cat {
  padding: 0;
  border-bottom: 0;
  flex: 0 0 auto;
}
.cc-cat__row { gap: 12px; }
.cc-cat__label { gap: 8px; }
.cc-cat__name { font-size: 13px; }
.cc-cat__hint {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  background: transparent;
  border: 1px solid var(--cc-border);
  color: var(--cc-fg-muted);
}
.cc-cat__desc { display: none; } /* descriptions live on the cookies page */

/* Smaller toggle, sized for a taskbar */
.cc-toggle__track { width: 32px; height: 18px; }
.cc-toggle__thumb { width: 14px; height: 14px; top: 2px; left: 2px; }
.cc-toggle input:checked ~ .cc-toggle__track .cc-toggle__thumb { transform: translateX(14px); }

/* Actions: pill buttons, all in one row */
.cc-widget__actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 0;
  border-top: 0;
  background: transparent;
}
.cc-widget__actions .cc-btn:last-child { grid-column: auto; }
.cc-btn {
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.cc-btn--primary { background: var(--cc-primary); color: #fff; }
.cc-btn--primary:hover { background: var(--cc-primary-hover); }
.cc-btn--ghost {
  background: transparent;
  border-color: var(--cc-border);
  color: var(--cc-fg);
}
.cc-btn--ghost:hover { border-color: var(--cc-fg); }

/* Tablet — collapse into 2 rows */
@media (max-width: 1100px) {
  .cc-widget__panel {
    grid-template-columns: 1fr auto;
    gap: 16px 24px;
  }
  .cc-widget__head { grid-column: 1 / -1; }
  .cc-widget__categories { grid-column: 1; }
  .cc-widget__actions { grid-column: 2; }
}

/* Mobile — stack vertically */
@media (max-width: 720px) {
  .cc-widget__panel {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px 18px;
  }
  .cc-widget__head, .cc-widget__categories, .cc-widget__actions { grid-column: 1; }
  .cc-widget__categories { gap: 8px 20px; }
  .cc-widget__actions { flex-wrap: wrap; }
  .cc-widget__actions .cc-btn { flex: 1; min-width: 130px; }
}
