/**
 * Storefront styles for the EU legal guarantee notice.
 *
 * Deliberately inherits the theme's font and colour for the trigger so it reads as
 * part of the shop, while the notice itself sits on a forced white panel: the
 * Commission's guidelines forbid colour substitution or filters on the notice, and a
 * dark-themed storefront would otherwise tint it.
 */

eu-guarantee-notice {
  display: inline-block;
}

/* Floating placement: present on every page with no theme editing, which is the point.
   Kept below the modal's z-index.

   It sits in a corner rather than centred, because centre-bottom is exactly where themes put the
   sticky Add to cart bar on mobile, and a compliance widget covering the buy button is the fastest
   way to earn a one-star review. The corner is a merchant setting, so a shop whose own bar is on
   the right can move it left.

   The offset adds the safe-area inset so the pill clears the home indicator on an iPhone rather
   than sitting under it. */
.eugn-embed--floating {
  position: fixed;
  bottom: calc(var(--eugn-offset, 20px) + env(safe-area-inset-bottom, 0px));
  z-index: 2147482000;
  background: #fff;
  color: #1a1a1a;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  line-height: 1.3;
  max-width: calc(100vw - 24px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.eugn-embed--floating.eugn-embed--right {
  right: max(var(--eugn-offset, 20px), env(safe-area-inset-right, 0px));
}

.eugn-embed--floating.eugn-embed--left {
  left: max(var(--eugn-offset, 20px), env(safe-area-inset-left, 0px));
}

.eugn-embed--floating.eugn-embed--centre {
  left: 50%;
  transform: translateX(-50%);
}

.eugn-embed--footer {
  display: block;
  padding: 12px 0;
  text-align: center;
  font-size: 14px;
}

.eugn__trigger {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.eugn__trigger:hover {
  opacity: 0.75;
}

.eugn__dialog {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4vmin;
}

.eugn__dialog.eugn--open {
  display: flex;
}

.eugn__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.eugn__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  /* white, not transparent: the notice must not pick up a dark theme's background */
  background: #fff;
  color: #1a1a1a;
  border-radius: 10px;
  padding: 20px;
  /* Explicit width, not max-width: this panel is a shrink-to-fit flex item, so a
     percentage-width child cannot resolve against it and the notice collapses. */
  width: min(620px, 92vw);
  max-height: 92vh;
  overflow: auto;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
}

.eugn__figure {
  width: 100%;
}

/* A4 proportions, sized to stay legible at default display size without distortion. */
.eugn__figure svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 82vh;
}

.eugn__figure[aria-busy='true'] {
  min-height: 240px;
}

.eugn__link {
  font-size: 14px;
  color: #0b4f9e;
  word-break: break-all;
  text-align: center;
}

.eugn__close {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 26px;
  line-height: 1;
  background: none;
  border: 0;
  cursor: pointer;
  color: #666;
  padding: 4px 8px;
}

.eugn__close:hover {
  color: #000;
}
