/**
 * 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: var(--eugn-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 16px;
  text-align: center;
}

.eugn-embed--footer,
.eugn-embed--inline,
.eugn-embed--placed {
  font-size: var(--eugn-size, 14px);
  color: var(--eugn-color, inherit);
}

.eugn-embed--placed {
  display: block;
  margin: 12px 0;
}

eu-guarantee-notice[display='card'],
eu-guarantee-notice[display='image'] {
  display: block;
}

.eugn-embed--footer .eugn-card,
.eugn-embed--footer .eugn-image {
  max-width: 560px;
  margin: 0 auto;
  text-align: left;
}

/* Collapsed card: the market's expected look, one click from the full notice. */
.eugn-card {
  border: 1px solid rgba(127, 127, 127, 0.35);
  border-radius: 8px;
}

.eugn-card__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.eugn-card__summary::-webkit-details-marker {
  display: none;
}

.eugn-card__summary::after {
  content: '';
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s;
}

.eugn-card[open] > .eugn-card__summary::after {
  transform: rotate(-135deg);
}

.eugn-card__body,
.eugn-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.eugn-card__body {
  padding: 0 14px 14px;
}

/* White, never the theme's background: the notice may not be tinted. */
.eugn-card .eugn__figure,
.eugn-image .eugn__figure {
  width: 100%;
  max-width: var(--eugn-width, 460px);
  background: #fff;
}

.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(960px, 96vw);
  max-height: 92vh;
  overflow: auto;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
}

.eugn__figure {
  width: 100%;
}

/* Dawn and its siblings ship `div:empty { display: none }`. The notice renders in a shadow root, so
   the figure's light DOM is empty and those themes hid the notice, leaving only the link, from
   2026-08-21 until this rule. Two classes outrank `div:empty`. */
.eugn__dialog .eugn__figure,
.eugn-card .eugn__figure,
.eugn-image .eugn__figure {
  display: block;
}

/* The notice itself is sized inside the shadow root it renders in, because a page stylesheet
   cannot reach in. See FIGURE_CSS in guarantee-notice.src.js. */

.eugn__figure--zoom {
  cursor: zoom-in;
}

.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;
}
