/* ── Cookie consent banner & settings modal ─────────────────────────────── */

@keyframes ckFadeIn   { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ckFadeOut  { from { opacity: 1; transform: translateY(0); }    to { opacity: 0; transform: translateY(10px); } }
@keyframes ckSlideUp  { from { transform: translateY(100%); }             to { transform: translateY(0); } }
@keyframes ckSlideOut { from { transform: translateY(0); }                to { transform: translateY(100%); } }
@keyframes ckOverIn   { from { opacity: 0; } to { opacity: 1; } }

/* ── Banner (bottom-right card on desktop, bottom sheet on mobile) ────────── */

.cookie-banner {
  position: fixed;
  z-index: 8900;
  background: #fff;
  box-shadow: 0 8px 48px rgba(41, 37, 35, 0.18);
}

.cookie-banner.is-leaving {
  animation: ckFadeOut 0.25s ease forwards;
}

@media (min-width: 641px) {
  .cookie-banner {
    bottom: 24px;
    right: 24px;
    width: min(420px, calc(100vw - 48px));
    border-radius: 16px;
    padding: 28px 28px 22px;
    animation: ckFadeIn 0.35s ease;
  }
}

@media (max-width: 640px) {
  .cookie-banner {
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 20px 20px 0 0;
    padding: 24px 20px max(28px, env(safe-area-inset-bottom, 0px));
    animation: ckSlideUp 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  }
  .cookie-banner.is-leaving {
    animation: ckSlideOut 0.28s ease forwards;
  }
}

.cookie-banner-title {
  margin: 0 0 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5a1018;
}

.cookie-banner-text {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: #6f6660;
  line-height: 1.65;
}

.cookie-banner-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 14px;
}

@media (min-width: 641px) {
  .cookie-banner-actions {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
  }
}

.cookie-banner-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid rgba(90, 16, 24, 0.08);
}

.cookie-banner-links a {
  font-size: 0.76rem;
  color: #6f6660;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.18s;
}
.cookie-banner-links a:hover { color: #5a1018; }

/* ── Shared button styles ─────────────────────────────────────────────────── */

.cookie-btn {
  display: block;
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.87rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: center;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, opacity 0.18s;
  line-height: 1;
}

@media (min-width: 641px) {
  .cookie-btn {
    display: inline-block;
    width: auto;
    padding: 10px 18px;
  }
}

.cookie-btn-primary {
  background: #5a1018;
  color: #fff;
}
.cookie-btn-primary:hover { background: #3d0a10; }

.cookie-btn-secondary {
  background: transparent;
  color: #5a1018;
  border: 1.5px solid rgba(90, 16, 24, 0.35);
}
.cookie-btn-secondary:hover { border-color: #5a1018; background: rgba(90, 16, 24, 0.04); }

.cookie-btn-ghost {
  background: transparent;
  color: #6f6660;
  font-weight: 600;
}
.cookie-btn-ghost:hover { color: #5a1018; }

/* ── Settings modal overlay ───────────────────────────────────────────────── */

.cookie-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(41, 37, 35, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: ckOverIn 0.22s ease;
}

@media (min-width: 641px) {
  .cookie-overlay {
    align-items: center;
    padding: 24px;
  }
}

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

.cookie-modal {
  background: #fff;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 20px 20px 0 0;
  padding: 28px 22px max(28px, env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 48px rgba(41, 37, 35, 0.16);
  animation: ckSlideUp 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}

@media (min-width: 641px) {
  .cookie-modal {
    max-width: 480px;
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 12px 64px rgba(41, 37, 35, 0.22);
    animation: ckFadeIn 0.28s ease;
  }
}

.cookie-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.cookie-modal-header h2 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #5a1018;
}

.cookie-modal-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: rgba(90, 16, 24, 0.06);
  color: #6f6660;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  flex-shrink: 0;
}
.cookie-modal-close:hover { background: rgba(90, 16, 24, 0.12); color: #5a1018; }

/* ── Cookie options ───────────────────────────────────────────────────────── */

.cookie-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(90, 16, 24, 0.09);
}
.cookie-option:last-child { border-bottom: none; }

.cookie-option-info { flex: 1 1 auto; }

.cookie-option-info strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #292523;
  margin-bottom: 5px;
}

.cookie-option-info p {
  margin: 0;
  font-size: 0.82rem;
  color: #6f6660;
  line-height: 1.55;
}

.cookie-always-on {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5a1018;
  white-space: nowrap;
}

/* ── Toggle switch ────────────────────────────────────────────────────────── */

.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}

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

.cookie-toggle-track {
  position: absolute;
  inset: 0;
  background: rgba(90, 16, 24, 0.18);
  border-radius: 999px;
  transition: background 0.22s;
}

.cookie-toggle input:checked ~ .cookie-toggle-track { background: #5a1018; }

.cookie-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.22);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cookie-toggle input:checked ~ .cookie-toggle-thumb { transform: translateX(20px); }

.cookie-toggle:focus-within .cookie-toggle-track {
  outline: 2px solid #5a1018;
  outline-offset: 2px;
}

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

.cookie-modal-footer {
  margin-top: 24px;
}

.cookie-modal-footer .cookie-btn {
  display: block;
  width: 100%;
  padding: 14px;
  font-size: 0.9rem;
}
