/* Cookie consent UI — matches Onzii360 brand palette */

:root {
  --cookie-primary: #006980;
  --cookie-primary-hover: #005566;
  --cookie-accent: #fd7562;
  --cookie-foreground: #002f3b;
  --cookie-muted: rgba(0, 47, 59, 0.72);
  --cookie-border: rgba(0, 47, 59, 0.12);
  --cookie-surface: #ffffff;
  --cookie-shadow: 0 -8px 40px rgba(0, 47, 59, 0.14);
}

body.cookie-banner-open {
  padding-bottom: 0;
}

body.cookie-modal-open {
  overflow: hidden;
}

/* ── Banner ─────────────────────────────────────────────── */

.cookie-banner {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10000;
  padding: 1rem;
  animation: cookie-slide-up 0.35s ease;
}

.cookie-banner[hidden] {
  display: none !important;
}

.cookie-banner__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.35rem 1.5rem;
  border-radius: 1.1rem;
  border: 1px solid var(--cookie-border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  box-shadow: var(--cookie-shadow);
}

.cookie-banner__title {
  margin: 0 0 0.5rem;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cookie-foreground);
  letter-spacing: -0.02em;
}

.cookie-banner__description {
  margin: 0;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--cookie-muted);
  max-width: 52rem;
}

.cookie-banner__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
  min-width: 220px;
}

/* ── Buttons ────────────────────────────────────────────── */

.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.cookie-btn--primary {
  background: var(--cookie-primary);
  color: #fff;
}

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

.cookie-btn--secondary {
  background: rgba(0, 105, 128, 0.08);
  color: var(--cookie-primary);
  border-color: rgba(0, 105, 128, 0.2);
}

.cookie-btn--secondary:hover {
  background: rgba(0, 105, 128, 0.14);
}

.cookie-btn--ghost {
  background: transparent;
  color: var(--cookie-muted);
  border-color: var(--cookie-border);
}

.cookie-btn--ghost:hover {
  color: var(--cookie-foreground);
  border-color: rgba(0, 47, 59, 0.22);
}

.cookie-settings-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  color: var(--cookie-primary);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}

.cookie-settings-link:hover {
  text-decoration: underline;
}

/* ── Modal ──────────────────────────────────────────────── */

.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cookie-modal[hidden] {
  display: none !important;
}

.cookie-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 47, 59, 0.45);
  backdrop-filter: blur(4px);
}

.cookie-modal__panel {
  position: relative;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  border-radius: 1.25rem;
  background: var(--cookie-surface);
  border: 1px solid var(--cookie-border);
  box-shadow: 0 24px 60px rgba(0, 47, 59, 0.2);
  animation: cookie-fade-in 0.25s ease;
}

.cookie-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: rgba(0, 47, 59, 0.06);
  color: var(--cookie-foreground);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.cookie-modal__close::before {
  content: "×";
}

.cookie-modal__close:hover {
  background: rgba(0, 47, 59, 0.12);
}

.cookie-modal__title {
  margin: 0 2rem 0.5rem 0;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--cookie-foreground);
  letter-spacing: -0.02em;
}

.cookie-modal__description {
  margin: 0 0 1.25rem;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--cookie-muted);
}

.cookie-modal__toggles {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.cookie-modal__actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* ── Toggle rows ────────────────────────────────────────── */

.cookie-toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-radius: 0.85rem;
  border: 1px solid var(--cookie-border);
  background: rgba(248, 253, 254, 0.8);
}

.cookie-toggle__title {
  margin: 0 0 0.25rem;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cookie-foreground);
}

.cookie-toggle__description {
  margin: 0;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--cookie-muted);
}

.cookie-switch {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.cookie-switch__label {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cookie-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.cookie-switch__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-switch__track {
  position: relative;
  display: block;
  width: 2.75rem;
  height: 1.5rem;
  border-radius: 999px;
  background: rgba(0, 47, 59, 0.18);
  cursor: pointer;
  transition: background 0.2s ease;
}

.cookie-switch__track::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease;
}

.cookie-switch__input:checked + .cookie-switch__track {
  background: var(--cookie-primary);
}

.cookie-switch__input:checked + .cookie-switch__track::after {
  transform: translateX(1.25rem);
}

.cookie-switch__input:focus-visible + .cookie-switch__track {
  outline: 2px solid var(--cookie-accent);
  outline-offset: 2px;
}

/* ── Animations ─────────────────────────────────────────── */

@keyframes cookie-slide-up {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cookie-fade-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 768px) {
  .cookie-banner__inner {
    flex-direction: column;
    padding: 1.15rem;
  }

  .cookie-banner__actions {
    width: 100%;
    min-width: 0;
  }

  .cookie-btn {
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  .cookie-modal__actions {
    flex-direction: column;
  }

  .cookie-modal__actions .cookie-btn {
    width: 100%;
  }
}
