.bag-link,
.purchase,
.shop-row,
.stepper,
.sum-line,
.pay-method {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bag-link b {
  border-radius: 20px;
  background: #f1edeb;
  padding: 1px 7px;
  font-size: 11px;
}
.purchase {
  margin: 15px 0 4px;
  flex-wrap: wrap;
}
.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
  border-radius: 28px;
  padding: 12px 22px;
  text-decoration: none;
  border: 1px solid var(--wine);
}
.primary {
  background: var(--wine);
  color: white;
}
.primary:hover {
  background: #46212c;
  color: white;
}
.secondary {
  color: var(--wine);
  background: #fff;
}
.bag-notice {
  font-size: 13px;
  color: var(--wine);
}
.bag-notice a,
.text-link,
.retry {
  text-decoration: underline;
}
.store {
  min-height: calc(100vh - 215px);
  padding: 30px 0 58px;
}
.backlink {
  display: inline-block;
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 13px;
}
.store h1 {
  font: 400 clamp(36px, 4vw, 56px) / 1.1 var(--serif);
  letter-spacing: -1.5px;
  margin: 6px 0 28px;
}
.store h2 {
  font: 400 27px/1.2 var(--serif);
  margin: 0 0 16px;
}
.shop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(275px, 1fr);
  gap: 32px;
  align-items: start;
}
.order-box,
.form-box {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}
.order-box {
  background: #faf7f4;
}
.order-box .primary,
.form-box .primary {
  width: 100%;
  margin-top: 14px;
}
.shop-row {
  padding: 18px 0;
  border-top: 1px solid var(--line);
  gap: 16px;
}
.shop-row img {
  width: 70px;
  height: 86px;
  border-radius: 7px;
  object-fit: cover;
}
.shop-row .info {
  flex: 1;
}
.shop-row h3 {
  font: 20px/1.15 var(--serif);
  margin: 0 0 6px;
}
.shop-row p,
.shop-hint,
.bag-notice {
  color: var(--muted);
  font-size: 13px;
}
.stepper {
  border: 1px solid var(--line);
  border-radius: 20px;
  gap: 5px;
}
.stepper button {
  width: 26px;
  height: 30px;
}
.remove {
  font-size: 12px;
  text-decoration: underline;
}
.sum-line {
  justify-content: space-between;
  margin: 11px 0;
  gap: 18px;
}
.sum-line strong {
  white-space: nowrap;
}
.sum-total {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: 18px;
}
.form-box {
  margin-bottom: 16px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}
.form-grid label {
  display: grid;
  gap: 5px;
  font-size: 13px;
}
.form-grid input,
.form-grid select {
  border: 1px solid #cfc7c4;
  padding: 10px;
  border-radius: 7px;
  min-width: 0;
  background: #fff;
}
.full {
  grid-column: 1/-1;
}
.pay-method {
  padding: 9px 0;
}
.pay-method:has(:disabled) {
  color: var(--muted);
}
.shop-error {
  color: #862537;
  font-weight: 600;
}
.status-panel {
  background: #faf7f4;
  border-radius: 14px;
  padding: 30px;
  max-width: 720px;
}
.status-panel p {
  margin-bottom: 20px;
}
.primary:disabled {
  background: #85797e;
  border-color: #85797e;
  cursor: not-allowed;
}
.order-box small {
  display: block;
  color: var(--muted);
}
.order-box .sum-line small {
  color: inherit;
}
.form-box h2:not(:first-child) {
  margin-top: 23px;
}
.order-box a.secondary {
  width: 100%;
}
@media (max-width: 760px) {
  .shop-layout {
    grid-template-columns: 1fr;
    gap: 17px;
  }
  .shop-row {
    gap: 9px;
    flex-wrap: wrap;
  }
  .order-box,
  .form-box {
    padding: 18px;
  }
  .shop-row .info {
    min-width: 45%;
  }
  .store {
    padding-top: 16px;
  }
  .backlink {
    margin-bottom: 22px;
  }
}
@media (max-width: 420px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .shop-row img {
    width: 50px;
    height: 70px;
  }
  .head-actions {
    gap: 6px;
  }
}

/* Let controls wrap instead of pushing the bag off a narrow screen. */
@media (max-width: 360px) {
  .head:has(.head-actions) {
    flex-wrap: wrap;
    height: auto;
    min-height: 61px;
    padding-block: 6px;
    gap: 2px 6px;
  }
  .head-actions {
    margin-left: auto;
  }
  .head-actions button, .head-actions .bag-link {
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
  }
}
