/* ============================================================
 * ab24-cookie-consent.css
 * Cookie consent banner + preferences modal.
 * All tokens inherited from ab24.css — no hardcoded colors.
 * ============================================================ */

/* ─────────────────────────────────────────────
 *  Bottom banner (first visit)
 * ───────────────────────────────────────────── */
.ab-cookie {
  position: fixed; left: 16px; right: 16px; bottom: 16px;
  z-index: 9000;
  background: var(--ab-surface);
  border: 1px solid var(--ab-line);
  border-radius: var(--ab-radius);
  box-shadow: var(--ab-shadow-elevated);
  padding: 20px 24px;
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  transform: translateY(calc(100% + 24px));
  opacity: 0;
  transition: transform 0.36s var(--ab-ease), opacity 0.24s var(--ab-ease);
}
.ab-cookie.is-visible { transform: translateY(0); opacity: 1; }
.ab-cookie[hidden] { display: none; }

.ab-cookie__icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--ab-blue-soft); color: var(--ab-blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.ab-cookie__body { flex: 1; min-width: 0; }
.ab-cookie__title {
  font-size: 14.5px; font-weight: 600;
  color: var(--ab-ink); margin: 0 0 4px;
  line-height: 1.3;
}
.ab-cookie__text {
  font-size: 13px; color: var(--ab-ink-2);
  line-height: 1.5; margin: 0;
}
.ab-cookie__text a { color: var(--ab-blue); text-decoration: underline; }
.ab-cookie__actions {
  display: flex; gap: 8px; flex-shrink: 0;
}
.ab-cookie__actions .ab-btn { font-size: 13px; padding: 9px 16px; }

@media (max-width: 767px) {
  .ab-cookie {
    flex-direction: column; align-items: stretch; gap: 14px;
    padding: 18px 20px;
  }
  .ab-cookie__icon { display: none; }
  .ab-cookie__actions { flex-direction: column; }
  .ab-cookie__actions .ab-btn { width: 100%; }
}

/* ─────────────────────────────────────────────
 *  Preferences modal (reuses .ab-modal tokens)
 * ───────────────────────────────────────────── */
.ab-cookie-modal {
  position: fixed; inset: 0; z-index: 9100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.ab-cookie-modal[hidden] { display: none; }
.ab-cookie-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(16, 20, 27, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: abCookieModalFade 0.2s var(--ab-ease);
}
.ab-cookie-modal__dialog {
  position: relative;
  background: var(--ab-surface);
  border-radius: var(--ab-radius-lg);
  box-shadow: var(--ab-shadow-modal);
  width: 100%; max-width: 560px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 28px 32px;
  animation: abCookieModalSlide 0.28s var(--ab-ease);
}
@media (max-width: 767px) {
  .ab-cookie-modal__dialog { padding: 22px 20px; }
}
@keyframes abCookieModalFade {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes abCookieModalSlide {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.ab-cookie-modal__close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; padding: 0;
  min-width: 32px; min-height: 32px; aspect-ratio: 1; flex-shrink: 0;
  border-radius: 50%;
  background: transparent; border: 0;
  color: var(--ab-ink-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--ab-dur) var(--ab-ease);
}
.ab-cookie-modal__close:hover { background: var(--ab-bg); color: var(--ab-ink); }
.ab-cookie-modal__title {
  font-size: 19px; font-weight: 700;
  color: var(--ab-ink); letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.ab-cookie-modal__sub {
  font-size: 13.5px; color: var(--ab-ink-3);
  line-height: 1.55; margin: 0 0 22px;
}

/* Category rows with toggle */
.ab-cookie-cat {
  padding: 16px 0;
  border-top: 1px solid var(--ab-line);
}
.ab-cookie-cat:last-of-type { border-bottom: 1px solid var(--ab-line); margin-bottom: 20px; }
.ab-cookie-cat__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 4px;
}
.ab-cookie-cat__title {
  font-size: 14.5px; font-weight: 600; color: var(--ab-ink);
  margin: 0; line-height: 1.3;
}
.ab-cookie-cat__desc {
  font-size: 12.5px; color: var(--ab-ink-3);
  line-height: 1.5; margin: 0;
}

/* Toggle switch */
.ab-toggle {
  position: relative; display: inline-block;
  width: 40px; height: 22px;
  flex-shrink: 0;
}
.ab-toggle input {
  opacity: 0; width: 0; height: 0;
}
.ab-toggle__track {
  position: absolute; inset: 0;
  background: var(--ab-ink-5, #b8c4d4);
  border-radius: 100px;
  transition: background var(--ab-dur) var(--ab-ease);
  cursor: pointer;
}
.ab-toggle__track::before {
  content: "";
  position: absolute; left: 3px; top: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--ab-dur) var(--ab-ease);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.ab-toggle input:checked + .ab-toggle__track {
  background: var(--ab-blue);
}
.ab-toggle input:checked + .ab-toggle__track::before {
  transform: translateX(18px);
}
.ab-toggle input:disabled + .ab-toggle__track {
  background: var(--ab-success);
  cursor: not-allowed;
  opacity: 0.7;
}

/* Locked badge for required cookies */
.ab-cookie-cat__required {
  display: inline-block;
  padding: 2px 8px;
  background: var(--ab-success-soft);
  color: var(--ab-success);
  font-size: 10.5px; font-weight: 600;
  border-radius: 100px;
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-left: 8px;
}

/* Modal footer buttons */
.ab-cookie-modal__actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  justify-content: flex-end;
}
.ab-cookie-modal__actions .ab-btn { font-size: 13.5px; padding: 10px 18px; }
@media (max-width: 480px) {
  .ab-cookie-modal__actions { flex-direction: column-reverse; }
  .ab-cookie-modal__actions .ab-btn { width: 100%; }
}
