/* ============================================
   New Page: the Sticker Shop without leaving your page (Oct 31, option C)
   Built by web/js/views/new-page/mobile-shop.js. Phone and iPad New Page.
   Sits above New Page and below the shared item card (1200), so a
   sticker's card opens on top of it.
   ============================================ */

/* The way in: storefront icon on the right of the Stickers panel header */
.np-mobile-store-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  color: var(--th-fg-9a9aa6);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.np-mobile-panel-tabbar.np-searching .np-mobile-store-btn {
  display: none !important;
}

/* New stickers, back on the page: a quick teal glow */
.np-sticker-tile.np-tile-new {
  animation: np-tile-new 1.6s ease;
}

@keyframes np-tile-new {
  0% { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.9); }
  40% { box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.75); }
  100% { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0); }
}

.np-shop-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.np-shop-scrim.on {
  opacity: 1;
}

.np-shop-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: calc(env(safe-area-inset-top, 0px) + 56px);
  max-width: 620px;
  margin: 0 auto;
  background: var(--th-bg-ffffff-up);
  color: var(--th-fg-18181b);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.25);
  z-index: 1101;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Poppins', sans-serif;
  transform: translateY(105%);
  transition: transform 0.34s cubic-bezier(0.32, 0.72, 0, 1);
}

.np-shop-sheet.on {
  transform: translateY(0);
}

.np-shop-top {
  flex: 0 0 auto;
}

.np-shop-grab {
  display: flex;
  justify-content: center;
  padding: 10px 0 6px;
}

.np-shop-grab i {
  width: 38px;
  height: 5px;
  border-radius: 3px;
  background: var(--th-line-e4e4ec);
}

.np-shop-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 14px 10px;
}

.np-shop-head h2 {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-shop-bal {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--th-bg-f1f1f5);
  color: var(--th-fg-18181b);
  font: 600 13px 'Poppins', sans-serif;
  white-space: nowrap;
}

.np-shop-bal img {
  width: 15px;
  height: 15px;
}

.np-shop-done {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  border: 0;
  background: #6D28D9;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.np-shop-done i {
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #14B8A6;
  color: #fff;
  font: 700 11px 'Poppins', sans-serif;
  font-style: normal;
  display: grid;
  place-items: center;
  padding: 0 4px;
  box-sizing: border-box;
  box-shadow: 0 0 0 2px var(--th-bg-ffffff-up);
}

.np-shop-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px 12px;
  border-bottom: 1px solid var(--th-line-e4e4ec);
}

.np-shop-mp {
  position: relative;
  flex: 0 0 auto;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--th-line-e4e4ec);
  pointer-events: none;
}

.np-shop-mp-page {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  overflow: hidden;
}

.np-shop-mini p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--th-fg-8b8b98);
}

.np-shop-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 12px calc(28px + env(safe-area-inset-bottom, 0px));
  scrollbar-width: none;
}

.np-shop-sheet--getting .np-shop-body {
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

.np-shop-body::-webkit-scrollbar {
  display: none;
}

/* Search stays at the top while the stickers scroll */
.np-shop-searchwrap {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 -12px;
  padding: 8px 12px 8px;
  background: var(--th-bg-ffffff-up);
}

.np-shop-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 10px 0 12px;
  border-radius: 12px;
  background: var(--th-bg-f1f1f5);
  color: var(--th-fg-8b8b98);
  border: 1.5px solid transparent;
}

.np-shop-search:focus-within {
  border-color: #6D28D9;
}

.np-shop-search svg {
  flex: 0 0 auto;
}

.np-shop-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--th-fg-18181b);
  font: 400 16px 'Poppins', sans-serif;
  outline: none;
  padding: 0;
}

.np-shop-search input::placeholder {
  color: var(--th-fg-8b8b98);
}

.np-shop-clear {
  border: 0;
  background: none;
  color: var(--th-fg-8b8b98);
  font-size: 14px;
  padding: 4px;
  cursor: pointer;
}

.np-shop-grid {
  display: grid;
  /* Oct 31: minmax(0, 1fr), so a big sticker picture can't widen a column
     (Safari showed 3.5 across and let the grid slide sideways) */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

@media (min-width: 600px) {
  .np-shop-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.np-shop-tile {
  position: relative;
  min-width: 0;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 6px;
  border: 0.5px solid var(--th-line-e4e4ec);
  background: transparent;
  padding: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.np-shop-tile--added {
  border: 2px solid #6D28D9;
  background: rgba(109, 40, 217, 0.12);
}

.np-shop-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.np-shop-tick {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #6D28D9;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.np-shop-price {
  position: absolute;
  left: 4px;
  bottom: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
  font: 600 10px 'Poppins', sans-serif;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  pointer-events: none;
}

.np-shop-price img {
  width: 11px !important;
  height: 11px !important;
}

.np-shop-price--free {
  background: #14B8A6;
}

.np-shop-price--yours {
  background: #52525b;
}

.np-shop-price--added {
  background: #6D28D9;
}

.np-shop-skel {
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--th-bg-f1f1f5);
}

.np-shop-sentinel {
  grid-column: 1 / -1;
  height: 1px;
}

.np-shop-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 36px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--th-fg-8b8b98);
}

/* Get Coins (B76, Austin's pick B): a card right above the Get bar, only
   when what's in your Basket costs more than you have */
.np-shop-short {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  border-radius: 14px;
  background: var(--th-bg-ffffff-up);
  color: var(--th-fg-18181b);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
  font: 500 13px 'Poppins', sans-serif;
}

.np-shop-getcoins {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #6D28D9;
  color: #fff;
  font: 600 13px 'Poppins', sans-serif;
  white-space: nowrap;
  cursor: pointer;
}

.np-shop-sheet--short .np-shop-body {
  padding-bottom: calc(156px + env(safe-area-inset-bottom, 0px));
}

/* Get 3 · 25 coins */
.np-shop-get {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 3;
  height: 52px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #6D28D9, #14B8A6);
  color: #fff;
  font: 600 15px 'Poppins', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.np-shop-get img {
  width: 16px;
  height: 16px;
}

.np-shop-get:disabled {
  opacity: 0.75;
  cursor: wait;
}
