/* Nosibele cookie consent UI */
.nb-consent {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 10050;
  padding: max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  pointer-events: none;
}

.nb-consent[hidden] { display: none !important; }

.nb-consent__banner,
.nb-consent__prefs {
  pointer-events: auto;
  max-width: 920px;
  margin: 0 auto;
  background: #fffdf8;
  color: #3d3733;
  border: 1px solid rgba(140, 12, 18, 0.12);
  border-radius: 18px;
  box-shadow: 0 -10px 40px rgba(28, 8, 10, 0.16);
  padding: 18px 20px;
  font-family: Manrope, "Segoe UI", sans-serif;
}

.nb-consent__prefs {
  max-height: min(78vh, 640px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.nb-consent__title {
  margin: 0 0 8px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  font-weight: 600;
  color: #221d1a;
  line-height: 1.15;
}

.nb-consent__text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #4a433e;
}

.nb-consent__text a {
  color: #8C0C12;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.nb-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.nb-consent__btn {
  min-height: 48px;
  min-width: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1.5px solid transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  flex: 1 1 160px;
}

.nb-consent__btn:focus-visible {
  outline: 3px solid #C8A14A;
  outline-offset: 2px;
}

.nb-consent__btn--primary {
  background: #8C0C12;
  color: #fffdf8;
}

.nb-consent__btn--secondary {
  background: #fff;
  color: #221d1a;
  border-color: #d9d2cb;
}

.nb-consent__btn--ghost {
  background: #fff;
  color: #221d1a;
  border-color: #8C0C12;
}

.nb-consent__prefs-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.nb-consent__close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: #f3eee7;
  color: #221d1a;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  flex: none;
}

.nb-consent__cats {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.nb-consent__cat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #ece7e2;
  border-radius: 14px;
  background: #fbf9f7;
}

.nb-consent__cat strong {
  display: block;
  color: #221d1a;
  font-size: 0.98rem;
}

.nb-consent__cat-desc {
  display: block;
  margin-top: 4px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: #6a625c;
}

.nb-consent__cat input {
  width: 22px;
  height: 22px;
  accent-color: #8C0C12;
}

.nb-consent__live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

html.nb-consent-open {
  scroll-padding-bottom: 220px;
}

@media (max-width: 640px) {
  .nb-consent {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  .nb-consent__banner,
  .nb-consent__prefs {
    border-radius: 16px 16px 12px 12px;
    padding: 16px;
  }
  .nb-consent__actions {
    flex-direction: column;
  }
  .nb-consent__btn {
    flex: 1 1 auto;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nb-consent__banner,
  .nb-consent__prefs {
    transition: none !important;
  }
}

/* Lift floating controls above the banner while consent is open */
html.nb-consent-open .nb-wa--floating,
html.nb-consent-open .nb-totop {
  bottom: calc(210px + env(safe-area-inset-bottom, 0px)) !important;
}

@media (min-width: 641px) {
  html.nb-consent-open .nb-wa--floating,
  html.nb-consent-open .nb-totop {
    bottom: calc(160px + env(safe-area-inset-bottom, 0px)) !important;
  }
}
