/* ========== COOKIE CONSENT — quiet, complete public choice ========== */
.ph-cookie-banner {
  position: fixed;
  right: clamp(.75rem, 2vw, 1.5rem);
  bottom: clamp(.75rem, 2vw, 1.5rem);
  width: min(46rem, calc(100% - 1.5rem));
  padding: .72rem;
  border: 1px solid rgba(16, 38, 63, .13);
  border-radius: .8rem;
  background: rgba(255, 252, 246, .96);
  color: #1c1c19;
  box-shadow: 0 1.5rem 4rem rgba(16, 38, 63, .18);
  backdrop-filter: blur(18px);
  z-index: 10000;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, .75rem, 0) scale(.985);
  transition: opacity 220ms ease, transform 320ms cubic-bezier(.16, 1, .3, 1), visibility 0s linear 320ms;
  font-family: var(--hv-font, var(--hv-font-body));
  box-sizing: border-box;
}

.ph-cookie-banner.show {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
  transition-delay: 0s;
}

.ph-cookie-content {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(15rem, 1fr) auto;
  align-items: center;
  gap: .75rem;
}

.ph-cookie-text {
  display: block;
  min-width: 0;
}

.ph-cookie-title {
  display: none;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0 0 .35rem;
  color: #10263f;
}

.ph-cookie-description {
  font-size: .73rem;
  line-height: 1.38;
  margin: 0;
  color: #505f76;
}

.ph-cookie-link {
  color: #002046;
  font-weight: 600;
}

.ph-cookie-link:hover {
  color: #1b365d;
}

.ph-cookie-actions {
  display: flex;
  width: auto;
  min-width: 0;
  flex-wrap: nowrap;
  gap: .35rem;
}

.ph-cookie-banner .hv-action.hv-action--primary,
.ph-cookie-banner .hv-action.hv-action--secondary,
.ph-cookie-banner .hv-action.hv-action--ghost {
  min-height: 2.2rem;
  flex: 0 0 auto;
  padding: .55rem .72rem;
  border-radius: 999px;
  font-family: var(--hv-font, var(--hv-font-body));
  font-size: .62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 150ms, color 150ms;
  white-space: nowrap;
  border: none;
}

.ph-cookie-banner .hv-action.hv-action--primary {
  background: #002046;
  color: #ffffff;
}

.ph-cookie-banner .hv-action.hv-action--primary:hover {
  background: #1b365d;
}

.ph-cookie-banner .hv-action.hv-action--secondary {
  background: #f6f3ee;
  color: #1c1c19;
}

.ph-cookie-banner .hv-action.hv-action--secondary:hover {
  background: #f0ede9;
}

.ph-cookie-banner .hv-action.hv-action--ghost {
  background: transparent;
  color: #505f76;
}

.ph-cookie-banner .hv-action.hv-action--ghost:hover {
  background: #f6f3ee;
  color: #1c1c19;
}

.ph-cookie-banner .hv-action.hv-action--primary:focus-visible,
.ph-cookie-banner .hv-action.hv-action--secondary:focus-visible,
.ph-cookie-banner .hv-action.hv-action--ghost:focus-visible {
  outline: 2px solid #002046;
  outline-offset: 2px;
}

/* ── Modal ── */
.ph-cookie-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  font-family: var(--hv-font, var(--hv-font-body));
  isolation: isolate;
}

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

/* Privacy choices must remain visible even while the rest of the page pauses. */
.ph-cookie-modal.show .ph-modal-content {
  animation: none !important;
  opacity: 1;
  transform: none;
}

.ph-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  background: rgba(7, 25, 45, .78);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.ph-modal-content {
  position: relative;
  z-index: 1;
  background: #fcf9f4;
  max-width: 42rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid rgba(16, 38, 63, .12);
  border-radius: 1rem;
  box-shadow: 0 2rem 6rem rgba(7, 25, 45, .3);
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  animation: none;
  opacity: 1;
  transform: none;
}

@keyframes ph-cookie-modal-arrive {
  from { opacity: 0; transform: translate3d(0, .8rem, 0) scale(.985); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.ph-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background-image: linear-gradient(rgba(28,28,25,0.06), rgba(28,28,25,0.06));
  background-size: 100% 1px;
  background-position: bottom;
  background-repeat: no-repeat;
}

.ph-modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1c1c19;
  font-family: var(--hv-font, var(--hv-font-body));
}

.ph-modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: #505f76;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--hv-font, var(--hv-font-body));
}

.ph-modal-close:hover {
  background: #f6f3ee;
  color: #002046;
}

.ph-modal-close:focus-visible {
  outline: 2px solid #002046;
  outline-offset: 2px;
}

.ph-modal-body {
  padding: 1.5rem;
}

.ph-modal-intro {
  color: #505f76;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-size: 0.875rem;
}

.ph-cookie-category {
  background: #f6f3ee;
  padding: 1.25rem;
  margin-bottom: 2px;
}

.ph-category-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.ph-category-header h3 {
  margin: 0 0 0.25rem 0;
  font-size: 0.9375rem;
  color: #1c1c19;
  font-weight: 600;
}

.ph-category-header p {
  margin: 0;
  font-size: 0.8125rem;
  color: #505f76;
}

.ph-category-details {
  font-size: 0.8125rem;
  color: #505f76;
  line-height: 1.6;
  padding-top: 1rem;
  background-image: linear-gradient(rgba(28,28,25,0.06), rgba(28,28,25,0.06));
  background-size: 100% 1px;
  background-position: top;
  background-repeat: no-repeat;
}

.ph-category-details strong {
  color: #1c1c19;
}

/* ── Toggle Switch ── */
.ph-toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  flex-shrink: 0;
}

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

.ph-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ebe8e3;
  transition: background 250ms;
  border-radius: 26px;
}

.ph-toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: transform 250ms;
  border-radius: 50%;
}

.ph-toggle input:checked + .ph-toggle-slider {
  background-color: #1b7d3e;
}

.ph-toggle input:checked + .ph-toggle-slider:before {
  transform: translateX(24px);
}

.ph-toggle input:disabled + .ph-toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Modal Footer ── */
.ph-modal-footer {
  padding: 1.5rem;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  background-image: linear-gradient(rgba(28,28,25,0.06), rgba(28,28,25,0.06));
  background-size: 100% 1px;
  background-position: top;
  background-repeat: no-repeat;
}

.ph-modal-footer .hv-action.hv-action--primary {
  background: #002046;
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.5rem;
  font-family: var(--hv-font, var(--hv-font-body));
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 150ms;
}

.ph-modal-footer .hv-action.hv-action--primary:hover {
  background: #1b365d;
}

.ph-modal-footer .hv-action.hv-action--primary:focus-visible {
  outline: 2px solid #002046;
  outline-offset: 2px;
}

.ph-modal-footer .hv-action.hv-action--secondary {
  background: #f6f3ee;
  color: #1c1c19;
  border: none;
  padding: 0.75rem 1.5rem;
  font-family: var(--hv-font, var(--hv-font-body));
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 150ms;
}

.ph-modal-footer .hv-action.hv-action--secondary:hover {
  background: #f0ede9;
}

.ph-modal-footer .hv-action.hv-action--secondary:focus-visible {
  outline: 2px solid #002046;
  outline-offset: 2px;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .ph-cookie-banner {
    right: .5rem;
    bottom: .5rem;
    width: calc(100% - 1rem);
    padding: .42rem .5rem;
  }

  .ph-cookie-content {
    grid-template-columns: 1fr;
    gap: .3rem;
    min-width: 0;
  }

  .ph-cookie-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ph-cookie-actions button {
    width: 100%;
    min-width: 0;
  }

  .ph-cookie-actions .hv-action--ghost {
    grid-column: auto;
  }

  .ph-cookie-description {
    max-width: 100%;
    font-size: .64rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .ph-cookie-banner .hv-action.hv-action--primary,
  .ph-cookie-banner .hv-action.hv-action--secondary,
  .ph-cookie-banner .hv-action.hv-action--ghost {
    min-height: 1.8rem;
    padding: .3rem .25rem;
    font-size: .56rem;
  }

  .ph-modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .ph-modal-footer {
    flex-direction: column;
  }

  .ph-modal-footer button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ph-cookie-banner,
  .ph-modal-content {
    transition: none;
    animation: none;
  }
}
