/* ===================================================================
   648.cafe 購入(カート)システム モックアップ 共通スタイルシート
   ※実装時の参考: ヘッダー/フッターは全ページ共通のため、
     PHP化の際は header.php / footer.php に分離してください。
   =================================================================== */

:root{
  --bg: #fbf9f6;
  --bg-card: #ffffff;
  --bg-section: #f4eee3;
  --text-dark: #2a201a;
  --text-body: #5e5347;
  --tan: #a9824f;
  --tan-dark: #8a6a3e;
  --header-bg: #2a1f18;
  --header-bg-active: #5b4530;
  --border: #e6ddcd;
  --danger: #b5483c;
  --radius: 8px;
}

*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }
body{
  background: var(--bg);
  color: var(--text-dark);
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
a{ color:inherit; text-decoration:none; }
img{ display:block; max-width:100%; }
button{ font-family: inherit; }

/* =================== Header（共通パーツ） =================== */
.site-header{
  background: var(--header-bg);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 48px;
  flex-wrap: wrap;
  gap: 16px;
  position: relative;
}
.site-header .brand img{ height: 38px; width:auto; }
.site-nav{
  display:flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items:center;
}
.site-nav a{
  color: #efe9e0;
  font-size: .88rem;
  padding: 10px 16px;
  border-radius: 4px;
  transition: background .15s ease;
}
.site-nav a:hover{ background: rgba(255,255,255,.08); }
.site-nav a.active{
  background: var(--header-bg-active);
  color:#fff;
  font-weight: 700;
}
.header-icons{
  display:flex;
  gap: 18px;
  align-items:center;
  margin-left: 8px;
}
.header-icons svg{
  width: 19px; height: 19px;
  stroke: #efe9e0;
  fill:none;
  stroke-width:1.7;
  cursor:pointer;
  transition: stroke .15s ease;
}
.header-icons svg:hover{ stroke: var(--tan); }
.nav-toggle{
  display:none;
  background:none;
  border:none;
  cursor:pointer;
}
.nav-toggle svg{ width:24px; height:24px; stroke:#efe9e0; fill:none; stroke-width:1.7; }

/* =================== Footer（共通パーツ） =================== */
.site-footer{
  background: var(--header-bg);
  color: #cfc4b3;
  padding: 48px 48px 28px;
  text-align:center;
  margin-top: 64px;
}
.site-footer .f-name{ color:#fff; font-size: 1.3rem; font-weight: 800; margin-bottom: 14px; }
.site-footer .f-info{ font-size: .82rem; line-height: 1.9; margin-bottom: 22px; }
.site-footer nav{ justify-content:center; margin-bottom: 22px; }
.site-footer .copyright{
  font-size: .72rem; opacity:.7;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 18px;
}

/* =================== 共通ボタン =================== */
.btn{
  display:inline-block;
  font-size: .88rem;
  padding: 13px 28px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-align:center;
  transition: background .15s ease, opacity .15s ease;
}
.btn-primary{ background: var(--tan); color:#fff; font-weight:700; }
.btn-primary:hover{ background: var(--tan-dark); }
.btn-outline{ background: transparent; color: var(--text-dark); border: 1px solid var(--border); }
.btn-outline:hover{ background: #f2ece1; }
.btn-block{ display:block; width:100%; }
.btn-lg{ padding: 16px 28px; font-size: .95rem; }

/* =================== ページ共通レイアウト =================== */
.page-head{
  max-width: 1300px;
  margin: 0 auto;
  padding: 40px 48px 0;
}
.breadcrumb{ font-size: .8rem; color: var(--text-body); margin-bottom: 6px; }
.page-head h1{ font-size: 1.7rem; font-weight: 800; margin: 0 0 6px; }
.page-head p.lead{ color: var(--text-body); font-size: .9rem; margin: 0 0 28px; }

.container{
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 48px 64px;
}
.container-narrow{
  max-width: 900px;
  margin: 0 auto;
  padding: 0 48px 64px;
}

/* =================== 商品一覧（index） =================== */
.product-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px 26px;
}
.product-card{
  cursor:pointer;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  transition: box-shadow .2s ease, transform .2s ease;
}
.product-card:hover{ box-shadow: 0 8px 20px rgba(42,32,24,.08); transform: translateY(-2px); }
.product-card .thumb{ width:100%; aspect-ratio: 1/1; border-radius: 6px; overflow:hidden; background: #f0eae0; }
.product-card .thumb img{ width:100%; height:100%; object-fit:cover; }
.product-card .name{ margin-top: 14px; font-size: .9rem; color: var(--text-dark); min-height: 2.7em; }
.product-card .price{ margin-top: 6px; font-size: 1rem; font-weight: 700; color: var(--tan); }

/* =================== 商品詳細（product） =================== */
.product-detail{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items:start;
}
.product-detail .main-image{
  border-radius: var(--radius);
  overflow:hidden;
  aspect-ratio: 1/1;
}
.product-detail .main-image img{ width:100%; height:100%; object-fit:cover; }
.product-detail h1{ font-size: 1.5rem; font-weight:800; margin: 0 0 14px; line-height:1.5; }
.product-detail .price{ font-size: 1.3rem; font-weight:800; color: var(--tan); margin-bottom: 2px; }
.product-detail .tax-note{ font-size: .78rem; color: var(--text-body); margin-bottom: 24px; }

.qty-stepper{
  display:inline-flex;
  align-items:center;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow:hidden;
  margin-bottom: 22px;
}
.qty-stepper button{
  width: 38px; height: 38px;
  background: #f4eee3;
  border:none;
  font-size: 1.1rem;
  cursor:pointer;
}
.qty-stepper input{
  width: 48px; height: 38px;
  border:none;
  text-align:center;
  font-size: .95rem;
  background: #fff;
}
.product-detail .actions{ display:flex; flex-direction:column; gap: 12px; max-width: 360px; margin-bottom: 28px; }
.product-detail .description{ font-size: .88rem; color: var(--text-body); line-height: 1.9; }
.product-detail .description h3{ font-size: 1rem; color: var(--text-dark); margin-bottom: 10px; }

.related-title{ font-size: 1.2rem; font-weight: 800; margin: 56px 0 20px; }

/* =================== カート（cart） =================== */
.cart-table{ width:100%; border-collapse: collapse; }
.cart-table th{
  text-align:left; font-size: .8rem; color: var(--text-body);
  border-bottom: 1px solid var(--border); padding: 0 0 14px;
}
.cart-row td{ padding: 22px 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cart-row .item-info{ display:flex; gap: 18px; align-items:center; }
.cart-row .item-info img{ width: 84px; height:84px; border-radius:6px; object-fit:cover; }
.cart-row .item-name{ font-size: .92rem; margin-bottom: 6px; }
.cart-row .item-unit{ font-size: .82rem; color: var(--text-body); }
.cart-row .qty-stepper{ margin: 0; }
.cart-row .remove-btn{ background:none; border:none; cursor:pointer; color: var(--text-body); margin-left: 14px; }
.cart-row .remove-btn:hover{ color: var(--danger); }
.cart-row .line-total{ font-weight: 700; text-align:right; }

.cart-summary{
  margin-top: 32px;
  display:flex;
  justify-content:flex-end;
}
.cart-summary .box{ width: 320px; }
.cart-summary .row{ display:flex; justify-content:space-between; font-size: .9rem; margin-bottom: 10px; color: var(--text-body); }
.cart-summary .total{ font-size: 1.2rem; font-weight:800; color: var(--text-dark); }
.cart-summary .note{ font-size: .76rem; color: var(--text-body); margin: 6px 0 18px; text-align:right; }

/* =================== 購入手続き（checkout） =================== */
.checkout-layout{
  display:grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items:start;
}
.checkout-form section{ margin-bottom: 36px; }
.checkout-form h2{ font-size: 1.05rem; font-weight: 800; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.field{ margin-bottom: 14px; }
.field label{ display:block; font-size: .8rem; color: var(--text-body); margin-bottom: 6px; }
.field input, .field select{
  width:100%; padding: 11px 12px; font-size: .9rem;
  border: 1px solid var(--border); border-radius: 6px; background:#fff; color: var(--text-dark);
}
.field-row{ display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.pay-options{ display:flex; flex-direction:column; gap: 12px; }
.pay-option{
  border: 1px solid var(--border); border-radius: 8px; padding: 16px;
}
.pay-option .pay-label{ display:flex; align-items:center; gap: 10px; font-size: .92rem; font-weight:700; cursor:pointer; }
.pay-option .pay-badge{
  font-size: .68rem; border: 1px solid var(--border); border-radius: 4px; padding: 2px 8px; color: var(--text-body);
}
.pay-option .pay-detail{ margin-top: 14px; display:none; }
.pay-option.is-open .pay-detail{ display:block; }
.pay-option .pay-note{ font-size: .8rem; color: var(--text-body); margin-top: 10px; }

.order-summary{
  background: var(--bg-section);
  border-radius: var(--radius);
  padding: 24px;
}
.order-summary .item{ display:flex; gap: 14px; margin-bottom: 18px; }
.order-summary .item img{ width: 64px; height:64px; border-radius:6px; object-fit:cover; }
.order-summary .item .name{ font-size: .85rem; margin-bottom: 4px; }
.order-summary .item .meta{ font-size: .78rem; color: var(--text-body); }
.order-summary hr{ border:none; border-top: 1px solid var(--border); margin: 18px 0; }
.order-summary .row{ display:flex; justify-content:space-between; font-size: .88rem; margin-bottom: 10px; color: var(--text-body); }
.order-summary .total{ font-size: 1.15rem; font-weight: 800; color: var(--text-dark); }

/* =================== 注文確認（confirm） =================== */
.confirm-block{ margin-bottom: 28px; }
.confirm-block h2{ font-size: .95rem; font-weight:800; margin: 0 0 12px; color: var(--tan-dark); }
.confirm-card{ background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; font-size: .88rem; color: var(--text-body); }
.confirm-card strong{ color: var(--text-dark); }
.confirm-edit{ font-size: .78rem; color: var(--tan-dark); }
.confirm-items .item-row{ display:flex; justify-content:space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.confirm-items .item-row:last-child{ border-bottom:none; }
.confirm-total{ display:flex; justify-content:space-between; font-size: 1.15rem; font-weight:800; margin-top: 16px; }
.confirm-actions{ display:flex; gap: 14px; margin-top: 32px; }

/* =================== 注文完了（complete） =================== */
.complete-box{ text-align:center; padding: 60px 0 30px; }
.complete-box .icon{
  width: 64px; height:64px; border-radius:50%;
  background: var(--tan); color:#fff;
  display:flex; align-items:center; justify-content:center;
  margin: 0 auto 22px; font-size: 1.8rem;
}
.complete-box h1{ font-size: 1.5rem; margin: 0 0 12px; }
.complete-box p{ color: var(--text-body); font-size: .92rem; margin: 0 auto 6px; max-width: 420px; }
.complete-box .order-no{ display:inline-block; margin: 18px 0 30px; padding: 10px 22px; background: var(--bg-section); border-radius: 6px; font-weight:700; }
.complete-actions{ display:flex; gap: 14px; justify-content:center; margin-top: 10px; }

/* =================== レスポンシブ =================== */
@media (max-width: 1000px){
  .product-grid{ grid-template-columns: repeat(3,1fr); }
  .product-detail{ grid-template-columns: 1fr; }
  .checkout-layout{ grid-template-columns: 1fr; }
}
@media (max-width: 760px){
  .site-header{ padding: 14px 20px; }
  .site-nav{
    display:none;
    position:absolute; top:100%; left:0; right:0;
    background: var(--header-bg);
    flex-direction:column; padding: 8px 16px 16px;
    z-index: 20;
  }
  .site-nav.is-open{ display:flex; }
  .nav-toggle{ display:block; }
  .page-head, .container, .container-narrow{ padding-left:20px; padding-right:20px; }
  .product-grid{ grid-template-columns: repeat(2,1fr); gap: 24px 14px; }
  .field-row{ grid-template-columns: 1fr; }
  .cart-row .item-info img{ width:64px; height:64px; }
}
@media (max-width: 420px){
  .product-grid{ grid-template-columns: 1fr; }
}
