/* Shop list, product, and checkout. Shared chrome stays in style.css. */

.shop-page .btn,
.shop-page button.btn { min-height: 44px; }
.shop-page input,
.shop-page select,
.shop-page textarea { font-size: 16px; min-height: 44px; }

body.shop-page.shop-list.has-cart main,
body.shop-page.shop-detail main {
  padding-bottom: calc(108px + env(safe-area-inset-bottom));
}
@media (min-width: 900px) {
  body.shop-page.shop-list.has-cart main,
  body.shop-page.shop-detail main { padding-bottom: 120px; }
}

.shop-count {
  margin: 2px 2px 12px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}

.chip-scroller { position: relative; margin: 0 0 4px; }
.shop-page .chips { padding-bottom: 6px; scroll-snap-type: x mandatory; }
.shop-page .chip { min-height: 44px; scroll-snap-align: start; }
.chip-scroller.can-prev::before,
.chip-scroller.can-next::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 6px;
  width: 28px;
  pointer-events: none;
  z-index: 1;
}
.chip-scroller.can-prev::before {
  left: 0;
  background: linear-gradient(90deg, var(--pink-50), rgba(252, 238, 241, 0));
}
.chip-scroller.can-next::after {
  right: 0;
  background: linear-gradient(270deg, var(--pink-50), rgba(252, 238, 241, 0));
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 800px) {
  .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
}

button.shop-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-radius: 16px;
}
button.shop-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
button.shop-card:active { transform: translateY(0); }

.shop-card .pic {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 42%, #fff 0%, var(--pink-50) 78%);
}
.shop-card .pic img,
.detail-pic img {
  position: absolute;
  top: 10px;
  left: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  object-fit: contain;
  object-position: center;
}
.ph-mark {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--pink-deep);
  font-size: 28px;
  font-weight: 800;
  box-shadow: var(--shadow);
}
.stock-flag {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff;
  color: var(--price);
  font-size: 12px;
  font-weight: 800;
  box-shadow: var(--shadow);
}
.stock-flag.out { color: var(--ink-2); }

.shop-card .meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  padding: 10px 12px 12px;
}
.shop-card .name {
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.35;
  min-height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.price-row {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}
.shop-card .price,
.detail-price .price,
.detail-buy .price { color: var(--price); font-weight: 800; font-size: 16px; }
.price-row s,
.detail-price s {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 16px 0 4px;
}
.pager-btn {
  min-height: 44px;
  min-width: 88px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.pager-btn[disabled] { opacity: .4; cursor: not-allowed; }
.pager-now {
  min-width: 72px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.cart-bar,
.detail-buy {
  position: fixed;
  z-index: 30;
  left: 16px;
  right: 16px;
  width: auto;
  max-width: calc(var(--max) - 32px);
  margin-inline: auto;
  bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(80, 30, 48, .12);
}
@media (min-width: 900px) {
  .cart-bar,
  .detail-buy { bottom: 16px; }
}
.cart-meta { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; }
.cart-n {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--pink);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.cart-meta span:last-child { white-space: nowrap; }
.cart-bar .btn,
.detail-buy .btn { flex: none; padding-inline: 18px; }
.detail-buy .btn.ghost { flex: none; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin: 0 0 8px;
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--pink-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.product-detail { padding: 0; overflow: hidden; }
.detail-pic {
  position: relative;
  aspect-ratio: 1;
  width: min(100%, 420px);
  margin-inline: auto;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, #fff 0%, var(--pink-50) 80%);
}
.detail-body { padding: 16px 16px 18px; }
.detail-body h2 { font-size: 22px; line-height: 1.35; }
.detail-price {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}
.detail-price .price { font-size: 26px; }
.detail-desc {
  margin-top: 16px;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.qty-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0 4px; }
.qty-line > span { font-weight: 700; }
.qty {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}
.qty button {
  width: 44px;
  height: 44px;
  border: 0;
  background: var(--pink-50);
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
}
.qty input {
  width: 52px;
  min-height: 44px;
  border: 0;
  background: #fff;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  padding: 0;
}

.empty-shop { text-align: center; padding: 28px 16px; color: var(--ink-2); }

.checkout h2 { margin-bottom: 8px; }
.ck-lines { list-style: none; margin: 0 0 12px; padding: 0; }
.ck-lines li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14.5px;
}
.ck-lines li span:last-child { flex: none; font-weight: 700; color: var(--ink-2); }
.ck-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 4px 0 8px;
}
.ck-total b { color: var(--price); font-size: 22px; }
.ck-break { color: var(--ink-2); font-size: 13px; margin-bottom: 8px; }
.checkout .f { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; font-weight: 700; font-size: 14px; }
.checkout .checkline { display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; }
.checkout .btn.block { margin-top: 8px; }
.checkout [data-msg] { min-height: 1.2em; color: var(--err, #c44848); font-weight: 700; }

body.shop-page.has-cart .toast,
body.shop-page.shop-detail .toast {
  bottom: calc(var(--tabbar-h) + 86px + env(safe-area-inset-bottom));
}
@media (min-width: 900px) {
body.shop-page.has-cart .toast,
body.shop-page.shop-detail .toast { bottom: 92px; }
}

.deal-seg { margin-bottom: 12px; }
.deal-count { color: var(--price); font-size: 13px; font-weight: 700; margin: 4px 0; }
.deal-sub { color: var(--ink-2); font-size: 13px; font-weight: 700; }
.deal-sub s { margin-left: 4px; color: var(--ink-3, #9a8c90); font-weight: 600; }
.deal-page .shop-card .deal-count, .deal-page .shop-card .deal-sub { display: block; padding: 0 12px 8px; }
.deal-page .shop-card .name { padding: 10px 12px 0; }
.deal-list { margin: 6px 0 12px; padding-left: 18px; }
.deal-list li { margin: 4px 0; }
.team-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.team-row small { display: block; color: var(--price); font-weight: 700; }
.deal-order { margin-bottom: 10px; text-align: left; }
button.deal-order { width: 100%; font: inherit; color: inherit; cursor: pointer; }
.qr-box { display: grid; justify-items: center; gap: 6px; margin: 12px 0; padding: 12px; background: #fff; border-radius: 16px; }
.qr-box img { width: 180px; height: 180px; }
.qr-box b { letter-spacing: 0.12em; }
.deal-page .chips { margin: 0 0 12px; }
