:root {
  --ink: #1c2233;
  --muted: #5c6478;
  --line: #e7e5df;
  --soft: #f7f7f5;
  --main: #14213d;
  --accent: #c94416;
  --error: #b3261e;
  --notice: #fff4d6;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Noto Sans KR", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: #fff;
  overflow-wrap: anywhere;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--main);
}

h1 {
  margin: 0 0 16px;
  font-size: 24px;
  line-height: 1.3;
}

/* 상단 메뉴 */
#site-header {
  min-height: 101px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

nav a,
.nav-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  font: inherit;
  color: var(--ink);
  background: none;
  text-decoration: none;
  cursor: pointer;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px;
}

.narrow {
  max-width: 480px;
}

.notice {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--notice);
}

.muted {
  color: var(--muted);
}

.message {
  color: var(--error);
}

/* 버튼과 입력칸 */
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  cursor: pointer;
}

.button:disabled {
  opacity: 0.6;
  cursor: default;
}

.button.secondary {
  border: 1px solid var(--main);
  color: var(--main);
  background: #fff;
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 4px;
  font-weight: 600;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #b9b7b0;
  border-radius: 8px;
  font: inherit;
  font-size: 16px;
  font-weight: 400;
}

/* 상품 목록 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 12px;
}

.product-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.product-photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  background: var(--soft);
}

.product-name {
  display: block;
  margin-top: 8px;
}

.product-price {
  display: block;
  font-weight: 700;
}

/* 상품 상세 */
.product-detail {
  display: grid;
  gap: 16px;
}

.product-detail h1 {
  margin-bottom: 4px;
}

.detail-price {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
}

.checkout-actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

/* 결제 내역 */
.order-list {
  display: grid;
  gap: 12px;
}

.order-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.order-amount {
  font-weight: 700;
}

.order-card .muted {
  grid-column: 1 / -1;
}

@media (min-width: 600px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px 16px;
  }

  .order-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    min-height: 61px;
  }
}

@media (min-width: 900px) {
  main {
    padding: 24px;
  }

  .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .product-detail {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
  }
}
