/* ==========================================================================
   Aradel Cookie Consent
   ========================================================================== */

/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
  --ack-red:      var(--ads-brand-red, #C1000F);
  --ack-dark:     var(--ads-brand-blue, #01303A);
  --ack-sherpa:   #012F39;
  --ack-white:    #fff;
  --ack-border:   rgba(1, 48, 58, 0.15);
  --ack-bg:       #fff;
  --ack-muted:    #474747;
  --ack-font:     var(--ads-font, "Nunito Sans", sans-serif);
  --ack-shadow:   0 -2px 24px rgba(0, 0, 0, 0.10);
  --ack-toggle-on: var(--ack-dark);
  --ack-transition: 220ms ease;
  --ack-radius:   20px;
  --ack-z:        99999;
}

/* Force [hidden] to work — Bricks overrides the browser default */
.ar-ck-banner[hidden],
.ar-ck-banner__quick[hidden],
.ar-ck-panel[hidden],
.ar-ck-acc__body[hidden] {
  display: none !important;
}

/* ── Banner ─────────────────────────────────────────────────────────────── */
.ar-ck-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--ack-z);
  background: var(--ack-bg);
  box-shadow: var(--ack-shadow);
  font-family: var(--ack-font);

  /* Slide-up entrance */
  transform: translateY(100%);
  transition: transform 380ms cubic-bezier(.2,.9,.2,1);
}

.ar-ck-banner.is-visible {
  transform: translateY(0);
}

/* Row 1: bar */
.ar-ck-banner__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px clamp(24px, 4vw, 80px);
  min-height: 72px;
}

.ar-ck-banner__text {
  margin: 0;
  font-size: 15px;
  line-height: 22px;
  color: var(--ack-muted);
  flex: 1 1 auto;
}

.ar-ck-banner__text a {
  color: var(--ack-red);
  text-decoration: underline;
}

.ar-ck-banner__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 0 0 auto;
}

/* ── Quick toggle row (Row 2) ───────────────────────────────────────────── */
.ar-ck-banner__quick {
  border-top: 1px solid rgba(255,255,255,0.1);
  background: var(--ack-sherpa);

  /* Animate open */
  overflow: hidden;
  max-height: 0;
  transition: max-height 320ms cubic-bezier(.2,.9,.2,1);
}

.ar-ck-banner__quick.is-open {
  max-height: 120px;
}

.ar-ck-quick__inner {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px clamp(24px, 4vw, 80px);
  flex-wrap: wrap;
  gap: 12px 32px;
}

/* Individual checkbox item */
.ar-ck-quick__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.ar-ck-quick__item--disabled {
  cursor: default;
  opacity: 0.65;
}

/* Hide native checkbox visually */
.ar-ck-quick__item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Custom checkbox square */
.ar-ck-quick__check {
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  flex: 0 0 auto;
  transition: background var(--ack-transition), border-color var(--ack-transition);
}

.ar-ck-quick__check svg {
  width: 11px;
  height: 11px;
  color: #fff;
  opacity: 0;
  transition: opacity var(--ack-transition);
}

/* Checked state — driven by JS class */
.ar-ck-quick__check--checked {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.8);
}
.ar-ck-quick__check--checked svg {
  opacity: 1;
}

.ar-ck-quick__label {
  font-size: 14px;
  line-height: 1;
  color: rgba(255,255,255,0.9);
  font-weight: 500;
}

/* ── Banner action button spacing ───────────────────────────────────────── */
.ar-ck-banner__actions {
  display: flex;
  align-items: center;
  gap: 32px;
  flex: 0 0 auto;
  font-size: 15px;
}

/* ── ar-action colour overrides for cookie context ──────────────────────── */

/* "Change Settings" — sherpa/dark text, inherits ar-action base */
.ar-ck-action--change {
  font-size: 15px;
  font-weight: 600;
}

/* "Accept and Close" / "Accept All" — match size exactly to Change Settings */
.ar-ck-action--accept,
.ar-ck-action--accept-all {
  font-size: 15px;
  font-weight: 600;
}

/* "Accept and Close" / "Accept All" — red tone via data-tone="red" on ar-action */
.ar-ck-action--accept .ar-action__circle,
.ar-ck-action--accept-all .ar-action__circle {
  border-color: rgba(193, 0, 15, 0.5);
}

/* Quick row — white tone actions */
.ar-ck-action--customise,
.ar-ck-action--save {
  font-size: 14px;
  font-weight: 600;
}

/* Panel footer — sherpa/dark actions with more breathing room */
.ar-ck-panel__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 28px;
  padding: 24px 40px;
  border-top: 1px solid var(--ack-border);
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.ar-ck-action--reject,
.ar-ck-action--save-panel {
  font-size: 15px;
  font-weight: 600;
}

/* Quick save row spacing */
.ar-ck-quick__save {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 28px;
}

/* ── Settings Panel (modal) ─────────────────────────────────────────────── */
.ar-ck-panel {
  position: fixed;
  inset: 0;
  z-index: calc(var(--ack-z) + 1);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-family: var(--ack-font);

  /* Hidden state */
  pointer-events: none;
  opacity: 0;
  transition: opacity 280ms ease;
}

.ar-ck-panel.is-open {
  pointer-events: auto;
  opacity: 1;
}

.ar-ck-panel__overlay {
  position: absolute;
  inset: 0;
  background: rgba(1, 48, 58, 0.45);
  cursor: pointer;
}

.ar-ck-panel__dialog {
  position: relative;
  background: var(--ack-bg);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  border-radius: var(--ack-radius) var(--ack-radius) 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 48px rgba(0,0,0,0.18);

  transform: translateY(40px);
  transition: transform 320ms cubic-bezier(.2,.9,.2,1);
}

.ar-ck-panel.is-open .ar-ck-panel__dialog {
  transform: translateY(0);
}

/* Panel header */
.ar-ck-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 40px 20px;
  border-bottom: 1px solid var(--ack-border);
  flex: 0 0 auto;
}

.ar-ck-panel__title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ack-dark);
}

.ar-ck-panel__close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--ack-dark);
  border-radius: 50%;
  transition: background var(--ack-transition);
  padding: 0;
}
.ar-ck-panel__close:hover { background: rgba(1,48,58,0.07); }
.ar-ck-panel__close svg { width: 20px; height: 20px; }

/* Panel scrollable body */
.ar-ck-panel__body {
  overflow-y: auto;
  flex: 1 1 auto;
  padding: 28px 40px;
  overscroll-behavior: contain;
}

/* Intro text */
.ar-ck-panel__intro {
  font-size: 15px;
  line-height: 24px;
  color: var(--ack-muted);
  margin-bottom: 28px;
}

.ar-ck-panel__intro p {
  margin: 0 0 14px;
}
.ar-ck-panel__intro p:last-child { margin-bottom: 0; }

/* ── Accordion ──────────────────────────────────────────────────────────── */
.ar-ck-acc {
  border-top: 1px solid var(--ack-border);
}
.ar-ck-acc:last-child {
  border-bottom: 1px solid var(--ack-border);
}

/* Force hidden to work even if Bricks/theme overrides [hidden] globally */
.ar-ck-acc__body[hidden] {
  display: none !important;
}

.ar-ck-acc__head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 0;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--ack-font);
  transition: background var(--ack-transition);
}

.ar-ck-acc__head:hover {
  background: rgba(1,48,58,0.03);
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  width: calc(100% + 16px);
}

/* Chevron */
.ar-ck-acc__chevron {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--ack-dark);
  transition: transform var(--ack-transition);
}

.ar-ck-acc__head[aria-expanded="true"] .ar-ck-acc__chevron {
  transform: rotate(90deg);
}

/* Name */
.ar-ck-acc__name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ack-dark);
  flex: 1 1 auto;
}

/* "Always Active" badge */
.ar-ck-acc__badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--ack-red);
  margin-left: auto;
}

/* Body content */
.ar-ck-acc__body {
  padding: 0 0 18px 30px;
  overflow: hidden;
}

.ar-ck-acc__body p {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--ack-muted);
}

/* ── Toggle switch ──────────────────────────────────────────────────────── */
.ar-ck-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  cursor: pointer;
  flex: 0 0 auto;
  /* Stop accordion button expanding when toggle is clicked */
}

.ar-ck-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ar-ck-toggle__track {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(1,48,58,0.15);
  position: relative;
  transition: background var(--ack-transition);
  flex: 0 0 auto;
}

.ar-ck-toggle__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform var(--ack-transition), background var(--ack-transition);
}

.ar-ck-toggle input:checked + .ar-ck-toggle__track {
  background: var(--ack-toggle-on);
}

.ar-ck-toggle input:checked + .ar-ck-toggle__track::after {
  transform: translateX(20px);
}

/* Focus */
.ar-ck-toggle input:focus-visible + .ar-ck-toggle__track {
  outline: 2px solid var(--ack-red);
  outline-offset: 3px;
}

/* ── Reopen shortcode button ────────────────────────────────────────────── */
.ar-ck-reopen {
  font-family: var(--ack-font);
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}
.ar-ck-reopen:hover { opacity: 0.7; }

/* Footer bottom bar — copyright + cookie settings inline */
.aradel-footer__bottom {
  margin-top: 84px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0;
  font-size: 18px;
  line-height: 28px;
  opacity: 0.9;
}

.aradel-footer__bottom-sep {
  opacity: 0.5;
  user-select: none;
}

.aradel-footer__cookie-btn {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-decoration: none !important;
  opacity: 1;
}
.aradel-footer__cookie-btn:hover {
  opacity: 0.7;
}

@media (max-width: 1024px) {
  .aradel-footer__bottom {
    margin-top: 56px;
  }
}

@media (max-width: 768px) {
  .aradel-footer__bottom {
    margin-top: 40px;
    font-size: 16px;
    line-height: 24px;
    flex-wrap: wrap;
    gap: 4px 0;
  }
}

/* ── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ar-ck-banner,
  .ar-ck-banner__quick,
  .ar-ck-panel,
  .ar-ck-panel__dialog {
    transition: none !important;
  }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .ar-ck-banner__bar {
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 24px;
  }

  .ar-ck-banner__text {
    flex: 1 1 100%;
  }

  .ar-ck-banner__actions {
    flex: 1 1 100%;
    justify-content: flex-end;
  }

  .ar-ck-quick__inner {
    padding: 14px 24px;
    gap: 10px 20px;
  }

  .ar-ck-quick__save {
    margin-left: 0;
    flex: 1 1 100%;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.1);
  }

  .ar-ck-banner__quick.is-open {
    max-height: 200px;
  }

  .ar-ck-panel__head,
  .ar-ck-panel__body,
  .ar-ck-panel__foot {
    padding-left: 24px;
    padding-right: 24px;
  }

  .ar-ck-panel__foot {
    justify-content: stretch;
    gap: 20px;
  }
  .ar-ck-panel__foot .ar-action {
    flex: 1 1 auto;
  }

  .ar-ck-panel__title {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .ar-ck-panel__foot {
    flex-direction: column;
    gap: 10px;
  }
}
