/* =====================================================================
   MEDISPOT — Cookie Consent Banner & Modal
   ===================================================================== */

/* ---------- BANNER (bottom dock) ---------- */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  background: var(--bg-elev);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  padding: 24px 28px;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  max-width: calc(100% - 32px);
}
.cookie-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
}
[data-theme="dark"] .cookie-banner {
  background: var(--surface);
}

.cookie-banner__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
}

.cookie-banner__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--ink);
  line-height: 1.2;
}

.cookie-banner__text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-3);
  margin: 0;
  max-width: 720px;
}
.cookie-banner__text a {
  color: var(--brand-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
  white-space: nowrap;
  margin-left: 4px;
}
[data-theme="dark"] .cookie-banner__text a { color: var(--brand); }

.cookie-banner__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ---------- BUTTONS ---------- */
.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 999px;
  cursor: pointer;
  border: none;
  background: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}
.cookie-btn--ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line-2);
}
.cookie-btn--ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--ink-3);
}
.cookie-btn--primary {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: var(--shadow-brand);
}
.cookie-btn--primary:hover {
  background: var(--brand-soft);
  transform: translateY(-1px);
}

/* ---------- MODAL ---------- */
.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.cookie-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.cookie-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 20, 16, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cookie-modal__panel {
  position: relative;
  width: min(560px, calc(100% - 32px));
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  padding: 28px 32px 24px;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.cookie-modal.is-visible .cookie-modal__panel {
  transform: scale(1);
}

.cookie-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.cookie-modal__head h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}
.cookie-modal__close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.2s ease;
}
.cookie-modal__close:hover {
  background: var(--ink);
  color: var(--bg);
}

.cookie-modal__desc {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.6;
  margin: 0 0 24px;
}

/* ---------- CATEGORY ROW ---------- */
.cookie-cat {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.cookie-cat:first-of-type { border-top: none; padding-top: 8px; }
.cookie-cat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.cookie-cat__head strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.cookie-cat__desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
  padding-right: 60px;
}
.cookie-cat__badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 20%, transparent);
  color: var(--brand-deep);
}
[data-theme="dark"] .cookie-cat__badge { color: var(--brand); }

/* Switch */
.cookie-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
  flex-shrink: 0;
}
.cookie-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.cookie-switch span {
  position: absolute;
  inset: 0;
  background: var(--line-2);
  border-radius: 999px;
  transition: background 0.25s ease;
}
.cookie-switch span::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.cookie-switch input:checked + span {
  background: var(--brand);
}
.cookie-switch input:checked + span::before {
  transform: translateX(20px);
}
.cookie-switch input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--brand-glow);
}

/* Footer */
.cookie-modal__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* ---------- MANAGE BUTTON (floating) ---------- */
.cookie-manage-btn {
  position: fixed;
  bottom: 24px;
  left: 20px;
  z-index: 35;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elev);
  border: 1px solid var(--line-2);
  border-radius: 50%;
  color: var(--ink-2);
  cursor: pointer;
  box-shadow: var(--shadow-2);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
}
.cookie-manage-btn.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.cookie-manage-btn:hover {
  background: var(--ink);
  color: var(--brand);
  transform: scale(1.05);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 880px) {
  .cookie-banner {
    padding: 20px;
    border-radius: var(--radius);
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
  .cookie-banner__inner {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .cookie-banner__title { font-size: 18px; }
  .cookie-banner__text { font-size: 13px; }
  .cookie-banner__actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .cookie-btn { width: 100%; padding: 12px 18px; }

  .cookie-modal__panel { padding: 24px 22px 20px; }
  .cookie-modal__head h2 { font-size: 22px; }
  .cookie-cat__desc { padding-right: 0; }
  .cookie-modal__foot {
    flex-direction: column-reverse;
  }
  .cookie-modal__foot .cookie-btn { width: 100%; }
}
