/* Cookie consent — matches cookie-consent.js (.cookie-consent-banner) */

.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: none;
  padding: 16px max(16px, env(safe-area-inset-left, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-right, 0px));
  background: var(--g33-card, #fffef9);
  color: var(--g33-ink, #1a1a1a);
  border-top: 4px double var(--g33-ink, #1a1a1a);
  box-shadow: 0 -6px 24px rgba(26, 26, 26, 0.12);
  font-family: var(--g33-font, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
  font-size: 0.875rem;
  line-height: 1.55;
  animation: g33-cookie-slide-up 0.35s ease-out;
}

@keyframes g33-cookie-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

.cookie-consent-banner.show { display: block; }

.cookie-consent-content {
  max-width: var(--g33-max, 1100px);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}

.cookie-consent-text {
  flex: 1;
  min-width: min(100%, 280px);
}

.cookie-consent-text > div:first-child {
  font-family: var(--g33-serif, Georgia, 'Times New Roman', Times, serif);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--g33-ink, #1a1a1a);
  letter-spacing: -0.01em;
}

.cookie-consent-text p {
  margin: 0 0 6px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--g33-ink-on-light, #3d3832);
}

.cookie-consent-text p:last-child { margin-bottom: 0; }

.cookie-consent-text a {
  color: var(--g33-red, #c1121f);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-consent-text a:hover {
  color: var(--g33-ink, #1a1a1a);
}

.cookie-consent-buttons {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 8px;
}

.cookie-btn {
  padding: 10px 18px;
  border-radius: 0;
  font-family: var(--g33-font, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border: 2px solid var(--g33-ink, #1a1a1a);
  transition: background 0.15s ease, color 0.15s ease;
}

.cookie-btn-accept {
  background: var(--g33-red, #c1121f);
  color: var(--g33-card, #fffef9);
  border-color: var(--g33-ink, #1a1a1a);
}

.cookie-btn-accept:hover {
  background: var(--g33-ink, #1a1a1a);
  color: var(--g33-card, #fffef9);
}

.cookie-btn-reject,
.cookie-btn-settings {
  background: var(--g33-paper, #f2ede4);
  color: var(--g33-ink, #1a1a1a);
}

.cookie-btn-reject:hover,
.cookie-btn-settings:hover {
  background: var(--g33-paper-dark, #e6dfd3);
}

/* Settings modal */
.cookie-settings-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px));
  background: rgba(26, 26, 26, 0.72);
}

.cookie-settings-modal.show { display: flex; }

.cookie-settings-content {
  width: 100%;
  max-width: 520px;
  max-height: min(90vh, 640px);
  overflow-y: auto;
  padding: 22px 20px;
  background: var(--g33-card, #fffef9);
  color: var(--g33-ink, #1a1a1a);
  border: 2px solid var(--g33-ink, #1a1a1a);
  box-shadow: 0 12px 40px rgba(26, 26, 26, 0.2);
  animation: g33-cookie-modal-in 0.25s ease-out;
}

@keyframes g33-cookie-modal-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.cookie-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--g33-ink, #1a1a1a);
}

.cookie-settings-header > div {
  font-family: var(--g33-serif, Georgia, 'Times New Roman', Times, serif);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--g33-ink, #1a1a1a);
}

.cookie-settings-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid var(--g33-ink, #1a1a1a);
  background: var(--g33-paper, #f2ede4);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--g33-ink, #1a1a1a);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.cookie-settings-close:hover {
  background: var(--g33-ink, #1a1a1a);
  color: var(--g33-card, #fffef9);
}

.cookie-setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--g33-paper-dark, #e6dfd3);
}

.cookie-setting-item:last-child { border-bottom: none; }

.cookie-setting-info {
  flex: 1;
  min-width: 0;
}

.cookie-setting-info > div {
  margin-bottom: 4px;
  font-family: var(--g33-serif, Georgia, 'Times New Roman', Times, serif);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--g33-ink, #1a1a1a);
}

.cookie-setting-info p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--g33-ink-muted, #5c5348);
}

/* Toggle switch */
.cookie-toggle {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 26px;
}

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

.cookie-toggle-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  border-radius: 0;
  background: var(--g33-paper-dark, #e6dfd3);
  border: 2px solid var(--g33-ink-muted, #5c5348);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.cookie-toggle-slider::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  background: var(--g33-card, #fffef9);
  border: 1px solid var(--g33-ink-muted, #5c5348);
  transition: transform 0.2s ease, background 0.2s ease;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background: rgba(193, 18, 31, 0.15);
  border-color: var(--g33-red, #c1121f);
}

.cookie-toggle input:checked + .cookie-toggle-slider::before {
  transform: translate(20px, -50%);
  background: var(--g33-red, #c1121f);
  border-color: var(--g33-red, #c1121f);
}

.cookie-toggle.disabled { opacity: 0.55; cursor: not-allowed; }

.cookie-toggle.disabled .cookie-toggle-slider { cursor: not-allowed; }

.cookie-settings-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 2px solid var(--g33-ink, #1a1a1a);
}

.cookie-settings-footer .cookie-btn-accept {
  background: var(--g33-red, #c1121f);
  color: var(--g33-card, #fffef9);
}

@media (max-width: 767px) {
  .cookie-consent-banner {
    bottom: calc(var(--g33-mob-h, 52px) + env(safe-area-inset-bottom, 0px));
  }

  .cookie-consent-content {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-consent-buttons {
    width: 100%;
    flex-direction: column;
  }

  .cookie-consent-buttons .cookie-btn {
    width: 100%;
    text-align: center;
  }

  .cookie-setting-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-toggle { align-self: flex-end; }

  .cookie-settings-footer {
    flex-direction: column;
  }

  .cookie-settings-footer .cookie-btn {
    width: 100%;
    text-align: center;
  }
}
