/* Overlay */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mh-cookie-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9998;
}

.mh-cookie-overlay--visible {
  display: block;
}

/* Banner */
.mh-cookie-consent[hidden] {
  display: none;
}

.mh-cookie-consent {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  left: 1.5rem;
  z-index: 9999;
  width: min(340px, calc(100vw - 3rem));
  margin-left: auto;
  background: var(--mh-bg, #1c2f40);
  color: var(--mh-text, #ffffff);
  font-family: inherit;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.mh-cookie-consent__inner {
  width: 100%;
}

/* Manage panel */
.mh-cookie-consent__panel {
  display: none;
  max-height: 300px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.5rem;
  gap: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.mh-cookie-consent__panel--open {
  display: grid;
}

.mh-cookie-consent__panel[hidden] {
  display: none;
}

.mh-cookie-consent__section {
  display: grid;
  gap: 0.5rem;
}

.mh-cookie-consent__heading {
  font-weight: 600;
  font-size: 0.9375rem;
}

.mh-cookie-consent__text {
  font-size: 0.875rem;
  line-height: 1.6;
  opacity: 0.8;
}

/* Bottom bar */
.mh-cookie-consent__bar {
  padding: 1.25rem 1.5rem;
}

.mh-cookie-consent__message {
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0 0 1rem;
  opacity: 0.85;
}

.mh-cookie-consent__privacy-policy {
  margin: 0 0 1rem;
}

.mh-cookie-consent__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.mh-cookie-consent__button {
  background: none;
  border: none;
  color: #fff;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0.9;
  transition: opacity 0.15s;
}

.mh-cookie-consent__button:hover {
  opacity: 1;
}

/* The privacy policy link reuses .mh-cookie-consent__button, but it is an
   <a>, so theme anchor rules (e.g. `a:link`) can override its font and
   underline. The banner id gives this rule enough specificity to win, so the
   link renders exactly like the buttons. */
#mh-cookie-consent a.mh-cookie-consent__privacy-policy-link {
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
}

.mh-cookie-consent__button:focus-visible,
.mh-toggle__input:focus-visible + .mh-toggle__fill,
.mh-cookie-consent__panel-actions .mh-cookie-consent__button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28);
  border-radius: 999px;
}

.mh-cookie-consent__panel-actions {
  display: flex;
  justify-content: flex-start;
}

/* Toggle */
.mh-cookie-consent__toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

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

.mh-toggle__input {
  opacity: 0;
  width: 0;
  height: 0;
}

.mh-toggle__fill {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #555;
  border-radius: 999px;
  transition: 0.2s;
}

.mh-toggle__fill::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.mh-toggle__input:checked + .mh-toggle__fill {
  background: var(--mh-toggle, #4ade80);
}

.mh-toggle__input:checked + .mh-toggle__fill::before {
  transform: translateX(20px);
}

.mh-cookie-consent a {
  color: inherit;
  text-decoration: underline;
}

@media (max-width: 600px) {
  .mh-cookie-consent {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    width: auto;
  }

  .mh-cookie-consent__buttons {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.875rem;
  }

  .mh-cookie-consent__toggle-wrapper {
    align-items: flex-start;
  }
}
