/* Checkout offers — a centered popup with the offered books: one per slide,
   stacked (--stack), or two to a row on wide screens (--grid).
   Also loaded in the admin, where .sella-offers--preview shows one slide in place. */
.sella-offers {
  --sella-offers-accent: #746fed;
  --sella-offers-accent-dark: #5f5ae0;
  --sella-offers-ink: #171717;
  --sella-offers-muted: #5f6368;
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  font-family: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sella-offers[hidden],
.sella-offers [hidden] {
  display: none !important;
}

.sella-offers.is-open {
  opacity: 1;
}

html.sella-offers-lock {
  overflow: hidden;
}

.sella-offers__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.55);
}

.sella-offers__dialog {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 30px 28px 22px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
  color: var(--sella-offers-ink);
  text-align: start;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.3s ease;
}

.sella-offers.is-open .sella-offers__dialog {
  transform: none;
}

.sella-offers__dialog:focus {
  outline: none;
}

/* Extra specificity beats the Hello/Elementor button reset throughout. */
.sella-offers .sella-offers__close {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-end: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #8a8a8a;
  background: transparent;
  box-shadow: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.sella-offers .sella-offers__close:hover,
.sella-offers .sella-offers__close:focus-visible {
  color: var(--sella-offers-ink);
  background: #f2f2f5;
}

/* The countdown: a band across the top of the dialog, under the close button. */
.sella-offers .sella-offers__timer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: -30px -28px 20px;
  padding: 13px 56px;
  border-radius: 20px 20px 0 0;
  color: var(--sella-offers-accent-dark);
  background: #f0effd;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

.sella-offers__timer-clock {
  min-width: 5ch;
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.sella-offers .sella-offers__timer.is-over {
  color: #d7263d;
  background: #fdecee;
}

/* Over a list of offers; a slide has its own headline instead. */
.sella-offers .sella-offers__title {
  margin: 0 0 18px;
  padding-inline-end: 36px;
  color: var(--sella-offers-ink);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
}

/* Only the offers scroll; the timer, the title and the way out stay in view.
   The side padding leaves room for the covers' shadow. */
.sella-offers__cards {
  min-height: 0;
  margin: 0 -10px;
  padding: 0 10px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sella-offers.is-open .sella-offers__slide.is-swapping {
  animation: sella-offers-swap 0.3s ease;
}

@keyframes sella-offers-swap {
  from {
    opacity: 0.2;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.sella-offers .sella-offers__headline {
  margin: 0 0 18px;
  padding-inline-end: 36px;
  color: var(--sella-offers-accent);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.sella-offers__body {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

/* No fixed ratio and no object-fit — the cover shows whole, at its own proportions. */
.sella-offers .sella-offers__cover {
  flex: 0 0 auto;
  width: 120px;
  max-width: none;
  height: auto;
  border-radius: 7px;
  box-shadow: rgb(0 0 0 / 16%) 0 18px 24px -18px, rgb(0 0 0 / 8%) 0 2px 10px 0;
}

.sella-offers__info {
  flex: 1 1 auto;
  min-width: 0;
}

.sella-offers .sella-offers__name {
  margin: 0 0 8px;
  color: var(--sella-offers-ink);
  font-family: inherit;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.sella-offers .sella-offers__text {
  margin: 0 0 14px;
  color: var(--sella-offers-muted);
  font-size: 16px;
  line-height: 1.5;
  white-space: pre-line;
}

.sella-offers .sella-offers__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 0;
}

.sella-offers__price-now {
  color: var(--sella-offers-ink);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}

.sella-offers .sella-offers__price-was {
  color: #9a9a9a;
  font-size: 17px;
  text-decoration: line-through;
}

.sella-offers .sella-offers__add {
  display: block;
  width: 100%;
  margin: 24px 0 0;
  padding: 15px 24px;
  border: 0;
  border-radius: 50px;
  color: #fff;
  background: var(--sella-offers-accent);
  box-shadow: none;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  cursor: pointer;
  transition: background-color 0.25s ease, opacity 0.25s ease;
}

.sella-offers .sella-offers__add:hover:not(:disabled),
.sella-offers .sella-offers__add:focus-visible {
  color: #fff;
  background: var(--sella-offers-accent-dark);
}

.sella-offers .sella-offers__add:disabled {
  opacity: 0.8;
  cursor: default;
}

.sella-offers .sella-offers__add.is-added,
.sella-offers .sella-offers__add.is-added:disabled {
  color: #fff;
  background: #2d8a5a;
  opacity: 1;
}

.sella-offers .sella-offers__add.is-error,
.sella-offers .sella-offers__add.is-error:disabled {
  color: #d7263d;
  background: #fdecee;
  opacity: 1;
  font-size: 15px;
}

.sella-offers .sella-offers__dismiss {
  display: block;
  width: 100%;
  margin: 8px 0 0;
  padding: 10px;
  border: 0;
  border-radius: 50px;
  color: var(--sella-offers-muted);
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: 14px;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
}

.sella-offers .sella-offers__dismiss:hover,
.sella-offers .sella-offers__dismiss:focus-visible {
  color: var(--sella-offers-ink);
  background: transparent;
  text-decoration: underline;
}

.sella-offers__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid #f0f0f3;
}

.sella-offers .sella-offers__arrow {
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 1px solid #e4e4ea;
  border-radius: 50%;
  color: #555;
  background: #fff;
  box-shadow: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.sella-offers .sella-offers__arrow:hover,
.sella-offers .sella-offers__arrow:focus-visible {
  border-color: var(--sella-offers-accent);
  color: #fff;
  background: var(--sella-offers-accent);
}

.sella-offers__dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sella-offers .sella-offers__dot {
  width: 8px;
  height: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #d9d9e3;
  box-shadow: none;
  cursor: pointer;
  transition: width 0.25s ease, background-color 0.25s ease;
}

.sella-offers .sella-offers__dot:hover,
.sella-offers .sella-offers__dot:focus-visible {
  background: #b9b7f4;
}

.sella-offers .sella-offers__dot.is-active {
  width: 22px;
  background: var(--sella-offers-accent);
}

/* All the offers at once: stacked, or in a grid. */
.sella-offers--stack .sella-offers__slide + .sella-offers__slide {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f3;
}

/* Stacked, the countdown heads each offer instead of the dialog. */
.sella-offers .sella-offers__timer--card {
  margin: 0 0 14px;
  padding: 10px 16px;
  border-radius: 12px;
}

.sella-offers--stack .sella-offers__headline,
.sella-offers--grid .sella-offers__headline {
  margin-bottom: 12px;
  padding-inline-end: 0;
}

.sella-offers--stack .sella-offers__add,
.sella-offers--grid .sella-offers__add {
  margin-top: 16px;
  padding: 13px 20px;
  font-size: 16px;
}

.sella-offers--stack .sella-offers__dismiss,
.sella-offers--grid .sella-offers__dismiss {
  margin-top: 14px;
}

.sella-offers--grid .sella-offers__dialog {
  width: min(900px, 100%);
}

/* A lone offer left in the grid does not need the wide dialog. */
.sella-offers--grid .sella-offers__dialog:has(.sella-offers__slide:only-child) {
  width: min(520px, 100%);
}

.sella-offers--grid .sella-offers__cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.sella-offers--grid .sella-offers__slide {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid #ececf2;
  border-radius: 14px;
}

.sella-offers--grid .sella-offers__slide:only-child {
  grid-column: 1 / -1;
}

/* The buttons line up across a row, however long each text is. */
.sella-offers--grid .sella-offers__body {
  flex: 1 1 auto;
}

.sella-offers--grid .sella-offers__cover {
  width: 100px;
}

@media (max-width: 720px) {
  .sella-offers--grid .sella-offers__cards {
    grid-template-columns: 1fr;
  }
}

/* Admin preview: one slide in place, no overlay. */
.sella-offers.sella-offers--preview {
  position: relative;
  inset: auto;
  z-index: auto;
  display: block;
  padding: 0;
  opacity: 1;
}

.sella-offers--preview .sella-offers__dialog {
  width: 100%;
  max-height: none;
  overflow: visible;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14);
}

.sella-offers--preview .sella-offers__close,
.sella-offers--preview .sella-offers__add,
.sella-offers--preview .sella-offers__dismiss {
  cursor: default;
}

@media (max-width: 480px) {
  .sella-offers__dialog {
    padding: 26px 18px 16px;
    border-radius: 18px;
  }

  /* The band only: a card's countdown sits inside the scrolling list, where
     the band's negative margin pulled it up under the list's edge. */
  .sella-offers .sella-offers__timer:not(.sella-offers__timer--card) {
    margin: -26px -18px 16px;
    padding: 12px 48px;
    border-radius: 18px 18px 0 0;
  }

  .sella-offers .sella-offers__timer {
    font-size: 14px;
  }

  .sella-offers .sella-offers__timer-clock {
    font-size: 17px;
  }

  .sella-offers .sella-offers__title {
    font-size: 18px;
  }

  .sella-offers--grid .sella-offers__slide {
    padding: 14px;
  }

  .sella-offers__body {
    gap: 14px;
  }

  .sella-offers .sella-offers__cover {
    width: 92px;
  }

  .sella-offers .sella-offers__name {
    font-size: 19px;
  }

  .sella-offers .sella-offers__text {
    font-size: 15px;
  }

  .sella-offers__price-now {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sella-offers,
  .sella-offers__dialog {
    transition: opacity 0.2s ease;
    transform: none;
  }

  .sella-offers.is-open .sella-offers__slide.is-swapping {
    animation: none;
  }
}
