/* Fenêtre « avant de partir » (ecgiftcard 1.4.0) */
.ecgc-exit {
  --ecgc-x-forest: #21372a;
  --ecgc-x-deep: #14251b;
  --ecgc-x-bronze: #bd8743;
  --ecgc-x-bronze-light: #d3ab75;
  --ecgc-x-cream: #f5f2eb;
  --ecgc-x-ink: #1c1f1c;
  --ecgc-x-muted: #69716b;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ecgc-exit[hidden] {
  display: none !important;
}

.ecgc-exit__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 37, 27, 0.62);
  opacity: 0;
  transition: opacity 220ms ease;
}

.ecgc-exit__dialog {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  width: min(720px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  background: var(--ecgc-x-cream);
  color: var(--ecgc-x-ink);
  border-radius: 6px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transition: opacity 220ms ease, transform 220ms ease;
  outline: none;
}

.ecgc-exit.is-open .ecgc-exit__backdrop,
.ecgc-exit.is-open .ecgc-exit__dialog {
  opacity: 1;
}

.ecgc-exit.is-open .ecgc-exit__dialog {
  transform: none;
}

.ecgc-exit__visual {
  background: var(--ecgc-x-cream);
  border-right: 1px solid rgba(33, 55, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.4rem;
}

.ecgc-exit__visual img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.ecgc-exit__body {
  padding: 2.4rem 2.2rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ecgc-exit__kicker {
  margin: 0 0 0.7rem;
  color: var(--ecgc-x-bronze);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ecgc-exit__title {
  margin: 0 0 0.75rem;
  color: var(--ecgc-x-forest);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.5rem, 2.4vw, 1.8rem);
  font-weight: 400;
  line-height: 1.2;
  text-wrap: balance;
}

.ecgc-exit__text {
  margin: 0 0 1.5rem;
  color: #3e4640;
  font-size: 1rem;
  line-height: 1.6;
}

.ecgc-exit__button,
.ecgc-exit__button:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.8rem 1.4rem;
  background: var(--ecgc-x-bronze);
  color: #fff !important;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none !important;
  border-radius: 2px;
  transition: background-color 160ms ease;
}

.ecgc-exit__button:hover,
.ecgc-exit__button:focus {
  background: var(--ecgc-x-forest);
  color: #fff !important;
}

.ecgc-exit__later {
  align-self: center;
  margin-top: 0.9rem;
  padding: 0.4rem 0.6rem;
  border: 0;
  background: none;
  color: var(--ecgc-x-muted);
  font-size: 0.86rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.ecgc-exit__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(245, 242, 235, 0.92);
  color: var(--ecgc-x-forest);
  cursor: pointer;
}

.ecgc-exit__close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.ecgc-exit__close:focus-visible,
.ecgc-exit__later:focus-visible,
.ecgc-exit__button:focus-visible {
  outline: 2px solid var(--ecgc-x-bronze);
  outline-offset: 2px;
}

html.ecgc-exit-lock,
html.ecgc-exit-lock body {
  overflow: hidden;
}

@media (max-width: 640px) {
  .ecgc-exit {
    align-items: flex-end;
    padding: 0;
  }

  .ecgc-exit__dialog {
    grid-template-columns: 1fr;
    width: 100%;
    max-height: 92vh;
    border-radius: 10px 10px 0 0;
    transform: translateY(40px);
  }

  .ecgc-exit__visual {
    padding: 1.1rem 1rem 0.2rem;
    border-right: 0;
  }

  .ecgc-exit__visual img {
    width: auto;
    max-width: 100%;
    max-height: 26vh;
  }

  .ecgc-exit__body {
    padding: 1.1rem 1.4rem 1.3rem;
  }

  .ecgc-exit__kicker {
    margin-bottom: 0.45rem;
  }

  .ecgc-exit__title {
    font-size: 1.5rem;
    margin-bottom: 0.55rem;
  }

  .ecgc-exit__text {
    font-size: 0.98rem;
    line-height: 1.55;
    margin-bottom: 1.15rem;
  }

  .ecgc-exit__later {
    margin-top: 0.6rem;
  }

  .ecgc-exit__button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ecgc-exit__backdrop,
  .ecgc-exit__dialog {
    transition: none;
  }
}
