/* Public shop listing, detail, order, pay.
   The storefront runs on the same measure, rules and type scale as the rest of
   the site — a small shop inside the agency, not a bolted-on mall. */
.shop-wrap {
  max-width: none;
}

/* content.css is not loaded on shop/pay — the back link needs its own rule. */
.page-shop .content-back,
.page-pay .content-back {
  margin: 0 0 var(--space-4);
}

.page-shop .content-back a,
.page-pay .content-back a {
  font-size: var(--fs-sm);
  font-weight: 700;
  text-decoration: none;
  color: var(--color-muted);
}

.page-shop .content-back a:hover,
.page-pay .content-back a:hover {
  color: var(--color-primary);
}

.shop-page-head {
  margin: 0 0 var(--gap-head);
  max-width: var(--measure-lead);
}

.shop-page-head .page-title {
  margin-bottom: var(--space-3);
}

.shop-page-head .section-lead {
  margin: 0;
}

.shop-count {
  margin: 0 0 var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-rule);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}

/* Two columns even on the smallest phone — three products should read as a
   shelf, not as three full-screen banners. */
.shop-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6) var(--space-4);
}

@media (min-width: 768px) {
  .shop-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-7) var(--space-5);
  }
}

.shop-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

/* Product photos are 4:3 studio shots on their own pale backgrounds. A 4:3 box
   with contain keeps every cup whole; the hairline frame gives the three
   different backdrops one shared edge. */
.shop-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--color-rule);
  background: var(--color-soft);
  overflow: hidden;
}

.shop-card a:hover .shop-card-media,
.shop-card a:focus-visible .shop-card-media {
  border-color: var(--color-rule-strong);
}

.shop-card-media img,
.shop-detail-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.shop-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 8rem;
  color: #8a93a0;
  font-size: var(--fs-sm);
}

.shop-soldout-badge {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0.3rem 0.6rem;
  background: var(--color-primary-dark, #123556);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.shop-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  padding: var(--space-3) 0 0;
}

.shop-card-title {
  margin: 0 0 var(--space-2);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.015em;
  word-break: keep-all;
  color: var(--color-text);
}

.shop-card-price {
  margin: auto 0 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-primary-dark, #1b4a78);
}

.shop-card-more {
  display: inline-block;
  margin-top: var(--space-2);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--color-primary, #1b4a78);
}

.shop-card.is-soldout .shop-card-media img {
  opacity: 0.55;
}

.shop-card.is-soldout .shop-card-price {
  color: var(--color-muted);
}

/* ---- Detail ---------------------------------------------------------------
   Name, price and the order button all land in the first viewport; the long
   copy is pushed below a full-width rule so it can never crowd them. */
.shop-detail {
  display: grid;
  gap: var(--space-5);
  margin-bottom: var(--gap-section-sm);
}

@media (min-width: 768px) {
  .shop-detail {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: start;
    gap: var(--space-7);
  }
}

.shop-detail-media {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--color-rule);
  background: var(--color-soft);
  overflow: hidden;
}

.shop-detail-badge {
  margin: 0 0 var(--space-3);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-accent-dark, #c56a18);
}

.shop-detail-title {
  margin: 0 0 var(--space-4);
  font-size: var(--fs-3xl);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.03em;
  word-break: keep-all;
  color: var(--color-primary-dark, #1b4a78);
}

.shop-detail-price {
  margin: 0;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-rule);
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-primary-dark, #1b4a78);
}

.shop-detail-stock {
  display: flex;
  align-items: center;
  margin: var(--space-4) 0 0;
  font-size: var(--fs-md);
}

.shop-stock-ok,
.shop-stock-soldout {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}

.shop-stock-ok::before,
.shop-stock-soldout::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

.shop-stock-ok {
  color: var(--color-success, #1f7a4c);
}

.shop-stock-soldout {
  color: #b42318;
}

.shop-detail-agency-note {
  margin: var(--space-4) 0 var(--space-5);
  padding: 0 0 0 var(--space-4);
  border-left: 3px solid var(--color-accent);
  color: var(--color-muted);
  font-size: var(--fs-sm);
  line-height: 1.7;
  word-break: keep-all;
}

.shop-buy-slot {
  margin-top: 0;
}

.shop-buy-slot .btn[disabled] {
  background: var(--color-soft);
  border-color: var(--color-rule-strong);
  color: var(--color-muted);
  cursor: not-allowed;
}

/* Long-form blocks: 상품정보 / 배송안내 / 교환·반품·환불 */
.shop-section {
  margin-top: var(--gap-section-sm);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-rule);
}

.shop-section h2 {
  margin: 0 0 var(--space-4);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-primary-dark, #1b4a78);
}

/* .content-body lives in content.css, which the shop pages do not load — the
   prose here needs its own measure and rhythm or it runs the full 1200px. */
.shop-section .content-body {
  max-width: var(--measure-prose);
  line-height: var(--lh-body);
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.shop-section .content-body img {
  margin: var(--space-4) 0;
}

.shop-policy-links {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--color-rule);
  list-style: none;
  font-size: var(--fs-md);
}

.shop-policy-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-rule);
  color: var(--color-primary-dark, #1b4a78);
  font-weight: 700;
  text-decoration: none;
}

.shop-policy-links a::after {
  content: "→";
  color: var(--color-accent-dark);
  font-weight: 700;
}

.shop-policy-links a:hover,
.shop-policy-links a:focus-visible {
  color: var(--color-accent-dark);
}

@media (min-width: 768px) {
  .shop-policy-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-6);
  }
}

/* ---- Checkout order form (scoped: .shop-checkout / .shop-co-*) ---- */
.page-shop-order .shop-checkout {
  width: min(100% - 2rem, var(--container-wide, 1200px));
  max-width: none;
}

.shop-co-pagehead {
  margin: 0 0 var(--gap-head);
  max-width: var(--measure-lead);
}

.shop-co-title {
  margin: 0 0 var(--space-3);
  font-size: var(--fs-3xl);
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: -0.03em;
  color: var(--color-primary-dark, #123556);
}

.shop-co-desc {
  margin: 0;
  color: var(--color-muted, #5a6b7d);
  font-size: var(--fs-md);
  line-height: 1.65;
  word-break: keep-all;
}

.shop-co-alert {
  margin: 0 0 1.5rem;
}

.shop-co-layout {
  display: grid;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 960px) {
  .shop-co-layout {
    grid-template-columns: minmax(0, 1.95fr) minmax(19rem, 1fr);
    column-gap: 3rem;
  }

  .shop-co-aside {
    position: sticky;
    top: calc(var(--header-h, 4rem) + 0.75rem);
  }
}

.shop-co-section {
  margin: 0;
  padding: 0 0 var(--space-6);
  border-bottom: 1px solid var(--color-rule, #e4e9ee);
}

.shop-co-section + .shop-co-section {
  padding-top: var(--space-6);
}

.shop-co-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.shop-co-section-head {
  margin: 0 0 var(--space-5);
}

.shop-co-section-title {
  margin: 0 0 0.35rem;
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-primary-dark, #123556);
}

.shop-co-section-desc {
  margin: 0;
  color: var(--color-muted, #5a6b7d);
  font-size: var(--fs-sm);
  line-height: 1.6;
  word-break: keep-all;
}

.shop-co-grid {
  display: grid;
  gap: var(--gap-field);
}

@media (min-width: 720px) {
  .shop-co-grid--2 {
    grid-template-columns: 1fr 1fr;
    gap: var(--gap-field) var(--space-5);
  }
}

.shop-co-address {
  display: grid;
  gap: var(--gap-field);
  margin-top: var(--gap-field);
}

/* A field following a paired row must keep the same field-to-field gap; without
   this the 2-up grid butts straight into the next label. */
.shop-co-grid + .shop-co-field,
.shop-co-grid + .shop-co-grid {
  margin-top: var(--gap-field);
}

.shop-co-field {
  display: flex;
  flex-direction: column;
  gap: var(--gap-label);
  min-width: 0;
}

.shop-co-field--postal {
  max-width: 12rem;
}

/* Badge sits next to the label it qualifies. Pushed to the far edge it reads as
   an unrelated tag floating in the row. */
.shop-co-labelrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.35rem;
}

.shop-co-labelrow label {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-primary-dark, #123556);
}

.shop-co-badge {
  flex: 0 0 auto;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.shop-co-badge--req {
  color: #b42318;
  background: rgba(180, 35, 24, 0.08);
}

.shop-co-badge--opt {
  color: #667788;
  background: rgba(90, 107, 125, 0.1);
}

.shop-co-control {
  display: block;
  width: 100%;
  min-width: 0;
  height: 3.125rem;
  margin: 0;
  padding: 0 0.9rem;
  border: 1px solid var(--color-border, #d5dee8);
  border-radius: var(--radius-sm, 4px);
  background: #fff;
  color: var(--color-text, #1a2b3c);
  font: inherit;
  font-size: 1rem;
  line-height: 1.4;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.shop-co-control--area {
  height: auto;
  min-height: 7rem;
  padding: 0.85rem 0.9rem;
  line-height: 1.65;
  resize: vertical;
}

.shop-co-control--qty {
  max-width: 8.5rem;
}

.shop-co-control::placeholder {
  color: #98a4b3;
  opacity: 1;
}

.shop-co-control:hover {
  border-color: #b7c4d4;
}

.shop-co-control:focus {
  outline: none;
  border-color: var(--color-primary, #1b4a78);
  box-shadow: 0 0 0 3px rgba(27, 74, 120, 0.14);
}

.shop-co-field--error .shop-co-control,
.shop-co-consent--error {
  border-color: #b42318;
}

.shop-co-field--error .shop-co-control:focus {
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.14);
}

.shop-co-error {
  margin: 0;
  color: #b42318;
  font-size: 0.875rem;
  line-height: 1.4;
}

.shop-co-policies {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.15rem;
  margin: 0 0 1.15rem;
  padding: 0 0 1.15rem;
  border-bottom: 1px solid var(--color-border, #d5dee8);
}

.shop-co-policies a {
  color: var(--color-primary, #1b4a78);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.shop-co-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0;
  padding: 0.95rem 1rem;
  border: 1px solid var(--color-border, #d5dee8);
  border-radius: var(--radius-sm, 4px);
  background: var(--color-soft, #f5f7f9);
  cursor: pointer;
}

.shop-co-consent input {
  width: 1.2rem;
  height: 1.2rem;
  margin: 0.15rem 0 0;
  flex: 0 0 auto;
  accent-color: var(--color-primary, #1b4a78);
}

.shop-co-consent-text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.55rem;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.55;
  color: var(--color-text, #1a2b3c);
  word-break: keep-all;
}

/* Summary — a bordered panel, not a raised card. It is the only boxed element
   on the page, which is what makes it read as the thing you act on. */
.shop-co-summary {
  padding: var(--space-5) var(--space-5) var(--space-5);
  border: 1px solid var(--color-rule-strong, #c9d4e0);
  border-radius: var(--radius-sm, 4px);
  background: #fff;
}

.shop-co-summary-title {
  margin: 0 0 var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-primary-dark, #123556);
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-primary-dark, #123556);
}

.shop-co-product {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr);
  gap: 0.95rem;
  align-items: start;
  margin-bottom: 1.15rem;
}

.shop-co-thumb {
  width: 5.25rem;
  height: 5.25rem;
  overflow: hidden;
  border: 1px solid var(--color-rule, #e4e9ee);
  border-radius: var(--radius-sm, 4px);
  background: var(--color-soft, #f5f7f9);
}

.shop-co-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.shop-co-thumb--empty {
  display: grid;
  place-items: center;
  color: #8a93a0;
  font-size: 0.78rem;
  text-align: center;
  padding: 0.35rem;
}

.shop-co-product-name {
  margin: 0 0 0.45rem;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.45;
  word-break: keep-all;
  color: var(--color-text, #1a2b3c);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shop-co-product-price {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary-dark, #123556);
}

.shop-co-field--qty {
  margin-bottom: 1.15rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--color-border, #d5dee8);
}

.shop-co-pricebox {
  margin: 0 0 1.2rem;
}

.shop-co-price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 0.45rem 0;
  font-size: 0.95rem;
}

.shop-co-price-row > span:first-child {
  color: var(--color-muted, #5a6b7d);
}

.shop-co-price-row > span:last-child {
  font-weight: 600;
  color: var(--color-text, #1a2b3c);
  text-align: right;
}

.shop-co-price-hint {
  margin: 0.15rem 0 0.85rem;
  color: var(--color-muted, #5a6b7d);
  font-size: 0.8rem;
  line-height: 1.45;
}

.shop-co-price-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 0;
  padding-top: 0.95rem;
  border-top: 1px solid var(--color-border, #d5dee8);
}

.shop-co-price-total > span {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--color-primary-dark, #123556);
}

.shop-co-price-total strong {
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-primary-dark, #123556);
  text-align: right;
}

.shop-co-submit {
  display: flex;
  width: 100%;
  min-height: 3.4rem;
  margin: 0;
  border: 0;
  border-radius: var(--radius-sm, 4px);
  font-size: var(--fs-lg);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease;
}

.shop-co-submit:active {
  transform: translateY(1px);
}

.shop-co-notice {
  margin-top: 1.15rem;
  padding-top: 1.05rem;
  border-top: 1px solid var(--color-border, #d5dee8);
}

.shop-co-notice-title {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-primary-dark, #123556);
}

.shop-co-notice > p {
  margin: 0;
  color: var(--color-muted, #5a6b7d);
  font-size: 0.84rem;
  line-height: 1.55;
  word-break: keep-all;
}

.shop-co-notice-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  margin-top: 0.55rem !important;
}

.shop-co-notice-links a {
  color: var(--color-primary, #1b4a78);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 959px) {
  .shop-co-layout {
    gap: var(--space-6);
  }

  .shop-co-section {
    padding-bottom: var(--space-5);
  }

  .shop-co-section + .shop-co-section {
    padding-top: var(--space-5);
  }

  .shop-co-field--postal {
    max-width: 12rem;
  }

  .shop-co-summary {
    padding: var(--space-4);
  }
}

@media (max-width: 430px) {
  .shop-co-product {
    grid-template-columns: 4.75rem minmax(0, 1fr);
  }

  .shop-co-thumb {
    width: 4.75rem;
    height: 4.75rem;
  }

  .shop-co-price-total strong {
    font-size: 1.4rem;
  }
}

/* ---- Pay ------------------------------------------------------------------
   Same two-column split, same panel border, same amount treatment as the order
   sheet, so arriving here does not feel like entering another system. */
.shop-pay-layout {
  display: grid;
  gap: var(--space-5);
  margin-top: 0;
  align-items: start;
}

@media (min-width: 800px) {
  .shop-pay-layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    column-gap: var(--space-7);
  }
}

.shop-pay-summary,
.shop-pay-panel {
  padding: var(--space-5);
  border: 1px solid var(--color-rule-strong, #c9d4e0);
  border-radius: var(--radius-sm, 4px);
  background: #fff;
}

.shop-pay-summary {
  background: var(--color-soft, #f5f7f9);
}

.shop-pay-summary .shop-form-heading,
.shop-pay-panel .shop-form-heading {
  margin: 0 0 var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-primary-dark, #123556);
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-primary-dark, #123556);
}

/* The order/payment figures reuse the site-wide declaration line. */
.shop-pay-layout .account-dl {
  margin: 0;
  border-top: 1px solid var(--color-rule, #e4e9ee);
}

.shop-pay-layout .account-dl > div {
  display: grid;
  grid-template-columns: minmax(5.5rem, 7rem) minmax(0, 1fr);
  gap: 0.15rem var(--space-4);
  padding: 0.7rem 0;
  margin: 0;
  border-bottom: 1px solid var(--color-rule, #e4e9ee);
}

.shop-pay-layout .account-dl dt {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.9;
  color: var(--color-muted, #5a6b7d);
}

.shop-pay-layout .account-dl dd {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.65;
  word-break: keep-all;
}

.shop-pay-amount {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-primary-dark, #1b4a78);
}

.shop-pay-actions {
  margin: var(--space-5) 0 0;
}

.shop-pay-unconfigured {
  margin-bottom: var(--space-3);
}

.shop-pay-panel .notice {
  border-radius: var(--radius-sm, 4px);
}

.order-list .content-list-meta {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted, #5c6470);
  font-size: 0.9rem;
}

.order-dl {
  margin-top: 0.25rem;
}

.shop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

#toss-pay-root {
  margin-top: 1.1rem;
}

.pay-method-fieldset {
  border: 0;
  margin: 0 0 var(--space-5);
  padding: 0;
}

.pay-method-fieldset legend {
  padding: 0;
  margin-bottom: var(--space-3);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-muted, #5a6b7d);
}

.pay-method-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  padding: 0.85rem 0.9rem;
  min-height: 3rem;
  border: 1px solid var(--color-rule, #e4e9ee);
  border-radius: var(--radius-sm, 4px);
  font-weight: 600;
  cursor: pointer;
}

.pay-method-option + .pay-method-option {
  margin-top: var(--space-2);
}

.pay-method-option:hover {
  border-color: var(--color-rule-strong, #c9d4e0);
}

.pay-method-option input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--color-primary, #1b4a78);
}

#toss-pay-root .btn {
  min-height: 3.4rem;
  font-size: var(--fs-lg);
}
