:root {
  --color-bg: #f6f2ea;
  --color-surface: #fffdfa;
  --color-surface-alt: #f1eadf;
  --color-border: #ddd1bd;
  --color-text: #2f261d;
  --color-muted: #6f6253;
  --color-primary: #246b45;
  --color-primary-dark: #1d5839;
  --color-accent: #d98d3d;
  --color-cart: #f2b27f;
  --color-cart-dark: #e39a5f;
  --color-cart-badge: #e58a4e;
  --color-danger: #b6462f;
  --color-warning-bg: #fff1dc;
  --shadow-panel: 0 18px 40px rgba(57, 39, 17, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 20px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --max-width: 1120px;
  --font-body: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--color-text);
  background:
    radial-gradient(circle at top right, rgba(217, 141, 61, 0.12), transparent 30%),
    linear-gradient(180deg, #fbf8f2 0%, var(--color-bg) 100%);
}

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

button,
input,
textarea,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: var(--space-5) var(--space-4) var(--space-7);
}

.page-header,
.section-head,
.button-row,
.header-nav,
.hero-meta,
.status-grid,
.confirm-layout {
  display: flex;
}

.page-header {
  justify-content: space-between;
  gap: var(--space-4);
  align-items: flex-start;
  margin-bottom: var(--space-5);
}

.eyebrow,
.section-label,
.meta-label {
  margin: 0 0 var(--space-1);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: var(--space-2);
  font-size: clamp(1.9rem, 6vw, 2.6rem);
  line-height: 1.15;
}

h2 {
  margin-bottom: var(--space-2);
  font-size: clamp(1.35rem, 4vw, 1.8rem);
  line-height: 1.25;
}

.lead,
.panel-text {
  color: var(--color-muted);
  line-height: 1.7;
}

.page-main {
  display: grid;
  gap: var(--space-4);
}

.notice {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
}

.notice.warning {
  background: var(--color-warning-bg);
}

.notice.error {
  border-color: rgba(182, 70, 47, 0.35);
  color: var(--color-danger);
}

.notice.success {
  border-color: rgba(36, 107, 69, 0.35);
  color: var(--color-primary-dark);
}

.notice pre {
  margin: 8px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.5;
}

.panel {
  padding: var(--space-5);
  border: 1px solid rgba(221, 209, 189, 0.9);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 250, 0.95);
  box-shadow: var(--shadow-panel);
}

.hero-panel {
  justify-content: space-between;
  gap: var(--space-4);
  align-items: center;
}

.hero-meta {
  gap: var(--space-3);
  flex-wrap: wrap;
}

.meta-card,
.status-card {
  min-width: 140px;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
}

.content-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
}

.content-grid.single-column {
  grid-template-columns: 1fr;
}

.section-head {
  justify-content: space-between;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-4);
}

.section-head.tight {
  margin-bottom: var(--space-3);
}

.product-list,
.cart-list,
.confirm-items,
.form-grid {
  display: grid;
  gap: var(--space-3);
}

.product-card,
.cart-item,
.confirm-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
}

.product-card {
  overflow: hidden;
}

.product-image {
  display: grid;
  place-items: center;
  min-height: 180px;
  background:
    linear-gradient(135deg, rgba(36, 107, 69, 0.08), rgba(217, 141, 61, 0.18)),
    #f7f2e8;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.product-body,
.cart-item,
.confirm-item {
  padding: var(--space-4);
}

.product-meta,
.cart-line,
.status-grid,
.price-summary,
.confirm-footer,
.button-row,
.quantity-control {
  gap: var(--space-3);
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-3);
}

.price {
  font-size: 1.1rem;
  font-weight: 700;
}

.description {
  margin-bottom: var(--space-4);
  color: var(--color-muted);
  line-height: 1.7;
}

.button,
.quantity-button {
  border: none;
  border-radius: 999px;
  min-height: 48px;
  padding: 0 var(--space-4);
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background-color 0.18s ease;
}

.button:hover,
.quantity-button:hover {
  transform: translateY(-1px);
}

.button:disabled,
.quantity-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.button.primary {
  background: var(--color-primary);
  color: #fff;
}

.button.primary:hover {
  background: var(--color-primary-dark);
}

.button.secondary,
.quantity-button {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.button.small {
  min-height: 40px;
  padding: 0 var(--space-3);
}

.text-link {
  color: var(--color-primary-dark);
  text-decoration: none;
  font-weight: 700;
}

.cart-panel {
  align-self: start;
  position: sticky;
  top: var(--space-4);
}

.cart-floating-button {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border: none;
  border-radius: 999px;
  background: var(--color-cart);
  color: #fff;
  box-shadow: 0 18px 40px rgba(227, 154, 95, 0.34);
  cursor: pointer;
}

.cart-floating-button:hover {
  background: var(--color-cart-dark);
}

.cart-floating-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.cart-floating-count {
  position: absolute;
  top: -4px;
  right: -2px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--color-cart-badge);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}

.cart-drawer {
  position: fixed;
  right: 20px;
  bottom: 96px;
  z-index: 45;
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100vh - 132px);
  overflow: auto;
}

.cart-drawer-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: var(--space-2);
  background: rgba(255, 253, 250, 0.96);
}

.cart-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(47, 38, 29, 0.2);
}

.empty-state,
.address-box {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  color: var(--color-muted);
  line-height: 1.7;
}

.cart-item {
  display: grid;
  gap: var(--space-3);
}

.cart-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quantity-control {
  display: inline-flex;
  align-items: center;
}

.quantity-value {
  min-width: 2.5rem;
  text-align: center;
  font-weight: 700;
}

.price-summary {
  display: grid;
  margin: var(--space-4) 0;
}

.price-summary div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-summary dt,
.price-summary dd,
.confirm-total {
  margin: 0;
}

.subheading {
  margin-bottom: var(--space-2);
  font-size: 1rem;
}

.confirm-layout {
  flex-direction: column;
}

.confirm-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-5);
}

.field {
  display: grid;
  gap: var(--space-1);
}

.field label {
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 50px;
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.field input:focus {
  outline: 2px solid rgba(36, 107, 69, 0.2);
  border-color: var(--color-primary);
}

.form-actions {
  margin-top: var(--space-2);
}

.input-with-action {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.field-note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.6;
}

.field-note.error {
  color: var(--color-danger);
}

.field-note.success {
  color: var(--color-primary-dark);
}

@media (max-width: 767px) {
  .app-shell {
    padding: var(--space-4) var(--space-3) var(--space-6);
  }

  .page-header,
  .hero-panel,
  .confirm-footer {
    flex-direction: column;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .cart-panel {
    position: static;
  }

  .cart-drawer {
    right: 12px;
    bottom: 88px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 112px);
  }

  .cart-floating-button {
    right: 12px;
    bottom: 12px;
  }

  .button-row {
    width: 100%;
    flex-direction: column;
  }

  .button-row .button,
  .form-actions .button {
    width: 100%;
  }

  .input-with-action {
    grid-template-columns: 1fr;
  }

  .input-with-action .button {
    width: 100%;
  }
}
