/* ショップページのカート。fablee.css のあとに読む。
   読み手は釣りのお客様。年配の方も多いので、文字と押すところを大きくとる。 */

:root{
  --cart-w: 420px;

  /* ★ 海の青と浮きの橙は fablee.css では body.sea（釣り船LP）の中で定義されていて、
     ショップページには降りてこない。このファイルは shop / checkout でしか
     読まないので、ここで同じ値を用意する。
     入れ忘れると、ボタンが「背景なしの白文字」になって見えなくなる。 */
  --sea:#0E5A7D;
  --sun:#DC7B33;
}

/* ---- 商品カードの中の「買う」部分 ---- */
.buy{
  display:flex; flex-wrap:wrap; gap:.6rem .7rem; align-items:flex-end;
  margin-top:1rem; padding-top:1rem; border-top:1px solid var(--line);
}
.buy label{
  display:flex; flex-direction:column; gap:.25rem;
  font-size:.82rem; color:var(--muted); letter-spacing:.02em;
}
.buy label.wide{flex:1 1 100%}
.buy select, .buy input[type=text]{
  font:inherit; font-size:1rem; padding:.55rem .6rem; min-height:44px;
  border:1px solid var(--line); border-radius:8px; background:#fff; color:inherit;
}
.buy select{min-width:6.5rem}
.buy input[type=text]{width:100%}
.buy .add{
  flex:1 1 auto; min-height:48px; padding:.6rem 1.2rem;
  font-size:1rem; font-weight:700; letter-spacing:.04em;
  border:0; border-radius:999px; cursor:pointer;
  background:var(--sea); color:#fff;
}
.buy .add:hover{filter:brightness(1.08)}
.buy .add:disabled{background:#B9C4CA; cursor:default}
.buy .add.done{background:var(--sun)}

/* ---- ヘッダーのカートボタン ---- */
.cartbtn{
  position:relative; display:inline-flex; align-items:center; gap:.4rem;
  padding:.45rem .9rem; border-radius:999px; border:1px solid var(--line);
  background:#fff; color:inherit; text-decoration:none;
  font-size:.92rem; font-weight:700; cursor:pointer; min-height:40px;
}
.cartbtn .n{
  display:inline-grid; place-items:center; min-width:1.5rem; height:1.5rem;
  padding:0 .35rem; border-radius:999px;
  background:var(--sun); color:#fff; font-size:.8rem; font-variant-numeric:tabular-nums;
}
.cartbtn[hidden]{display:none}

/* ---- カートの引き出し ---- */
.cartveil{
  position:fixed; inset:0; background:rgba(14,36,49,.45);
  opacity:0; pointer-events:none; transition:opacity .2s; z-index:80;
}
.cartveil.on{opacity:1; pointer-events:auto}

.cart{
  position:fixed; top:0; right:0; bottom:0; width:min(var(--cart-w), 100vw);
  background:var(--bg, #fff); z-index:81; display:flex; flex-direction:column;
  transform:translateX(100%); transition:transform .24s ease;
  box-shadow:-8px 0 30px rgba(14,36,49,.18);
}
.cart.on{transform:none}
.cart header{
  display:flex; align-items:center; justify-content:space-between;
  padding:1rem 1.1rem; border-bottom:1px solid var(--line); flex:0 0 auto;
}
.cart header b{font-size:1.05rem; letter-spacing:.04em}
.cart .close{
  border:0; background:none; font-size:1.7rem; line-height:1; cursor:pointer;
  color:var(--muted); padding:.2rem .5rem; min-height:44px; min-width:44px;
}
.cart .body{flex:1 1 auto; overflow-y:auto; padding:.6rem 1.1rem}
.cart .foot{flex:0 0 auto; padding:1rem 1.1rem; border-top:1px solid var(--line)}

.cart .line{display:flex; gap:.8rem; padding:.9rem 0; border-bottom:1px solid var(--line)}
.cart .line:last-child{border-bottom:0}
.cart .line img{width:64px; height:64px; object-fit:cover; border-radius:8px; flex:0 0 auto; background:#eee}
.cart .line .in{flex:1 1 auto; min-width:0}
.cart .line h4{margin:0 0 .15rem; font-size:.95rem; font-weight:700; line-height:1.45}
.cart .line .v{margin:0 0 .4rem; font-size:.82rem; color:var(--muted)}
.cart .line .row{display:flex; align-items:center; justify-content:space-between; gap:.6rem}
.cart .qty{display:inline-flex; align-items:center; border:1px solid var(--line); border-radius:8px; overflow:hidden}
.cart .qty button{
  width:38px; height:38px; border:0; background:#fff; cursor:pointer;
  font-size:1.15rem; line-height:1; color:inherit;
}
.cart .qty button:hover{background:var(--sunk)}
.cart .qty span{min-width:2.2rem; text-align:center; font-variant-numeric:tabular-nums; font-weight:700}
.cart .line .p{font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap}
.cart .del{border:0; background:none; color:var(--muted); font-size:.82rem;
           cursor:pointer; text-decoration:underline; padding:.3rem 0}

.cart .tot{display:flex; justify-content:space-between; margin-bottom:.3rem; font-size:.95rem}
.cart .tot.big{font-size:1.15rem; font-weight:700; margin:.6rem 0 .2rem}
.cart .tot .v{font-variant-numeric:tabular-nums}
.cart .shipnote{font-size:.8rem; color:var(--muted); line-height:1.6; margin:.4rem 0 .9rem}
.cart .go{
  display:block; width:100%; min-height:54px; border:0; border-radius:999px;
  background:var(--sun); color:#fff; font-size:1.05rem; font-weight:700;
  letter-spacing:.06em; cursor:pointer; text-align:center; line-height:54px;
  text-decoration:none;
}
.cart .go:hover{filter:brightness(1.06)}
.cart .empty{padding:3rem 1rem; text-align:center; color:var(--muted); line-height:1.9}

/* 画面の下に出る「カートに入れました」 */
.toast{
  position:fixed; left:50%; bottom:1.4rem; transform:translate(-50%, 1.2rem);
  background:var(--ink); color:#fff; padding:.8rem 1.4rem; border-radius:999px;
  font-size:.95rem; font-weight:700; z-index:90; opacity:0; pointer-events:none;
  transition:opacity .2s, transform .2s;
}
.toast.on{opacity:1; transform:translate(-50%, 0)}

@media (max-width:560px){
  .buy .add{flex-basis:100%}
  .cart .go{font-size:1rem}
}
