#samaria-storefront-promotions {
  --promo-shadow: 0 12px 36px rgb(25 14 8 / 19%), 0 3px 10px rgb(25 14 8 / 10%);
  --promo-edge: clamp(.75rem, 2vw, 1.5rem);
  --promo-bottom: max(var(--promo-edge), calc(env(safe-area-inset-bottom, 0px) + .5rem));
  --promo-right: max(var(--promo-edge), calc(env(safe-area-inset-right, 0px) + .5rem));
  color: var(--samaria-ink);
  font-size: .95rem;
  line-height: 1.5;
}

html[data-samaria-theme="dark"] #samaria-storefront-promotions {
  --promo-shadow: 0 12px 36px rgb(0 0 0 / 43%), 0 3px 10px rgb(0 0 0 / 24%);
}

#samaria-storefront-promotions *,
#samaria-storefront-promotions *::before,
#samaria-storefront-promotions *::after { box-sizing: border-box; }

#samaria-storefront-promotions :is(.samaria-promo-dialog:not([open]), .samaria-promo-offer[hidden]) {
  display: none;
}

#samaria-storefront-promotions :is(.samaria-promo-dialog, .samaria-promo-offer) {
  inset: auto;
  width: min(23rem, calc(100% - var(--promo-right) - var(--promo-edge)));
  max-width: none;
  max-height: 52vh;
  max-height: 52dvh;
  margin: 0;
  padding: 0;
  border: 1px solid var(--samaria-line);
  border-radius: 15px;
  background: var(--samaria-surface);
  color: var(--samaria-ink);
  box-shadow: var(--promo-shadow);
  overflow: auto;
  overscroll-behavior: contain;
}

#samaria-storefront-promotions .samaria-promo-dialog form:has(> .samaria-promo-close) {
  display: contents;
}

#samaria-storefront-promotions .samaria-promo-media {
  margin: 0;
  background: var(--samaria-paper);
  border-bottom: 1px solid var(--samaria-line);
}

#samaria-storefront-promotions img.samaria-promo-media,
#samaria-storefront-promotions .samaria-promo-media img {
  display: block;
  width: 100%;
  height: auto;
}

#samaria-storefront-promotions .samaria-promo-content {
  min-width: 0;
  padding: .9rem 1rem 1rem;
  overflow-wrap: anywhere;
}

#samaria-storefront-promotions :is(.samaria-promo-offer, .samaria-promo-dialog:not(:has(.samaria-promo-media))) h2 {
  padding-inline-end: 2.5rem;
}

#samaria-storefront-promotions .samaria-promo-content h2 {
  margin: 0 0 .55rem;
  color: var(--samaria-ink);
  font-family: var(--samaria-serif);
  font-weight: 400;
  font-size: clamp(1.45rem, 4.2vw, 1.85rem);
  line-height: 1.13;
  letter-spacing: -.025em;
  text-transform: none;
}

#samaria-storefront-promotions .samaria-promo-content p {
  margin: 0 0 .55rem;
  color: var(--samaria-muted);
  line-height: 1.55;
}

#samaria-storefront-promotions .samaria-promo-content > :last-child { margin-bottom: 0; }

#samaria-storefront-promotions .samaria-promo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  margin-top: .8rem;
}

#samaria-storefront-promotions :is(.samaria-promo-link, .samaria-promo-secondary, .samaria-promo-close, .samaria-promo-reviews) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 44px;
  padding: .55rem .9rem;
  border: 1px solid var(--samaria-line);
  border-radius: 11px;
  background: var(--samaria-surface);
  color: var(--samaria-ink);
  box-shadow: none;
  text-shadow: none;
  font: inherit;
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  cursor: pointer;
}

#samaria-storefront-promotions :is(.samaria-promo-link, .samaria-promo-secondary, .samaria-promo-close, .samaria-promo-reviews):focus-visible {
  outline: 2px solid var(--samaria-copper);
  outline-offset: 2px;
}

#samaria-storefront-promotions :is(.samaria-promo-secondary, .samaria-promo-close, .samaria-promo-reviews):hover {
  border-color: var(--samaria-copper);
  color: var(--samaria-copper);
}

#samaria-storefront-promotions .samaria-promo-link {
  border-color: transparent;
  background: var(--samaria-action, #8c4829);
  color: #fff;
}

#samaria-storefront-promotions .samaria-promo-link:hover {
  background: var(--samaria-action-hover, #70391f);
  color: #fff;
}

#samaria-storefront-promotions .samaria-promo-close {
  position: absolute;
  z-index: 1;
  inset-block-start: .6rem;
  inset-inline-end: .6rem;
  width: 44px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
}

#samaria-storefront-promotions :is(.samaria-promo-dialog, .samaria-promo-offer, .samaria-promo-reviews) {
  position: fixed;
  z-index: 1020;
  inset-block-end: var(--promo-bottom);
  inset-inline-end: var(--promo-right);
}

#samaria-storefront-promotions .samaria-promo-offer {
  border-top: 3px solid var(--samaria-copper);
}

#samaria-storefront-promotions .samaria-promo-terms {
  display: grid;
  gap: .3rem;
  margin: .8rem 0 0;
  padding: .7rem .85rem .7rem 1.95rem;
  border-radius: 10px;
  background: var(--samaria-paper);
  color: var(--samaria-ink);
  font-size: .875rem;
  list-style: disc;
}

#samaria-storefront-promotions .samaria-promo-terms li { margin: 0; }
#samaria-storefront-promotions .samaria-promo-terms li::marker { color: var(--samaria-copper); }

#samaria-storefront-promotions .samaria-promo-reviews {
  padding-inline: .75rem 1rem;
  border-radius: 99px;
  box-shadow: 0 4px 18px rgb(25 14 8 / 15%);
}

#samaria-storefront-promotions .samaria-promo-review-icon {
  display: inline-grid;
  flex: 0 0 1.6rem;
  min-height: 1.6rem;
  place-items: center;
  border-radius: 50%;
  background: var(--samaria-paper);
  color: var(--samaria-copper);
  font-size: .95rem;
  line-height: 1;
}

#samaria-storefront-promotions:has(.samaria-promo-dialog[open], .samaria-promo-offer:not([hidden])) .samaria-promo-reviews,
body.xoo-wsc-cart-active #samaria-storefront-promotions :is(.samaria-promo-reviews, .samaria-promo-offer, .samaria-promo-dialog) {
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 32rem) {
  #samaria-storefront-promotions :is(.samaria-promo-dialog, .samaria-promo-offer) {
    width: calc(100% - var(--promo-right) - var(--promo-edge));
  }

  #samaria-storefront-promotions .samaria-promo-dialog .samaria-promo-actions > * {
    flex: 1 1 8rem;
  }
}
