.promo-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgb(24 35 27 / 58%);
  backdrop-filter: blur(7px);
}

body.promo-open {
  overflow: hidden;
}

.promo-dialog {
  --promo-aspect: 3 / 4;
  position: relative;
  display: block;
  width: min(72vw, 620px, calc(76dvh * var(--promo-aspect)));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  aspect-ratio: var(--promo-aspect);
  overflow: hidden;
  border: 1px solid rgb(219 223 214 / 94%);
  border-radius: 20px;
  background: #f2f1ec;
  box-shadow: 0 28px 80px rgb(24 35 27 / 30%);
  transition: width 220ms ease;
}

.promo-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f2f1ec;
  border-radius: inherit;
  touch-action: pan-y;
}

.promo-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 320ms cubic-bezier(0.22, 0.75, 0.28, 1);
  will-change: transform;
}

.promo-slide {
  display: grid;
  min-width: 100%;
  height: 100%;
  place-items: center;
  padding: 0;
  box-sizing: border-box;
}

.promo-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: inherit;
}

.promo-close,
.promo-arrow {
  border: 1px solid rgb(255 255 255 / 68%);
  color: #fff;
  background: rgb(36 54 40 / 82%);
  box-shadow: 0 5px 18px rgb(24 35 27 / 20%);
  cursor: pointer;
}

.promo-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 2px solid rgb(232 190 104 / 95%);
  border-radius: 50%;
  font: 700 26px/1 Arial, sans-serif;
}

.promo-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  width: 40px;
  height: 48px;
  padding: 0;
  place-items: center;
  border-radius: 14px;
  font: 700 32px/1 Arial, sans-serif;
  transform: translateY(-50%);
}

.promo-arrow-previous {
  left: 12px;
}

.promo-next {
  right: 12px;
}

.promo-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgb(255 255 255 / 72%);
  border-radius: 999px;
  background: rgb(250 249 245 / 88%);
  box-shadow: 0 4px 16px rgb(24 35 27 / 16%);
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

.promo-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #bdc5ba;
  cursor: pointer;
  transition: width 180ms ease, background 180ms ease;
}

.promo-dot.active {
  width: 26px;
  border-radius: 999px;
  background: #314b38;
}

.promo-close:focus-visible,
.promo-arrow:focus-visible,
.promo-dot:focus-visible {
  outline: 3px solid #e2b85f;
  outline-offset: 3px;
}

.promotion-admin,
.promotion-switcher,
.reward-admin {
  grid-column: 1 / -1;
}

.promotion-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.promotion-toolbar,
.promotion-actions,
.promotion-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.promotion-toolbar {
  justify-content: space-between;
  margin-bottom: 18px;
}

.promotion-upload-field {
  display: block;
  padding: 16px;
  border: 1px dashed #aeb9ad;
  border-radius: 16px;
  background: #f8faf6;
}

.promotion-upload-field span {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.promotion-drafts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.promotion-draft,
.promotion-row {
  border: 1px solid #d9dfd6;
  border-radius: 16px;
  background: #fff;
}

.promotion-draft {
  overflow: hidden;
}

.promotion-draft img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #f2f1ec;
}

.promotion-draft small {
  display: block;
  overflow: hidden;
  padding: 9px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.promotion-admin-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.promotion-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px;
}

.promotion-row img {
  width: 116px;
  height: 82px;
  object-fit: contain;
  border-radius: 11px;
  background: #f2f1ec;
}

.promotion-row-info {
  min-width: 0;
}

.promotion-row-info strong,
.promotion-row-info small {
  display: block;
}

.promotion-row-info small {
  overflow: hidden;
  margin-top: 4px;
  color: #667066;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .promo-dialog {
    width: min(72vw, calc(72dvh * var(--promo-aspect)));
    max-width: calc(100vw - 28px);
    max-height: calc(100dvh - 28px);
    border-radius: 18px;
  }

  .promo-arrow {
    width: 36px;
    height: 44px;
  }

  .promo-arrow-previous {
    left: 8px;
  }

  .promo-next {
    right: 8px;
  }

  .promotion-row {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .promotion-row img {
    width: 88px;
    height: 70px;
  }

  .promotion-row-actions {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .promo-dialog,
  .promo-track,
  .promo-dot {
    transition: none;
  }
}
