/* Elements cookie consent banner. Behaviour lives in assets/js/consent.js. */

.ecConsent {
  --ec-bg: #1c1c1c;
  --ec-line: #3a3a3a;
  --ec-text: #ebebee;
  --ec-muted: #b5b5b5;
  --ec-red: #ca1822;
  --ec-red-hov: #921118;

  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 10000;
  width: calc(100% - 40px);
  max-width: 460px;
  font-family: "Poppins", sans-serif;
  color: var(--ec-text);
  opacity: 0;
  transform: translateY(16px);
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

.ecConsent.ecVisible {
  opacity: 1;
  transform: none;
  visibility: visible;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.ecConsent.ecExpanded {
  max-width: 560px;
}

.ecConsent [hidden] {
  display: none !important;
}

.ecCard {
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 26px 26px 22px;
  background: var(--ec-bg);
  border-top: solid 4px var(--ec-red);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.ecConsent h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 700;
  color: #fff;
}

.ecConsent h2 i {
  color: var(--ec-red);
  font-size: 24px;
}

.ecConsent p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ec-text);
}

.ecConsent a {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Preference rows */

.ecPanel {
  margin-top: 18px;
  border-top: solid 1px var(--ec-line);
}

.ecRow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: solid 1px var(--ec-line);
}

.ecRowText label {
  display: block;
  margin-bottom: 3px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}

.ecRowText p {
  font-size: 13px;
  color: var(--ec-muted);
}

.ecSwitch {
  position: relative;
  flex: 0 0 46px;
  width: 46px;
  height: 26px;
  margin-top: 2px;
}

.ecSwitch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.ecSwitch input:disabled {
  cursor: not-allowed;
}

.ecSlider {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  background: #555;
  transition: background 0.2s ease;
}

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

.ecSwitch input:checked + .ecSlider {
  background: var(--ec-red);
}

.ecSwitch input:checked + .ecSlider::before {
  transform: translateX(20px);
}

.ecSwitch input:disabled + .ecSlider {
  opacity: 0.55;
}

.ecSwitch input:focus-visible + .ecSlider {
  outline: solid 2px #fff;
  outline-offset: 2px;
}

/* Buttons: accept and reject are deliberately the same size and weight. */

.ecActions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.ecBtn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  border-radius: 30px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ecBtn:focus-visible {
  outline: solid 2px #fff;
  outline-offset: 3px;
}

.ecPrimary,
.ecGhost {
  flex: 1 1 0;
  min-width: 130px;
  padding: 13px 20px;
}

.ecPrimary {
  background: var(--ec-red);
  border: solid 2px var(--ec-red);
  color: #fff;
}

.ecPrimary:hover {
  background: var(--ec-red-hov);
  border-color: var(--ec-red-hov);
}

.ecGhost {
  background: transparent;
  border: solid 2px #fff;
  color: #fff;
}

.ecGhost:hover {
  background: #fff;
  color: var(--ec-bg);
}

.ecLink {
  flex: 1 1 100%;
  order: 3;
  padding: 6px 0 0;
  background: none;
  border: none;
  color: var(--ec-muted);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ecLink:hover {
  color: #fff;
}

@media (max-width: 600px) {
  .ecConsent {
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
  }

  .ecConsent.ecExpanded {
    max-width: none;
  }

  .ecCard {
    max-height: 85vh;
    padding: 22px 16px 18px;
    border-radius: 14px 14px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ecConsent,
  .ecConsent.ecVisible,
  .ecSlider,
  .ecSlider::before {
    transition: none;
  }
}

/* Footer "Cookie settings" trigger, styled as a footer link. */
.cookieSettingsLink {
  display: inline;
  padding: 0;
  margin-top: 10px;
  background: none;
  border: none;
  font: inherit;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
