/* Opt-in signature basket and usual stores. Outfit, existing Aisle tokens. */

.badge-preview-open {
  display: block;
  width: 100%;
  margin: 4px 0 0;
  padding: 10px 2px;
  border: none;
  background: transparent;
  color: var(--aisle-produce);
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: var(--aisle-btn-size, 16px);
  font-weight: var(--aisle-btn-weight, 600);
  text-align: left;
  cursor: pointer;
}

.badge-preview-note {
  background: var(--aisle-sage);
  border-radius: 16px;
  padding: 14px 16px;
  margin: 8px 0 12px;
}

.badge-preview-title {
  margin: 0;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--aisle-ink);
}

.badge-preview-copy {
  margin: 4px 0 0;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  color: #5F5A54;
}

.badge-toggle-card,
.badge-card {
  background: #fff;
  border: 1px solid #E6DED0;
  border-radius: 20px;
  padding: 6px 16px;
}

.badge-card {
  padding: 18px;
  box-shadow: 0 8px 24px rgba(28, 25, 23, 0.04);
}

.badge-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.badge-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  border-bottom: 1px solid #E8E0D2;
}

.badge-toggle-row:last-child {
  border-bottom: none;
}

.badge-toggle-label {
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--aisle-ink);
}

.badge-switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex: 0 0 48px;
  border: none;
  border-radius: 999px;
  padding: 0;
  background: #E6DED0;
  cursor: pointer;
}

.badge-switch.is-on {
  background: var(--aisle-produce);
}

.badge-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.badge-switch.is-on .badge-switch-knob {
  transform: translateX(20px);
}

.badge-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.badge-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rt-muted, #5F5A54);
}

.badge-bag,
.badge-house {
  color: var(--aisle-muted);
  flex: 0 0 auto;
}

.badge-house {
  color: var(--aisle-produce);
}

.badge-item {
  display: grid;
  grid-template-columns: 22px 150px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  margin-top: 12px;
}

.badge-rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--aisle-cream);
  color: var(--aisle-produce);
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.badge-item-name {
  width: 150px;
  max-width: 150px;
  overflow: hidden;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: var(--aisle-sub-size, 16px);
  font-weight: var(--aisle-sub-weight, 600);
  line-height: 1.2;
  color: var(--aisle-ink);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.badge-bar {
  width: 100%;
  min-width: 0;
  height: 8px;
  border-radius: 999px;
  background: #E7F2EA;
  overflow: hidden;
}

.badge-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--aisle-produce);
}

.badge-foot,
.badge-empty {
  margin: 12px 0 0;
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: var(--rt-muted, #5F5A54);
}

.badge-stores {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.badge-store {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #E8E0D2;
  background: #fff;
  color: var(--aisle-ink);
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 14px;
  font-weight: 600;
}

.badge-store.is-home {
  background: var(--aisle-sage);
  border: 1.5px solid var(--aisle-produce);
}

.badge-home-label {
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--aisle-produce);
}

.discover-profile-screen[data-badge-stores="1"] .discover-stores {
  display: none;
}

/* First-scan badge share sheet. Success band is the scan-success screen. */
.badge-prompt {
  position: fixed;
  z-index: 220;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100%;
  max-width: 480px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  background: #958F88;
  color: var(--aisle-ink, #1C1917);
  font-family: Outfit, "Pretendard", "Noto Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
}

.badge-prompt-success {
  flex: 0 0 auto;
  background: #958F88;
  text-align: center;
  padding: 48px 28px 20px;
  cursor: pointer;
}

.badge-prompt-check {
  display: inline-flex;
  margin-bottom: 12px;
}

.badge-prompt-check svg {
  width: 56px;
  height: 56px;
}

.badge-prompt-added {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--aisle-ink, #1C1917);
}

.badge-prompt-meta {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: #413C38;
}

.badge-prompt-sheet {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  background: var(--aisle-cream, #F7F1E6);
  border-radius: 28px 28px 0 0;
  padding: 0 16px 0;
  container-type: scroll-state;
}

/* Pinned only when the sheet overflows. In normal flow it keeps its place. */
.badge-prompt-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  background: var(--aisle-cream, #F7F1E6);
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  container-type: scroll-state;
}

.badge-prompt-actions::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 16px;
  background: linear-gradient(to top, var(--aisle-cream, #F7F1E6), rgba(247, 241, 230, 0));
  pointer-events: none;
  opacity: 1;
}

@supports (container-type: scroll-state) {
  .badge-prompt-actions::before {
    opacity: 0;
  }
}

@container scroll-state(stuck: bottom) {
  .badge-prompt-actions::before {
    opacity: 1;
  }
}

.badge-prompt-grabber {
  width: 100%;
  padding: 10px 0 8px;
  display: flex;
  justify-content: center;
  touch-action: none;
  cursor: grab;
}

.badge-prompt-grabber::before {
  content: '';
  width: 36px;
  height: 4px;
  border-radius: 4px;
  background: rgba(28, 25, 23, 0.22);
}

.badge-prompt-title {
  margin: 4px 0 8px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--aisle-ink, #1C1917);
}

.badge-prompt-body {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.35;
  color: #5F5A54;
}

.badge-prompt-cards .badge-card {
  padding: 12px 14px;
}

.badge-prompt-cards .badge-item {
  margin-top: 8px;
}

.badge-prompt-cards .badge-stores {
  margin-top: 8px;
}

.badge-prompt-cards {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* While the preview can scroll, drop the cards under the pinned block.
   At rest they stay above it so their shadow still falls on the switch. */
@container scroll-state(scrollable: top) {
  .badge-prompt-cards {
    z-index: 0;
  }
}

@container scroll-state(scrollable: bottom) {
  .badge-prompt-cards {
    z-index: 0;
  }
}

.badge-prompt-cards.is-dim {
  opacity: 0.4;
}

.badge-prompt-switch {
  margin-top: 12px;
}

.badge-prompt-switch .badge-toggle-label {
  font-size: 16px;
  font-weight: 700;
}

.badge-prompt-keep {
  display: block;
  width: 100%;
  height: 52px;
  margin: 12px 0 0;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: #C9362A;
  box-shadow: none;
  color: #fff;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}

.badge-prompt-skip {
  display: block;
  width: 100%;
  margin: 2px 0 0;
  padding: 8px 8px 2px;
  border: none;
  background: transparent;
  color: var(--aisle-ink, #1C1917);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.badge-prompt-foot {
  margin: 2px 0 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  color: #5F5A54;
}
