/* ============================================================
   請島農園 — 貼り絵 × 昭和ノスタルジー デザインシステム
   paper.css : 共通トークン・フォント・貼り絵部品
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@400;500;700;900&family=Shippori+Mincho:wght@500;600;700;800&family=Yomogi&family=Reggae+One&display=swap');

:root {
  /* --- 紙の色（昭和の古紙・わら半紙のような温かみ） --- */
  --paper:        #f4ead2;   /* ベースの生成り */
  --paper-warm:   #efe0c0;   /* 一段濃い紙 */
  --paper-deep:   #e6d3ac;   /* 影の紙 */
  --paper-white:  #faf4e6;   /* 白めの貼り紙 */

  /* --- インク（墨・こげ茶） --- */
  --ink:          #423528;
  --ink-soft:     #6d5c46;
  --ink-faint:    #a2917a;

  /* --- 貼り絵の色紙（昭和の褪せた原色） --- */
  --tankan:       #e37e34;   /* たんかんの橙 */
  --tankan-deep:  #c85f22;
  --tankan-pale:  #f2c17a;
  --leaf:         #7c874a;   /* 葉のくすんだ緑 */
  --leaf-deep:    #5b6835;
  --leaf-pale:    #b6bd80;
  --sea:          #4f978d;   /* 珊瑚礁の海 */
  --sea-deep:     #3a756d;
  --sea-pale:     #9cc6bd;
  --persimmon:    #bf4f37;   /* 朱・柿色 */
  --mustard:      #dca63e;   /* からし */
  --plum:         #7c5a6e;   /* 紫山芋の紫 */
  --sky:          #dccca4;   /* くすんだ空 */

  /* --- 用途 --- */
  --bg:           var(--paper);
  --fg:           var(--ink);

  --radius:       14px;
  --radius-lg:    22px;
  --radius-sm:    9px;

  --shadow-paper: 3px 5px 0 rgba(66,53,40,.13);
  --shadow-lift:  5px 8px 0 rgba(66,53,40,.16);

  --wrap: 1100px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* クラフト用紙風のざらついた質感（全面に薄くのせる） */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: .06; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

body {
  margin: 0;
  font-family: 'Zen Maru Gothic', system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  /* 紙の繊維のような粒状テクスチャ */
  background-image:
    radial-gradient(rgba(120,95,60,.035) 1px, transparent 1px),
    radial-gradient(rgba(120,95,60,.028) 1px, transparent 1px);
  background-size: 7px 7px, 11px 11px;
  background-position: 0 0, 3px 5px;
  line-height: 1.85;
  font-size: 17px;
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sea-deep); text-decoration: none; }
a:hover { color: var(--tankan-deep); }

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

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .04em;
  margin: 0;
  /* 和文見出しで最後の1文字だけが次行に落ちる「孤立文字」を避ける */
  text-wrap: pretty;
}

.mincho { font-family: 'Shippori Mincho', serif; }
.hand   { font-family: 'Yomogi', cursive; }
.pop    { font-family: 'Reggae One', 'Zen Maru Gothic', sans-serif; letter-spacing: .06em; }

/* 和文見出しの節を包み、読点(、)などの区切りでのみ改行させる（語の途中で割れない） */
.nobr { white-space: nowrap; }

/* 本文は末尾に1文字だけ残る「孤立行」を避ける（対応ブラウザのみ・非対応は無視され安全） */
p, li, dd, dt, figcaption, blockquote,
.sub, .lead, .desc, .note, .hero-cap, .jp-sub { text-wrap: pretty; }

/* ============================================================
   貼り絵の紙片 — ちぎった縁のような不揃いさをフィルタで表現
   ============================================================ */

/* HTML側に #deckle / #deckle-soft のSVGフィルタを置いて参照する */
.torn {
  filter: url(#deckle);
}
.torn-soft {
  filter: url(#deckle-soft);
}

/* 色紙のカード（貼り重ねた紙のような段差の影） */
.card {
  position: relative;
  background: var(--paper-white);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow-paper);
}
.card.torn { box-shadow: none; }  /* 影はフィルタ側で付ける */

/* 貼り紙のラベル（見出しの下地） */
.tag {
  display: inline-block;
  padding: 5px 16px 6px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--paper-white);
  background: var(--leaf);
}
.tag.tankan { background: var(--tankan); }
.tag.sea    { background: var(--sea); }
.tag.plum   { background: var(--plum); }
.tag.mustard{ background: var(--mustard); color: var(--ink); }

/* セロテープ風の留め */
.tape {
  position: absolute;
  width: 78px; height: 24px;
  background: rgba(232,214,160,.55);
  border-left: 1px dashed rgba(120,95,60,.25);
  border-right: 1px dashed rgba(120,95,60,.25);
  transform: rotate(-4deg);
  top: -11px; left: 50%; margin-left: -39px;
  backdrop-filter: blur(.5px);
  box-shadow: 0 1px 2px rgba(66,53,40,.08);
}

/* 手書き風の下線（貼り絵のクレヨン線） */
.underline-crayon {
  background-image: linear-gradient(transparent 62%, var(--mustard) 62%, var(--mustard) 88%, transparent 88%);
  padding: 0 .1em;
}

/* ============================================================
   ボタン
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .06em;
  padding: 13px 30px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  color: var(--paper-white);
  background: var(--tankan);
  box-shadow: 3px 4px 0 var(--tankan-deep);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { color: var(--paper-white); transform: translate(-1px,-1px); box-shadow: 4px 5px 0 var(--tankan-deep); }
.btn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--tankan-deep); }
.btn.leaf { background: var(--leaf); box-shadow: 3px 4px 0 var(--leaf-deep); }
.btn.leaf:hover { box-shadow: 4px 5px 0 var(--leaf-deep); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 3px 4px 0 rgba(66,53,40,.18);
}
.btn.ghost:hover { color: var(--ink); background: rgba(255,255,255,.35); }

/* ============================================================
   レイアウト
   ============================================================ */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 780px; margin: 0 auto; padding: 0 24px; }

section { position: relative; }

.section-pad { padding: 84px 0; }

/* 見出しのセット */
.head { text-align: center; margin-bottom: 52px; }
.head .en { font-size: .8rem; letter-spacing: .3em; color: var(--ink-soft); text-transform: uppercase; }
.head h2 {
  font-family: 'Shippori Mincho', serif;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  margin-top: 10px;
  color: var(--ink);
}
.head p { color: var(--ink-soft); margin-top: 14px; }

/* ============================================================
   ナビゲーション（貼り紙の帯）
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: var(--paper-warm);
  border-bottom: 2px solid rgba(120,95,60,.18);
}
.nav-inner {
  max-width: var(--wrap); margin: 0 auto;
  padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.logo {
  display: flex; align-items: center; gap: 11px;
  font-family: 'Shippori Mincho', serif;
  color: var(--ink);
}
.logo:hover { color: var(--ink); }
.logo .mark {
  position: relative;
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  background: var(--tankan);
  color: var(--paper-white);
  border-radius: 50% 48% 52% 50% / 50% 52% 48% 50%;
  font-family: 'Reggae One', sans-serif;
  font-size: 1.15rem;
  box-shadow: 2px 3px 0 var(--tankan-deep);
}
/* ヘタの緑のぽっちり */
.logo .mark::after {
  content: '';
  position: absolute; top: -3px; left: 44%; transform: translateX(-50%);
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--leaf);
  box-shadow: 1px 1px 0 var(--leaf-deep);
}
.logo .lt { font-size: .72rem; letter-spacing: .3em; color: var(--ink-soft); display: block; line-height: 1; }
.logo .lb { font-size: 1.18rem; font-weight: 800; letter-spacing: .12em; line-height: 1.2; }

.nav-links { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.nav-links a {
  color: var(--ink); font-weight: 500; font-size: .92rem;
  padding: 7px 11px; border-radius: 999px;
  white-space: nowrap;
  transition: background .12s;
}
.nav-links a:hover { background: rgba(227,126,52,.16); color: var(--ink); }
.nav-links a.active { background: var(--tankan); color: var(--paper-white); }
.nav-links a.shop { background: var(--leaf); color: var(--paper-white); font-weight: 700; }
.nav-links a.shop:hover { background: var(--leaf-deep); color: var(--paper-white); }

/* カートボタン */
.cart-link {
  position: relative; display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--tankan); color: var(--paper-white) !important;
  box-shadow: 2px 3px 0 var(--tankan-deep);
  flex: none;
}
.cart-link:hover { background: var(--tankan-deep); transform: translate(-1px,-1px); }
.cart-link svg { width: 21px; height: 21px; }
.cart-count {
  position: absolute; top: -6px; right: -6px;
  min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--persimmon); color: var(--paper-white);
  border-radius: 999px; font-size: .72rem; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
  border: 2px solid var(--paper-warm);
}
.cart-count[data-empty="1"] { display: none; }

.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: var(--paper-warm);
    padding: 10px 18px 18px;
    border-bottom: 2px solid rgba(120,95,60,.18);
    gap: 2px;
  }
  .nav-links a { padding: 11px 14px; }
  #nav-check:checked ~ .nav-links { display: flex; }
  .nav-toggle {
    display: grid; place-items: center;
    width: 44px; height: 44px; cursor: pointer;
    border-radius: 10px;
  }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    content: ''; display: block; width: 22px; height: 2.5px; background: var(--ink); border-radius: 2px;
    position: relative;
  }
  .nav-toggle span::before { position: absolute; top: -7px; }
  .nav-toggle span::after  { position: absolute; top: 7px; }
}

/* ============================================================
   フッター
   ============================================================ */
.footer {
  background: var(--leaf-deep);
  color: var(--paper);
  padding: 56px 0 30px;
  margin-top: 30px;
}
.footer a { color: var(--paper); }
.footer a:hover { color: var(--tankan-pale); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; }
.footer h4 { font-size: .95rem; letter-spacing: .16em; margin-bottom: 14px; color: var(--tankan-pale); }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 8px; font-size: .92rem; opacity: .92; }
.footer .flogo { font-family: 'Shippori Mincho', serif; font-size: 1.4rem; font-weight: 800; letter-spacing: .12em; }
.footer .fnote { font-size: .86rem; opacity: .8; line-height: 1.8; margin-top: 12px; }
.footer .copy { text-align: center; margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.15); font-size: .8rem; opacity: .7; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; gap: 26px; } }

/* ============================================================
   貼り絵の装飾パーツ（CSSで作る色紙）
   ============================================================ */
/* お日さま */
.deco-sun {
  width: 90px; height: 90px; border-radius: 50%;
  background: var(--mustard);
  box-shadow: 3px 4px 0 rgba(66,53,40,.12);
}
/* ちぎった帯 */
.strip {
  height: 26px;
  background: repeating-linear-gradient(90deg, var(--tankan) 0 40px, var(--mustard) 40px 80px, var(--leaf) 80px 120px, var(--sea) 120px 160px);
  filter: url(#deckle-soft);
  opacity: .9;
}

/* 波（海）*/
.waves { display: block; width: 100%; height: auto; }

/* 汎用: 画像スロットの縁を紙っぽく */
image-slot { border-radius: var(--radius); overflow: hidden; }

/* 少し傾けて貼った風 */
.tilt-l { transform: rotate(-1.6deg); }
.tilt-r { transform: rotate(1.6deg); }

/* アニメーション：ふわっと */
@media (prefers-reduced-motion: no-preference) {
  .rise { opacity: 0; transform: translateY(16px); animation: rise .7s ease forwards; }
  @keyframes rise { to { opacity: 1; transform: none; } }
}

/* パンくず */
.crumb { font-size: .85rem; color: var(--ink-soft); padding: 22px 0 0; }
.crumb a { color: var(--ink-soft); }
.crumb a:hover { color: var(--tankan-deep); }

/* ============================================================
   カート
   ============================================================ */
.cart-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 24px);
  background: var(--ink); color: var(--paper); z-index: 9998;
  padding: 13px 22px; border-radius: 999px; font-size: .92rem; font-weight: 500;
  box-shadow: 3px 5px 0 rgba(0,0,0,.18);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.cart-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.cart-toast .ck { color: var(--leaf-pale); font-weight: 700; }
.cart-toast a { color: var(--tankan-pale); font-weight: 700; text-decoration: underline; }

/* 追加ボタン（商品カード内） */
.btn.add-cart { background: var(--tankan); box-shadow: 3px 4px 0 var(--tankan-deep); }
.btn.add-cart svg { width: 18px; height: 18px; }

/* 準備中（注文不可）ボタン：既存トークンのみで彩度を落とし、押せないと分かる見た目に。
   .btn.leaf / .btn.add-cart 等より後に置き、同specificityでも確実に上書きする。 */
.btn.is-disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  background: var(--paper-deep);
  color: var(--ink-faint);
  box-shadow: 3px 4px 0 rgba(66,53,40,.10);
  filter: grayscale(55%);
}
.btn.is-disabled:hover,
.btn[aria-disabled="true"]:hover,
.btn.is-disabled:active,
.btn[aria-disabled="true"]:active {
  color: var(--ink-faint);
  transform: none;
  box-shadow: 3px 4px 0 rgba(66,53,40,.10);
}

/* カートページ */
.cart-grid { display: grid; grid-template-columns: 1.6fr .9fr; gap: 34px; align-items: start; }
@media (max-width: 820px){ .cart-grid{ grid-template-columns: 1fr; } }

.cart-list { display: grid; gap: 14px; }
.cart-row {
  display: grid; grid-template-columns: 64px 1fr auto auto; gap: 18px; align-items: center;
  background: var(--paper-white); border-radius: var(--radius); padding: 16px 20px;
  box-shadow: var(--shadow-paper);
}
.ci-thumb { width: 64px; height: 64px; border-radius: 50% 46% 54% 50%/48% 52% 50% 52%; display: grid; place-items: center; box-shadow: 2px 3px 0 rgba(66,53,40,.14); }
.ci-thumb span { font-family:'Shippori Mincho',serif; color: var(--paper-white); font-size: 1.5rem; font-weight: 800; }
.ci-name { font-family:'Shippori Mincho',serif; font-size: 1.15rem; font-weight: 700; }
.ci-var { font-size: .82rem; color: var(--ink-soft); }
.ci-remove { background: none; border: none; color: var(--persimmon); font-size: .8rem; cursor: pointer; padding: 4px 0 0; font-family: inherit; }
.ci-remove:hover { text-decoration: underline; }
.ci-qty { display: flex; align-items: center; gap: 4px; background: var(--paper); border-radius: 999px; padding: 4px; }
.qbtn { width: 30px; height: 30px; border: none; border-radius: 50%; background: var(--paper-white); color: var(--ink); font-size: 1.1rem; cursor: pointer; box-shadow: 1px 1px 0 rgba(66,53,40,.15); line-height: 1; }
.qbtn:hover { background: var(--tankan); color: var(--paper-white); }
.qn { min-width: 26px; text-align: center; font-weight: 700; }
.ci-price { font-family:'Shippori Mincho',serif; font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
@media (max-width: 520px){
  .cart-row { grid-template-columns: 52px 1fr; grid-template-areas: 'thumb main' 'qty price'; row-gap: 12px; }
  .ci-thumb { grid-area: thumb; width:52px;height:52px; } .ci-main{ grid-area: main; } .ci-qty{ grid-area: qty; justify-self:start; } .ci-price{ grid-area: price; justify-self:end; }
}

.cart-summary h3 { font-family:'Shippori Mincho',serif; font-size: 1.3rem; margin-bottom: 16px; }
.sum-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-size: .95rem; }
.sum-row.muted { color: var(--ink-soft); font-size: .86rem; }
.sum-row.total { font-size: 1.15rem; }
.sum-row.total b { font-family:'Shippori Mincho',serif; font-size: 1.5rem; color: var(--tankan-deep); }
.sum-line { height: 2px; background: rgba(120,95,60,.18); margin: 14px 0; }
.sum-note { font-size: .78rem; color: var(--ink-soft); line-height: 1.7; margin: 12px 0 0; }
.btn.checkout { width: 100%; justify-content: center; margin-top: 16px; }
.keep-shopping { display: block; text-align: center; margin-top: 16px; font-size: .9rem; }

.cart-empty { text-align: center; padding: 60px 20px; background: var(--paper-white); border-radius: var(--radius-lg); box-shadow: var(--shadow-paper); }
.cart-empty .ce-mark { font-size: 3rem; }
.cart-empty h3 { font-family:'Shippori Mincho',serif; font-size: 1.5rem; margin: 10px 0 6px; }
.cart-empty p { color: var(--ink-soft); margin-bottom: 22px; }
