/* Original working Marine Sweeper shop interface, adapted for Sado Suigun. */
#shop,.pdialog,.cart,.cart-fab{--ink:#082b3c;--slate:#596c72;--fog:#d7e0e0;--paper:#fff;--stone:#fff;--tide:#157586;--mist:#dcecef;--num:Arial,sans-serif;--serif:"Yu Mincho","Hiragino Mincho ProN",serif;}
.storefront{background:#fff;border:1px solid #dce2e2;padding:28px;}
#shop .shop-toolbar{top:0;}
#shop .shop-count{margin-top:22px;}
#shop .pcard{min-width:0;}
#shop .pcard-btn{color:#082b3c;text-decoration:none;}
#shop .pcard-name{font-size:0.93rem;}
#shop .pcard-img{border-radius:2px;}
#shop .shop-cats .chip{border-radius:0;}
#shop button:focus-visible,.pdialog button:focus-visible,.cart button:focus-visible{outline:2px solid #157586;outline-offset:2px;}
.pdialog,.cart{z-index:100;}
.cart-fab{z-index:90;}
.pdialog .btn,.cart .btn{display:block;background:#082b3c;color:white;padding:15px 22px;border:none;font-size:0.9rem;text-decoration:none;}
@media(max-width:680px){.storefront{padding:14px;}#shop .shop-toolbar{position:relative;top:auto;}#shop .shop-controls{flex-wrap:wrap;gap:12px;}#shop .pgrid{gap:24px 10px;}}
/* ======== ネットショップ ======== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.page-shop .shop-intro { margin-bottom: 48px; }

/* 絞り込み・並べ替え */
.shop-toolbar { position: sticky; top: 72px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding: 14px 0; background: var(--stone); border-bottom: 1px solid var(--fog); }
.shop-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: 0.88rem; letter-spacing: 0.06em; display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border: 1px solid var(--fog); background: var(--paper); color: var(--ink); cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.chip span { font-family: var(--num); font-weight: 300; color: var(--slate); }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip[aria-pressed="true"] span { color: var(--mist); }
.shop-controls { display: flex; align-items: center; gap: 20px; font-size: 0.86rem; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }
.select select { font: inherit; font-size: 0.86rem; padding: 8px 34px 8px 12px; border: 1px solid var(--fog); background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23172423'/%3E%3C/svg%3E") right 12px center no-repeat; appearance: none; color: var(--ink); cursor: pointer; }
.shop-count { margin: 20px 0 16px; font-size: 0.82rem; color: var(--slate); }

/* 商品カード */
.pgrid { list-style: none; margin: 0; padding: 0; display: grid; gap: 36px 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 28px; } }
@media (min-width: 1100px) { .pgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pcard-btn { all: unset; box-sizing: border-box; display: flex; flex-direction: column; width: 100%; height: 100%; cursor: pointer; }
.pcard-btn:focus-visible { outline: 2px solid var(--tide); outline-offset: 4px; }
.pcard-img { position: relative; display: block; aspect-ratio: 1 / 1; background: #fff; border: 1px solid var(--fog); overflow: hidden; }
.pcard-img img { width: 100%; height: 100%; object-fit: contain; padding: 6%; transition: transform .5s cubic-bezier(.2,.6,.2,1); }
.pcard-btn:hover .pcard-img img { transform: scale(1.04); }
.pcard.is-out .pcard-img img { opacity: .45; filter: grayscale(.5); }
.badge { position: absolute; top: 10px; left: 10px; font-size: 0.72rem; letter-spacing: 0.1em; padding: 3px 10px; }
.badge-out { background: var(--ink); color: #fff; }
.badge-sale { background: #fff; color: var(--tide); border: 1px solid var(--tide); font-family: var(--num); }
.pcard-body { display: flex; flex-direction: column; gap: 4px; padding-top: 14px; flex: 1; }
.pcard-top { display: flex; gap: 10px; font-size: 0.72rem; letter-spacing: 0.1em; color: var(--slate); }
.pcard-no { font-family: var(--num); }
.pcard-name { font-weight: 500; line-height: 1.6; font-size: 0.95rem; }
.pcard-btn:hover .pcard-name { text-decoration: underline; text-underline-offset: 0.25em; }
.pcard-opt { font-size: 0.78rem; color: var(--slate); }
.pcard-price { margin-top: auto; padding-top: 6px; display: flex; align-items: baseline; gap: 10px; }
.pcard-price b, .pd-price b, .cart-sub b { font-family: var(--num); font-weight: 400; font-size: 1.2rem; letter-spacing: 0.02em; }
.pcard-price small { font-size: 0.8rem; margin-left: 2px; }
.pcard-price s, .pd-price s { font-family: var(--num); color: var(--slate); font-size: 0.88rem; }
.shop-empty { grid-column: 1 / -1; padding: 48px 0; color: var(--slate); }
.shop-empty .text-link { font: inherit; background: none; border: 0; border-bottom: 1px solid currentColor; cursor: pointer; margin-left: 8px; color: var(--ink); }
/* 読み込み中 */
.is-skeleton .pcard-img { background: linear-gradient(90deg, #e7e8e4 25%, #f1f2ef 50%, #e7e8e4 75%) 0 0 / 200% 100%; animation: sk 1.4s ease infinite; border: 0; }
.sk { display: block; height: 12px; margin-top: 12px; background: #e3e5e1; }
.sk-1 { width: 80%; } .sk-2 { width: 40%; }
@keyframes sk { to { background-position: -200% 0; } }

/* 商品の詳細 */
.pdialog, .cart { border: 0; padding: 0; background: var(--paper); color: var(--ink); max-height: 100dvh; }
.pdialog::backdrop, .cart::backdrop { background: rgba(10,18,18,.55); backdrop-filter: blur(2px); }
.pdialog { width: min(1040px, 100vw - 32px); max-height: calc(100dvh - 48px); overflow: auto; }
.pd { position: relative; display: grid; gap: 32px; padding: 28px; }
@media (min-width: 820px) { .pd { grid-template-columns: 1.05fr 1fr; gap: 44px; padding: 40px; } }
.pd-close { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; font-size: 1.5rem; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--ink); z-index: 2; }
.pd-main { aspect-ratio: 1 / 1; background: #fff; border: 1px solid var(--fog); }
.pd-main img { width: 100%; height: 100%; object-fit: contain; padding: 4%; }
.pd-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pd-thumbs button { width: 60px; height: 60px; padding: 0; background: #fff; border: 1px solid var(--fog); cursor: pointer; }
.pd-thumbs button[aria-current="true"] { border-color: var(--ink); outline: 1px solid var(--ink); }
.pd-thumbs img { width: 100%; height: 100%; object-fit: contain; }
.pd-meta { margin: 0 0 6px; font-size: 0.78rem; letter-spacing: 0.1em; color: var(--slate); font-family: var(--num); }
.pd-title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.3rem, 2.4vw, 1.7rem); letter-spacing: 0.06em; margin: 0 0 12px; padding-right: 32px; }
.pd-price { display: flex; align-items: baseline; gap: 12px; margin: 0 0 24px; }
.pd-price b { font-size: 1.7rem; }
.pd-price small { font-size: 0.78rem; color: var(--slate); }
.pd-opt { border: 0; margin: 0 0 20px; padding: 0; min-width: 0; }
.pd-opt legend { font-size: 0.82rem; letter-spacing: 0.08em; color: var(--slate); margin-bottom: 10px; padding: 0; }
.pd-opt legend span { color: var(--ink); margin-left: 12px; }
.pd-vals { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-val { font: inherit; font-size: 0.86rem; padding: 8px 14px; min-width: 52px; border: 1px solid var(--fog); background: #fff; color: var(--ink); cursor: pointer; transition: border-color .15s; }
.pd-val:hover { border-color: var(--ink); }
.pd-val[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pd-val.is-na { color: #9aa29f; background: repeating-linear-gradient(135deg, #fff 0 6px, #f2f3f0 6px 7px); }
.pd-status { margin: 4px 0 16px; font-size: 0.86rem; color: var(--tide); }
.pd-status.is-out { color: #a03c32; }
.pd-buy { display: flex; gap: 12px; align-items: stretch; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--fog); background: #fff; }
.qty button { width: 44px; height: 100%; min-height: 50px; border: 0; background: none; font-size: 1.1rem; cursor: pointer; color: var(--ink); }
.qty button:disabled { color: var(--fog); cursor: default; }
.qty span { min-width: 2.2em; text-align: center; font-family: var(--num); }
.pd-add { flex: 1; text-align: center; font: inherit; letter-spacing: 0.12em; cursor: pointer; }
.pd-add:disabled { background: var(--fog); border-color: var(--fog); color: var(--slate); cursor: default; }
.pd-desc { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--fog); font-size: 0.9rem; color: var(--ink); }
.pd-desc img { max-width: 100%; height: auto; }
.pd-desc p { margin: 0 0 1em; }
.pd-link { font-size: 0.84rem; margin-top: 16px; }
@media (max-width: 819px) {
  .pdialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; }
  .pd { padding: 20px 16px 120px; }
  .pd-buy { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--fog); z-index: 3; }
}

/* かご */
.cart { margin: 0 0 0 auto; width: min(440px, 100vw); height: 100dvh; max-height: 100dvh; }
.cart[open] { animation: slidein .35s cubic-bezier(.2,.6,.2,1); }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.cart-in { display: flex; flex-direction: column; height: 100%; padding: 24px; }
.cart.is-busy .cart-in { opacity: .6; pointer-events: none; }
.cart-head { position: relative; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--fog); padding-bottom: 14px; }
.cart-head h2 { font-family: var(--serif); font-weight: 500; font-size: 1.25rem; margin: 0; }
.cart-head .pd-close { position: static; }
.cart-msg { margin: 14px 0 0; padding: 10px 14px; background: #e3efed; color: var(--tide); font-size: 0.86rem; }
.cart-lines { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; }
.cart-line { display: grid; grid-template-columns: 72px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--fog); }
.cl-img { width: 72px; height: 72px; background: #fff; border: 1px solid var(--fog); }
.cl-img img { width: 100%; height: 100%; object-fit: contain; }
.cl-body { display: flex; flex-direction: column; gap: 4px; font-size: 0.88rem; }
.cl-name { font-weight: 500; line-height: 1.5; }
.cl-var { color: var(--slate); font-size: 0.8rem; }
.cl-row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.cl-price { font-family: var(--num); font-size: 1rem; }
.qty-s button { width: 34px; min-height: 34px; }
.cl-remove { align-self: flex-start; font: inherit; font-size: 0.76rem; color: var(--slate); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.cart-foot { border-top: 1px solid var(--ink); padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.cart-sub { display: flex; justify-content: space-between; align-items: baseline; margin: 0; }
.cart-foot .note { margin: 0; }
.cart-checkout { text-align: center; }
.cart-foot .text-link, .cart-in > .text-link { align-self: center; font: inherit; font-size: 0.86rem; background: none; border: 0; border-bottom: 1px solid currentColor; cursor: pointer; color: var(--ink); padding: 0 0 2px; }
.cart-empty { color: var(--slate); margin: 32px 0 16px; }

/* かごボタン（画面右下） */
.cart-fab { position: fixed; right: 20px; bottom: 20px; z-index: 20; display: inline-flex; align-items: center; gap: 10px; font: inherit; font-size: 0.88rem; letter-spacing: 0.08em; padding: 14px 20px; background: var(--ink); color: #fff; border: 0; cursor: pointer; box-shadow: 0 6px 24px rgba(10,18,18,.25); }
.cart-fab span { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: #fff; color: var(--ink); font-family: var(--num); font-size: 0.85rem; }
.cart-fab[hidden] { display: none; }

