:root {
  color-scheme: light;
  --ink: #202e28;
  --green: #173b32;
  --pine: #235444;
  --deep-green: #102f28;
  --red: #a92e36;
  --red-dark: #8a232b;
  --gold: #f0cc84;
  --canvas: #faf8f4;
  --paper: #fff;
  --line: #e5e3dc;
  --muted: #56655d;
  --mint: #edf3ed;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  background: var(--canvas);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
body { line-height: 1.6; padding-bottom: env(safe-area-inset-bottom); }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #a63b43; outline-offset: 3px; }

.shell { width: min(100% - 48px, 1200px); margin-inline: auto; }

/* ---- ヘッダー ---- */
.header { position: sticky; top: 0; z-index: 20; background: #fffefacc; backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--green); font-weight: 750; text-decoration: none; }
.brand-star { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--red); color: #fff0ca; }
.header-cart { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 99px; background: var(--pine); color: #fff; font-weight: 700; font-size: .9rem; text-decoration: none; }
.cart-badge { min-width: 22px; padding: 0 6px; border-radius: 99px; background: var(--gold); color: var(--deep-green); text-align: center; font-size: .8rem; }

.bag { position: relative; display: inline-block; width: 14px; height: 13px; border: 2px solid currentColor; border-radius: 2px 2px 4px 4px; }
.bag::before { content: ""; position: absolute; left: 2px; top: -7px; width: 6px; height: 6px; border: 2px solid currentColor; border-bottom: 0; border-radius: 6px 6px 0 0; }
.bag-large { transform: scale(2); margin: 18px 0 14px; color: #9aaba1; }

.banner { margin-top: 16px; padding: 10px 14px; border-radius: 10px; background: #fff4d6; border: 1px solid #f0d58f; color: #5b4300; font-size: .9rem; font-weight: 600; }

/* ---- ヒーロー ---- */
.hero { position: relative; display: flex; align-items: center; overflow: hidden; min-height: 260px; margin-top: 20px; border-radius: 22px; color: #fffaf0;
  background: radial-gradient(ellipse at 88% 12%, #346757aa, transparent 50%), linear-gradient(120deg, var(--deep-green), var(--green)); }
.hero::after { content: ""; position: absolute; inset: 10px; border: 1px solid #f0cc844e; border-radius: 15px; pointer-events: none; }
.hero-copy { position: relative; z-index: 1; padding: 36px 40px; max-width: 58%; }
.hero-eyebrow { color: var(--gold); font-family: Georgia, serif; font-size: .85rem; font-weight: 700; letter-spacing: .21em; margin-bottom: 10px; }
.hero h1 { font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; font-size: clamp(1.7rem, 4vw, 3rem); line-height: 1.25; }
.hero-copy p:last-child { margin-top: 14px; color: #f5f0e4; }
.hero-pictures { position: absolute; top: 0; right: 24px; width: 42%; height: 100%; }
.hero-pictures img { position: absolute; padding: 6px; border-radius: 16px; background: #fffbf4; box-shadow: 0 10px 22px #081a1780; aspect-ratio: 1; object-fit: contain; height: auto; }
.hero-small { top: 24%; left: 6%; width: 38%; transform: rotate(-10deg); }
.hero-large { top: 14%; right: 6%; width: 46%; transform: rotate(8deg); }
.hero-sparkle { position: absolute; z-index: 1; color: #ffdc95; font-size: 1.8rem; }
.hero-sparkle-top { top: 10%; left: 12%; }
.hero-sparkle-bottom { bottom: 10%; left: 48%; }

/* ---- 料金帯 ---- */
.pricing-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.pricing-strip > div { padding: 12px 16px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); text-align: center; }
.pricing-label { display: block; color: var(--muted); font-size: .8rem; }
.pricing-strip strong { color: var(--red); font-size: 1.2rem; }

/* ---- レイアウト ---- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; margin-top: 28px; }
.section-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.section-top h2 { color: var(--green); font-size: 1.4rem; }
.search { position: relative; width: min(100%, 300px); }
.search input { width: 100%; height: 44px; padding: 0 12px 0 38px; border: 1px solid #dddcd4; border-radius: 10px; background: var(--paper); }
.search-icon { position: absolute; left: 14px; top: 15px; width: 13px; height: 13px; border: 1.7px solid var(--muted); border-radius: 50%; pointer-events: none; }
.search-icon::after { content: ""; position: absolute; bottom: -3px; right: -4px; width: 6px; height: 1.7px; background: var(--muted); transform: rotate(47deg); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.filters button { min-height: 38px; padding: 5px 14px; border-radius: 99px; border: 1px solid #dedfd7; background: #fffefa; color: var(--green); font-size: .875rem; font-weight: 650; }
.filters button[aria-pressed="true"] { background: var(--pine); border-color: var(--pine); color: #fff; }
.count { margin: 12px 0 10px; color: var(--muted); font-size: .875rem; }
.empty-results { padding: 30px; text-align: center; color: var(--muted); }
.empty-results button { margin-top: 10px; }

/* ---- 商品カード ---- */
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.product-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid #e1e3da; border-radius: 14px; background: var(--paper); transition: box-shadow .2s, border-color .2s; }
.product-card.added { border-color: var(--pine); box-shadow: 0 0 0 2px var(--pine); }
.product-photo { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; padding: 8px; background: #fff; border-bottom: 1px solid #efefe8; }
.product-info { padding: 10px 12px 0; }
.product-name { font-size: .92rem; line-height: 1.5; overflow-wrap: anywhere; }
.product-price { margin-top: 4px; color: var(--muted); font-size: .8rem; }
.product-stock { margin-top: 4px; color: #8a5a00; font-size: .78rem; }
.product-controls { display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 10px 12px 0; margin-top: auto; }
.field { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--muted); font-weight: 600; }
.field select { min-height: 40px; min-width: 76px; padding: 0 8px; border: 1px solid #cfd7ce; border-radius: 9px; background: var(--paper); color: var(--ink); }
.add-button { margin: 10px 12px 0; }
.card-status { min-height: 1.6em; padding: 4px 12px 10px; color: var(--pine); font-size: .78rem; font-weight: 600; }

/* ---- 個数ステッパー ---- */
.stepper { display: inline-flex; align-items: stretch; height: 40px; border: 1px solid #cfd7ce; border-radius: 10px; overflow: hidden; background: var(--paper); }
.stepper button { width: 40px; border: 0; background: var(--mint); color: var(--pine); font-size: 1.2rem; font-weight: 700; }
.stepper button:disabled { opacity: .4; }
.stepper input { width: 46px; border: 0; border-inline: 1px solid #e1e6df; text-align: center; font-weight: 700; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ---- ボタン ---- */
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px; border-radius: 11px; font-weight: 750; text-decoration: none; text-align: center; }
.primary { border: 0; background: var(--red); color: #fff; }
.primary:hover:not(:disabled) { background: var(--red-dark); }
.primary:disabled { background: #c9c3bd; }
.secondary { border: 1px solid var(--pine); background: #fffefa; color: var(--pine); }
.wide { width: 100%; min-height: 52px; font-size: 1.05rem; }
.subtle-link { display: block; margin-top: 12px; color: var(--pine); font-size: .875rem; text-align: center; text-underline-offset: 3px; }

/* ---- カート ---- */
.order { position: sticky; top: 76px; padding: 20px; border: 1px solid #d8e3d8; border-radius: 16px; background: var(--mint); max-height: calc(100vh - 92px); overflow-y: auto; }
.order-heading { display: flex; justify-content: space-between; align-items: center; }
.order-heading h2 { display: flex; align-items: center; gap: 9px; color: var(--deep-green); font-size: 1.15rem; }
.order-heading span:last-child { color: var(--muted); font-weight: 700; }
.cart-empty { display: flex; flex-direction: column; align-items: center; padding: 18px 0; color: var(--muted); font-size: .875rem; text-align: center; }
.cart-empty p { font-weight: 700; color: var(--ink); }
.order-lines { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.order-line { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 11px; background: var(--paper); border: 1px solid #dfe8de; }
.order-line img { flex: 0 0 56px; width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background: #fff; }
.line-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.line-name { font-size: .85rem; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.line-size { font-size: .78rem; color: var(--muted); }
.line-quantity { flex: none; color: var(--pine); }
.line-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.line-actions .stepper { height: 34px; }
.line-actions .stepper button { width: 34px; }
.line-actions .stepper input { width: 40px; }
.remove { border: 0; background: none; color: var(--red); font-size: .8rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 6px; }
.price-breakdown { margin-top: 16px; padding-top: 12px; border-top: 1px solid #d0dcd0; display: grid; gap: 6px; }
.price-breakdown > div { display: flex; justify-content: space-between; font-size: .9rem; }
.price-breakdown .discount dd { color: var(--red); font-weight: 700; }
.price-total { margin-top: 4px; padding-top: 8px; border-top: 1px dashed #c3d0c3; font-weight: 800; font-size: 1.15rem !important; color: var(--deep-green); }
.discount-hint { min-height: 1.4em; margin-top: 4px; color: var(--red); font-size: .8rem; font-weight: 700; text-align: right; }
.order-note { margin-top: 10px; color: var(--muted); font-size: .8rem; }
.notice-box { margin: 14px 0 10px; padding: 12px 14px; border-radius: 12px; background: #fffdf6; border: 1px solid #ecdcae; font-size: .82rem; }
.notice-title { font-weight: 800; color: #6b4b00; margin-bottom: 6px; }
.notice-box ul, .notice-box ol { padding-left: 1.2em; display: grid; gap: 5px; }
.agree { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 10px; border-radius: 9px; background: var(--paper); border: 1px solid #e3dccb; font-weight: 700; font-size: .9rem; cursor: pointer; }
.agree input { width: 20px; height: 20px; accent-color: var(--pine); }
.checkout-state { min-height: 1.4em; margin: 6px 0; font-size: .82rem; color: var(--red); font-weight: 600; }

/* ---- フッター ---- */
.footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 48px; padding: 24px 0 100px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.footer div { display: flex; gap: 16px; flex-wrap: wrap; }
.footer a { color: var(--pine); font-weight: 650; }

/* ---- スマホ用の下部カートバー ---- */
.mobile-cart { display: none; }

/* ---- 成功画面 ---- */
.success-shell { max-width: 720px; padding: 28px 0 60px; }
.receipt { padding: 24px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); }
.receipt-title { display: flex; align-items: center; gap: 10px; }
.receipt-title h1 { font-size: 1.35rem; color: var(--deep-green); }
.receipt-mark { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--pine); color: #fff; font-weight: 800; }
#receipt-status { margin-top: 10px; color: var(--muted); }
.receipt-note { margin-top: 12px; color: var(--muted); font-size: .875rem; }
#delivery { margin-top: 18px; }
#delivery label { font-weight: 800; color: var(--green); }
#official-url { display: block; width: 100%; margin-top: 6px; padding: 10px; border: 1px solid #cfd7ce; border-radius: 10px; font-family: ui-monospace, Menlo, monospace; font-size: .8rem; word-break: break-all; resize: none; background: #fafcf9; }
.receipt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
#retry-confirmation { margin-top: 14px; }

@media (max-width: 1020px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; }
}

@media (max-width: 760px) {
  .shell { width: min(100% - 24px, 1200px); }
  .hero { min-height: 200px; }
  .hero-copy { max-width: 62%; padding: 24px 20px; }
  .hero-copy p:last-child { font-size: .85rem; }
  .hero-pictures { right: 0; width: 44%; }
  .pricing-strip { gap: 6px; }
  .pricing-strip > div { padding: 9px 6px; }
  .pricing-strip strong { font-size: 1rem; }
  .layout { grid-template-columns: 1fr; }
  .order { position: static; max-height: none; scroll-margin-top: 70px; }
  .product-grid { gap: 10px; }
  .product-info { padding: 8px 9px 0; }
  .product-name { font-size: .85rem; }
  .product-controls { padding: 8px 9px 0; }
  .product-controls .field, .product-controls .stepper, .product-controls select { width: 100%; }
  .stepper { height: 44px; }
  .stepper button { flex: 0 0 42px; }
  .stepper input { flex: 1; width: auto; min-width: 0; }
  .add-button { margin: 8px 9px 0; }
  .card-status { padding: 4px 9px 8px; }
  .mobile-cart { position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-radius: 14px; background: var(--deep-green); color: #fff; text-decoration: none; font-weight: 700; box-shadow: 0 8px 24px #0a1f1a66; }
  .mobile-cart[hidden] { display: none !important; }
  .receipt { padding: 18px; }
  .receipt-actions { grid-template-columns: 1fr; }
}

/* ---- ご利用の流れ ---- */
.howto { margin-top: 20px; padding: 20px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); }
.howto h2 { color: var(--green); font-size: 1.2rem; }
.howto-steps { list-style: none; counter-reset: step; padding: 0; margin-top: 12px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.howto-steps li { counter-increment: step; position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 12px 12px; border-radius: 12px; background: var(--mint); font-size: .82rem; }
.howto-steps li::before { content: counter(step); position: absolute; top: -8px; left: -6px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; font-size: .85rem; }
.howto-when { color: var(--red); font-weight: 800; font-size: .75rem; }
.howto-steps strong { color: var(--deep-green); font-size: .92rem; }
.howto-steps span:last-child { color: var(--ink); line-height: 1.6; }
.howto-note { margin-top: 10px; color: var(--muted); font-size: .78rem; }
@media (max-width: 1020px) { .howto-steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .howto { padding: 16px; } .howto-steps { grid-template-columns: 1fr; gap: 12px; } }
.product-limit { margin-top: 2px; color: var(--red); font-size: .76rem; font-weight: 700; }
.add-button:disabled { background: #c9c3bd; }
.go-button { margin-top: 4px; }
.go-note { margin-top: 8px; color: var(--ink); font-size: .85rem; }
/* ---- 支払い前の確認ポップアップ ---- */
.confirm-dialog { width: min(100% - 32px, 460px); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 20px 60px #0a1f1a55; }
.confirm-dialog::backdrop { background: #0a1f1a99; }
.confirm-body { padding: 22px; }
.confirm-body h2 { color: var(--deep-green); font-size: 1.15rem; margin-bottom: 10px; }
.confirm-body ul { padding-left: 1.2em; display: grid; gap: 6px; font-size: .9rem; }
.confirm-warning { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #fdecec; border: 1px solid #f1b8b8; color: #7a1f25; font-size: .88rem; font-weight: 700; }
.confirm-actions { display: grid; gap: 8px; margin-top: 16px; }
