/* ================== Cookie Banner · Caltech (polido editorial) ================== */

.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 560px;
  z-index: 2000;
  display: none;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(1.4) blur(18px);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  border: 1px solid rgba(30, 70, 30, 0.08);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(10, 40, 10, 0.18);
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  animation: cookieSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.cookie-banner.is-visible { display: block; }

@keyframes cookieSlideUp {
  from { opacity: 0; transform: translate(-50%, 24px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.cookie-banner__inner {
  position: relative;
  padding: 28px 32px;
}

.cookie-banner__close {
  position: absolute;
  top: 16px; right: 16px;
  background: transparent;
  border: none;
  width: 28px; height: 28px;
  border-radius: 999px;
  font-size: 22px;
  line-height: 1;
  color: #6b7a6c;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cookie-banner__close:hover {
  background: rgba(20, 35, 26, 0.06);
  color: #14231a;
}

.cookie-banner__kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #1f5f23;
  margin-bottom: 10px;
}

.cookie-banner__kicker::before {
  content: '';
  width: 24px;
  height: 1px;
  background: #1f5f23;
}

.cookie-banner__title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: 1.45rem;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: #14231a;
  margin: 0 0 10px;
  text-align: left;
}

.cookie-banner__title em {
  font-style: italic;
  color: #2e7d32;
}

.cookie-banner__text {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #5a6b5a;
  margin: 0 0 20px;
  text-align: left;
}

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

.cookie-banner__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
}

.cookie-banner__btn--accept {
  background: #1f5f23;
  color: #ffffff;
}

.cookie-banner__btn--accept:hover {
  background: #14401a;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(31, 95, 35, 0.22);
}

.cookie-banner__btn--decline {
  background: transparent;
  color: #14231a;
  border-color: rgba(20, 35, 26, 0.2);
}

.cookie-banner__btn--decline:hover {
  background: #14231a;
  color: #ffffff;
  border-color: #14231a;
}

.cookie-banner__btn--link {
  background: transparent;
  color: #1f5f23;
  padding: 11px 0;
  border: none;
  text-decoration: underline;
  text-underline-offset: 3px;
  letter-spacing: 0.08em;
  margin-left: auto;
}

.cookie-banner__btn--link:hover { color: #14401a; }

.cookie-banner__btn--save {
  background: #c89b3c;
  color: #1c1300;
  margin-top: 14px;
}

.cookie-banner__btn--save:hover {
  background: #a07e28;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(200, 155, 60, 0.28);
}

/* ===== Custom panel ===== */
.cookie-banner__custom {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(20, 35, 26, 0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.cookie-switch {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(139, 195, 74, 0.04);
  border: 1px solid rgba(20, 35, 26, 0.06);
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.cookie-switch:not(.is-required):hover {
  background: rgba(139, 195, 74, 0.08);
  border-color: rgba(31, 95, 35, 0.2);
}

.cookie-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cookie-switch__dot {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 20px;
  background: #d1d8d1;
  border-radius: 999px;
  transition: background-color 0.25s ease;
  margin-top: 2px;
}

.cookie-switch__dot::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cookie-switch input:checked ~ .cookie-switch__dot {
  background: #1f5f23;
}

.cookie-switch input:checked ~ .cookie-switch__dot::before {
  transform: translateX(16px);
}

.cookie-switch.is-required .cookie-switch__dot {
  background: #8bc34a;
  opacity: 0.7;
}

.cookie-switch.is-required {
  cursor: not-allowed;
}

.cookie-switch__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.cookie-switch__text strong {
  font-family: 'Inter', sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  color: #14231a;
}

.cookie-switch__text small {
  font-size: 0.74rem;
  line-height: 1.45;
  color: #6b7a6c;
}

/* ===== Mobile ===== */
@media (max-width: 600px) {
  .cookie-banner {
    bottom: 12px;
    width: calc(100% - 24px);
    border-radius: 14px;
  }
  .cookie-banner__inner { padding: 22px 22px; }
  .cookie-banner__title { font-size: 1.25rem; }
  .cookie-banner__actions { flex-direction: column; align-items: stretch; }
  .cookie-banner__btn { justify-content: center; }
  .cookie-banner__btn--link { margin-left: 0; padding: 8px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner { animation: none; }
}
