/* ==========================================================================
   consent.css — Hilston Park Cookie Consent UI
   Cookie banner, preference modal, floating FAB button
   Uses the same CSS custom properties as style.css (:root vars)
   ========================================================================== */

/* ── Floating cookie button (bottom-left) ─────────────────────────────────── */
#hp-cookie-fab {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 100000;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #3c7a6c;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
  transition: background 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease, bottom 0.35s ease;
  line-height: 1;
}
/* Cookie FAB is hidden while the banner itself is showing (redundant UI) */
#hp-cookie-banner.hpcc-show ~ #hp-cookie-fab,
body:has(#hp-cookie-banner.hpcc-show) #hp-cookie-fab {
  opacity: 0;
  pointer-events: none;
}
#hp-cookie-fab:hover {
  background: #2f6358;
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
}
#hp-cookie-fab:focus-visible {
  outline: 3px solid #3c7a6c;
  outline-offset: 3px;
}

/* ── Consent banner (bottom of viewport) ─────────────────────────────────── */
#hp-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100001;
  background: #fff;
  border-top: 3px solid #3c7a6c;
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.14);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
#hp-cookie-banner.hpcc-show {
  transform: translateY(0);
}

.hpcc-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.hpcc-text {
  flex: 1;
  min-width: 240px;
}
.hpcc-text strong {
  display: block;
  font-family: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #2a2a2a;
  margin-bottom: 4px;
}
.hpcc-text p {
  font-size: 0.82rem;
  line-height: 1.6;
  color: #5c5c5c;
  margin: 0;
}

.hpcc-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── Shared button styles ─────────────────────────────────────────────────── */
.hpcc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 20px;
  border: 2px solid transparent;
  border-radius: 3px;
  font-family: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
}
.hpcc-btn:focus-visible {
  outline: 3px solid #3c7a6c;
  outline-offset: 2px;
}

.hpcc-accept {
  background: #3c7a6c;
  color: #fff;
  border-color: #3c7a6c;
}
.hpcc-accept:hover {
  background: #2f6358;
  border-color: #2f6358;
}

.hpcc-decline {
  background: transparent;
  color: #4a6371;
  border-color: #cfcec9;
}
.hpcc-decline:hover {
  background: #e9e6df;
  border-color: #b0afa9;
}

.hpcc-manage {
  background: transparent;
  color: #3c7a6c;
  border-color: #3c7a6c;
}
.hpcc-manage:hover {
  background: #3c7a6c;
  color: #fff;
}

.hpcc-save {
  background: #4a6371;
  color: #fff;
  border-color: #4a6371;
}
.hpcc-save:hover {
  background: #36505d;
  border-color: #36505d;
}

/* ── Preference centre modal ──────────────────────────────────────────────── */
#hp-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 100002;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#hp-cookie-modal.hpcm-show {
  opacity: 1;
  pointer-events: auto;
}

.hpcm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(36, 50, 57, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.hpcm-panel {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 4px;
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 36px 36px 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#hp-cookie-modal.hpcm-show .hpcm-panel {
  transform: translateY(0) scale(1);
}

.hpcm-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #5c5c5c;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 3px;
  transition: color 0.18s ease, background 0.18s ease;
}
.hpcm-close:hover {
  color: #2a2a2a;
  background: #e9e6df;
}
.hpcm-close:focus-visible {
  outline: 3px solid #3c7a6c;
  outline-offset: 2px;
}

.hpcm-panel h2 {
  font-family: "Bodoni72", "Bodoni 72", Georgia, serif;
  font-weight: normal;
  font-size: 1.55rem;
  color: #2a2a2a;
  margin-bottom: 8px;
}
.hpcm-intro {
  font-size: 0.84rem;
  color: #5c5c5c;
  line-height: 1.65;
  margin-bottom: 24px;
}

/* Category rows */
.hpcm-cat {
  border-top: 1px solid #e9e6df;
  padding: 16px 0;
}
.hpcm-cat:last-of-type {
  border-bottom: 1px solid #e9e6df;
  margin-bottom: 20px;
}

.hpcm-cat-hd {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  justify-content: space-between;
}
.hpcm-cat-info {
  flex: 1;
}
.hpcm-cat-info strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: #2a2a2a;
  margin-bottom: 3px;
}
.hpcm-cat-info p {
  font-size: 0.8rem;
  color: #5c5c5c;
  line-height: 1.55;
  margin: 0;
}

.hpcm-always {
  font-size: 0.75rem;
  font-weight: 600;
  color: #3c7a6c;
  background: #e6f0ee;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
}

/* Toggle switch */
.hpcm-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  align-self: center;
  cursor: pointer;
}
.hpcm-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.hpcm-slider {
  position: absolute;
  inset: 0;
  background: #cfcec9;
  border-radius: 24px;
  transition: background 0.25s ease;
}
.hpcm-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.hpcm-toggle input:checked + .hpcm-slider {
  background: #3c7a6c;
}
.hpcm-toggle input:checked + .hpcm-slider::before {
  transform: translateX(20px);
}
.hpcm-toggle input:focus-visible + .hpcm-slider {
  outline: 3px solid #3c7a6c;
  outline-offset: 2px;
}

/* Modal footer actions */
.hpcm-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ── Footer link ──────────────────────────────────────────────────────────── */
.cookie-pref-link {
  cursor: pointer;
}
.cookie-pref-link:hover {
  text-decoration: underline;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hpcc-inner {
    padding: 16px 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .hpcc-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hpcc-actions .hpcc-btn {
    width: 100%;
    justify-content: center;
  }
  .hpcm-panel {
    padding: 28px 20px 20px;
    max-height: 95vh;
  }
  .hpcm-foot {
    flex-direction: column;
    align-items: stretch;
  }
  .hpcm-foot .hpcc-btn {
    width: 100%;
    justify-content: center;
  }
  #hp-cookie-fab {
    bottom: 16px;
    left: 16px;
  }
}
