/* AEPD-style consent layer: non-essential analytics are opt-in only. */
.cookie-consent-backdrop,
.cookie-preferences-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(15, 23, 42, 0.35);
  display: none;
}
.cookie-consent,
.cookie-preferences {
  position: fixed;
  z-index: 9999;
  box-sizing: border-box;
  background: #fffaf1;
  color: #211714;
  border: 1px solid rgba(80, 45, 28, 0.18);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
  font-family: inherit;
}
.cookie-consent {
  left: 50%;
  bottom: 1rem;
  width: min(940px, calc(100% - 2rem));
  transform: translateX(-50%);
  padding: 1.1rem;
  border-radius: 18px;
}
.cookie-consent[hidden],
.cookie-preferences[hidden],
.cookie-consent-backdrop[hidden],
.cookie-preferences-backdrop[hidden] { display: none !important; }
.cookie-consent:not([hidden]),
.cookie-preferences:not([hidden]),
.cookie-consent-backdrop:not([hidden]),
.cookie-preferences-backdrop:not([hidden]) { display: block; }
.cookie-consent__title,
.cookie-preferences__title {
  margin: 0 0 .45rem;
  font-size: 1.15rem;
  line-height: 1.25;
  font-weight: 750;
}
.cookie-consent__text,
.cookie-preferences__text {
  margin: 0;
  color: #5b4a43;
  font-size: .96rem;
  line-height: 1.55;
}
.cookie-consent__link,
.cookie-preferences__link {
  color: #7b351e;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cookie-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: 1rem;
}
.cookie-btn {
  border: 1px solid #7b351e;
  border-radius: 999px;
  padding: .72rem 1rem;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  min-width: 150px;
  min-height: 44px;
  background: transparent;
  color: #7b351e;
}
.cookie-btn--primary,
.cookie-btn--reject {
  background: #7b351e;
  color: #fffaf1;
}
.cookie-btn--secondary {
  background: transparent;
  color: #7b351e;
}
.cookie-btn:focus-visible,
.cookie-toggle input:focus-visible + .cookie-toggle__visual {
  outline: 3px solid rgba(123, 53, 30, 0.35);
  outline-offset: 3px;
}
.cookie-preferences {
  left: 50%;
  top: 50%;
  width: min(680px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  transform: translate(-50%, -50%);
  padding: 1.2rem;
  border-radius: 20px;
}
.cookie-preferences__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.cookie-preferences__close {
  border: 0;
  background: transparent;
  color: #211714;
  font: inherit;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 .25rem;
}
.cookie-category {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(80, 45, 28, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
}
.cookie-category__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.cookie-category__title {
  margin: 0 0 .25rem;
  font-weight: 750;
}
.cookie-category__text {
  margin: 0;
  color: #5b4a43;
  font-size: .92rem;
  line-height: 1.45;
}
.cookie-category__required {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: .1rem .75rem;
  border-radius: 999px;
  background: rgba(123, 53, 30, 0.1);
  color: #7b351e;
  font-weight: 750;
  white-space: nowrap;
}
.cookie-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.cookie-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.cookie-toggle__visual {
  width: 56px;
  height: 32px;
  border-radius: 999px;
  background: #c9bdb4;
  position: relative;
  transition: background .18s ease;
}
.cookie-toggle__visual::after {
  content: '';
  position: absolute;
  width: 26px;
  height: 26px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  transition: transform .18s ease;
}
.cookie-toggle input:checked + .cookie-toggle__visual {
  background: #7b351e;
}
.cookie-toggle input:checked + .cookie-toggle__visual::after {
  transform: translateX(24px);
}
.cookie-preferences__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: 1rem;
}
@media (max-width: 640px) {
  .cookie-consent { bottom: .5rem; padding: 1rem; }
  .cookie-consent__actions, .cookie-preferences__actions { flex-direction: column; }
  .cookie-btn { width: 100%; }
  .cookie-category__row { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .cookie-toggle__visual, .cookie-toggle__visual::after { transition: none; }
}
