.shop-page {
  position: fixed;
  inset: 0;
  z-index: 760;
  display: none;
  flex-direction: column;
  background: #f5f5f5;
  color: #222;
  font-family: inherit;
}
.shop-page.active { display: flex; }
.shop-nav {
  height: calc(52px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 14px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-bottom: 1px solid #ededed;
  flex-shrink: 0;
}
.shop-nav-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
}
.shop-icon-btn {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #222;
  padding: 0;
}
.shop-icon-btn svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.shop-icon-btn[hidden] { visibility: hidden; display: flex; }
.shop-icon-btn.spinning svg { animation: shopRefreshSpin 0.7s linear infinite; }
@keyframes shopRefreshSpin { to { transform: rotate(360deg); } }
.shop-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px calc(70px + env(safe-area-inset-bottom));
}
.shop-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 761;
  height: calc(58px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border-top: 1px solid #e9e9e9;
}
.shop-page.detail-mode .shop-bottom-nav { display: none; }
.shop-page.detail-mode .shop-body { padding-bottom: 14px; }
.shop-bottom-item {
  border: 0;
  background: transparent;
  color: #777;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}
.shop-bottom-item.active { color: #ff5000; }
.shop-subtabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 10px;
}
.shop-subtab {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #444;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}
.shop-subtab.active {
  background: #ff5000;
  color: #fff;
}
.shop-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.shop-product-card,
.shop-cart-item,
.shop-order-card,
.shop-fav-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #eee;
}
.shop-product-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #f0f0f0;
}
.shop-product-info { padding: 8px; }
.shop-product-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  min-height: 36px;
}
.shop-product-price {
  margin-top: 7px;
  color: #ff5000;
  font-size: 17px;
  font-weight: 800;
}
.shop-empty {
  padding: 38px 18px;
  text-align: center;
  color: #999;
  font-size: 13px;
}
.shop-loading {
  padding: 28px 12px;
  text-align: center;
  color: #777;
}
.shop-detail-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: #eee;
}
.shop-detail-panel {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
}
.shop-detail-title { font-size: 18px; font-weight: 800; line-height: 1.35; }
.shop-detail-merchant {
  margin-top: 6px;
  font-size: 13px;
  color: #555;
  font-weight: 700;
}
.shop-detail-price { color: #ff5000; font-size: 24px; font-weight: 900; margin: 8px 0; }
.shop-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.shop-tag {
  padding: 4px 7px;
  border-radius: 5px;
  background: #f6f6f6;
  color: #666;
  font-size: 12px;
}
.shop-review {
  padding: 9px 0;
  border-top: 1px solid #eee;
  font-size: 13px;
  line-height: 1.45;
}
.shop-review-score {
  color: #ff9f00;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
}
.shop-action-bar {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 8px;
  padding: 10px 0 0;
  background: #f5f5f5;
}
.shop-primary-btn,
.shop-secondary-btn {
  min-height: 40px;
  border-radius: 8px;
  border: 0;
  font: inherit;
  font-weight: 800;
}
.shop-primary-btn { background: #ff5000; color: #fff; }
.shop-secondary-btn { background: #fff; color: #333; border: 1px solid #e5e5e5; }
.shop-orange-btn { background: linear-gradient(90deg, #ff7a00, #ff3d00); }
.shop-home-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  position: sticky;
  top: -10px;
  z-index: 2;
  background: #f5f5f5;
  padding-bottom: 10px;
}
.shop-home-tabs button {
  flex: 1;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-weight: 800;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
}
.shop-home-tabs button em {
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #f1f1f1;
  color: #777;
  font-style: normal;
  font-size: 12px;
  line-height: 20px;
}
.shop-home-tabs button.active { color: #ff5000; }
.shop-home-tabs button.active em {
  background: #fff0e8;
  color: #ff5000;
}
.shop-home-list { min-height: 120px; }
.shop-order-card,
.shop-fav-card,
.shop-cart-item { padding: 10px; margin-bottom: 10px; }
.shop-history-card {
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.shop-history-card:active {
  transform: scale(0.985);
  border-color: #ffd2bd;
}
.shop-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.shop-row-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  background: #eee;
  flex-shrink: 0;
}
.shop-row-main { flex: 1; min-width: 0; }
.shop-row-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}
.shop-row-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #888;
}
.shop-row-price {
  margin-top: 6px;
  color: #ff5000;
  font-weight: 900;
}
.shop-cart-toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  gap: 8px;
  align-items: center;
  background: #f5f5f5;
  padding-bottom: 10px;
}
.shop-cart-toolbar button { flex: 1; }
.shop-check {
  width: 20px;
  height: 20px;
  accent-color: #ff5000;
}
.shop-load-wrap { text-align: center; padding: 10px 0 4px; }
.shop-history-btn {
  width: 100%;
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
  background: #fff;
  color: #333;
  font: inherit;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.shop-history-btn em {
  color: #999;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}
.shop-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 790;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.38);
  padding: 18px;
}
.shop-modal-overlay.active { display: flex; }
.shop-modal-overlay.keyboard-safe-modal {
  align-items: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.shop-modal {
  width: min(340px, 100%);
  max-height: 80vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  color: #222;
}
.shop-modal-overlay.keyboard-safe-modal .shop-modal {
  max-height: calc(var(--app-visual-viewport-height, 100vh) - 36px);
  margin-top: var(--app-visual-viewport-offset-top, 0px);
}
.shop-modal-title { font-size: 17px; font-weight: 900; margin-bottom: 12px; }
.shop-input {
  width: 100%;
  box-sizing: border-box;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0 10px;
  font: inherit;
  margin-bottom: 10px;
}
.shop-recipient-btn {
  width: 100%;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  color: #333;
  font: inherit;
  font-weight: 800;
  margin-bottom: 10px;
  padding: 0 10px;
  text-align: left;
}
.shop-recipient-btn[disabled] {
  background: #f5f5f5;
  color: #aaa;
}
.shop-price-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shop-modal-actions { display: flex; gap: 8px; margin-top: 6px; }
.shop-modal-actions button { flex: 1; }
.shop-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}
.shop-segment button {
  height: 36px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  background: #fff;
  font: inherit;
  font-weight: 800;
}
.shop-segment button.active {
  border-color: #ff5000;
  color: #ff5000;
}
.shop-conv-item {
  width: 100%;
  border: 1px solid #eee;
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  text-align: left;
  font: inherit;
}
.shop-conv-name { font-weight: 800; }
.shop-conv-last { color: #888; font-size: 12px; margin-top: 3px; }
.shop-delivery-placeholder {
  background: #fff;
  border-radius: 8px;
  padding: 34px 12px;
  text-align: center;
  color: #999;
}
.shop-delivery-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.shop-delivery-menu {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.shop-delivery-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
}
.shop-delivery-img {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  object-fit: cover;
  background: #f0f0f0;
  flex-shrink: 0;
}
.shop-delivery-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.shop-delivery-name {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.32;
  color: #222;
}
.shop-delivery-sales {
  margin-top: 4px;
  color: #888;
  font-size: 12px;
  line-height: 1.35;
}
.shop-delivery-merchant-line {
  margin-top: 5px;
  color: #555;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}
.shop-delivery-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.shop-delivery-tags span {
  padding: 2px 5px;
  border-radius: 4px;
  background: #fff7e3;
  color: #a15c00;
  font-size: 11px;
  font-weight: 700;
}
.shop-delivery-review {
  margin-top: 6px;
  color: #777;
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.shop-delivery-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
}
.shop-delivery-price {
  color: #ff5000;
  font-size: 18px;
  font-weight: 900;
}
.shop-delivery-add {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #ffd429;
  color: #332400;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}
