/* ==========================================================================
   AirGo Tel — cookie consent banner + preferences modal
   Ported from airgo-web_design/"AirGo Cookie Consent.dc.html".

   Self-contained literal values rather than var(--ag-*), matching the header
   component: this loads on every page including 404.html and coming-soon.html,
   which do not import design-tokens.css.
   ========================================================================== */

@keyframes agCookieUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes agCookieFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ag-cookie,
.ag-cookie * { box-sizing: border-box; }

.ag-cookie button { font-family: inherit; }

/* ---------- Banner ----------
   z-index 9000: RESPONSIVE.md puts consent above the mobile sticky CTA (8000)
   so a purchase bar can never cover the consent choice. */

.ag-cookie-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9000;
  display: flex;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
  font-family: "Manrope", system-ui, sans-serif;
}

.ag-cookie-bar__panel {
  pointer-events: auto;
  width: 100%;
  max-width: 1080px;
  background: #fff;
  border: 1px solid #e4eaf0;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(11, 32, 56, 0.22);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  animation: agCookieUp 0.3s ease;
}

.ag-cookie-bar__copy { flex: 1; min-width: 240px; }

.ag-cookie-bar__title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.ag-cookie-bar__icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #edf4ff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ag-cookie-bar__icon svg { width: 17px; height: 17px; display: block; }

.ag-cookie-bar__title {
  font-family: "Sora", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #0b2038;
  margin: 0;
}

.ag-cookie-bar__text {
  font-size: 13.5px;
  color: #5b6b7c;
  line-height: 1.5;
  margin: 0;
}
.ag-cookie-bar__text a { font-weight: 700; color: #1a5fcc; text-decoration: none; }
.ag-cookie-bar__text a:hover { text-decoration: underline; }

.ag-cookie-bar__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.ag-cookie-btn {
  font-size: 13.5px;
  font-weight: 800;
  border-radius: 11px;
  padding: 12px 18px;
  cursor: pointer;
  border: 0;
  min-height: 44px;
  transition: background 150ms, border-color 150ms;
}
.ag-cookie-btn--ghost {
  color: #0b2038;
  background: #fff;
  border: 1px solid #e4eaf0;
  padding: 12px 16px;
}
.ag-cookie-btn--ghost:hover { border-color: #1f73f1; }
.ag-cookie-btn--soft { color: #0b2038; background: #f0f5f9; }
.ag-cookie-btn--soft:hover { background: #e4eaf0; }
.ag-cookie-btn--primary {
  color: #fff;
  background: #ff5c39;
  padding: 12px 20px;
  box-shadow: 0 6px 16px rgba(255, 92, 57, 0.3);
}
.ag-cookie-btn--primary:hover { background: #f0492a; }

/* ---------- Preferences modal ---------- */

.ag-cookie-overlay {
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: rgba(11, 32, 56, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: agCookieFade 0.2s ease;
  font-family: "Manrope", system-ui, sans-serif;
}

.ag-cookie-modal {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 30px 70px rgba(11, 32, 56, 0.3);
  padding: 28px;
  animation: agCookieUp 0.25s ease;
  max-height: 88vh;
  overflow-y: auto;
}

.ag-cookie-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 8px;
}

.ag-cookie-modal__title {
  font-family: "Sora", system-ui, sans-serif;
  font-size: 21px;
  font-weight: 800;
  color: #0b2038;
  margin: 0;
}

.ag-cookie-modal__close {
  background: #f0f5f9;
  border: 0;
  width: 44px;
  height: 44px;
  border-radius: 9px;
  font-size: 18px;
  cursor: pointer;
  color: #0b2038;
  flex-shrink: 0;
}
.ag-cookie-modal__close:hover { background: #e4eaf0; }

.ag-cookie-modal__lead {
  font-size: 13.5px;
  color: #5b6b7c;
  line-height: 1.55;
  margin: 0 0 20px;
}

.ag-cookie-groups { display: flex; flex-direction: column; gap: 12px; }

.ag-cookie-group {
  border: 1px solid #e4eaf0;
  border-radius: 13px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  background: #fff;
  text-align: left;
  width: 100%;
}

button.ag-cookie-group { cursor: pointer; }
button.ag-cookie-group[aria-pressed="true"] { border-color: #bfe9cf; }

.ag-cookie-group__name {
  display: block;
  font-size: 14.5px;
  font-weight: 800;
  color: #0b2038;
}
.ag-cookie-group__desc {
  display: block;
  font-size: 12.5px;
  color: #5b6b7c;
  line-height: 1.4;
}

.ag-cookie-group__locked {
  font-size: 12px;
  font-weight: 800;
  color: #14a44d;
  background: #e7f8ee;
  padding: 6px 12px;
  border-radius: 100px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Switch */
.ag-cookie-switch {
  flex-shrink: 0;
  width: 46px;
  height: 26px;
  border-radius: 100px;
  background: #cbd6e0;
  position: relative;
  transition: background 150ms;
}
.ag-cookie-switch::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, 0.25);
  transition: left 150ms;
}
[aria-pressed="true"] .ag-cookie-switch { background: #2fd07e; }
[aria-pressed="true"] .ag-cookie-switch::after { left: 23px; }

.ag-cookie-modal__actions { display: flex; gap: 10px; margin-top: 22px; }
.ag-cookie-modal__actions .ag-cookie-btn { flex: 1; font-size: 14px; padding: 13px; }

/* ---------- Footer re-open link ---------- */

.ag-cookie-reopen {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.ag-cookie-reopen:hover { color: #8fc2ff; }

/* ---------- Focus ring (matches HANDOFF.md §4) ---------- */

.ag-cookie-bar :focus-visible,
.ag-cookie-overlay :focus-visible,
.ag-cookie-reopen:focus-visible {
  outline: 3px solid #1f73f1;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Responsive ---------- */

@media (max-width: 600px) {
  .ag-cookie-bar { padding: 10px; }
  .ag-cookie-bar__panel { padding: 18px; gap: 16px; }
  .ag-cookie-bar__actions { width: 100%; }
  .ag-cookie-bar__actions .ag-cookie-btn { flex: 1 1 100%; }
  .ag-cookie-modal { padding: 22px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .ag-cookie-bar__panel,
  .ag-cookie-overlay,
  .ag-cookie-modal { animation: none; }
}
