/* ============================================================
   Nestlyvora — cart.css
   Slide-out bag, cart page, vertical progress-rail checkout,
   quick view, processing overlay. Loaded on every interactive page.
   ============================================================ */

/* ---- Slide-out bag ---- */
.nv-bag-ov { position: fixed; inset: 0; background: rgba(43, 39, 33, .5); z-index: 400; opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
.nv-bag-ov.nv-open { opacity: 1; visibility: visible; }
.nv-bag-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--bg); z-index: 410; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .34s cubic-bezier(.22, 1, .36, 1); box-shadow: var(--shadow-lg); }
.nv-bag-panel.nv-open { transform: translateX(0); }
.nv-bag-panel__head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem var(--space-md); border-bottom: 1px solid var(--border-light); }
.nv-bag-panel__head h2 { font-size: 1.2rem; }
.nv-bag-panel__close { width: 44px; height: 44px; border: 0; background: transparent; font-size: 1.2rem; color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.nv-bag-panel__body { flex: 1; overflow-y: auto; padding: var(--space-md); }
.nv-bag-panel__foot { padding: var(--space-md); border-top: 1px solid var(--border-light); background: var(--surface); }

.nv-bag-empty { text-align: center; padding: var(--space-xl) 0; color: var(--text-muted); }
.nv-bag-empty .nv-ico { font-size: 2.4rem; color: var(--text-soft); display: block; margin: 0 auto .6rem; }

.nv-line { display: grid; grid-template-columns: 76px 1fr; gap: .8rem; padding: .9rem 0; border-bottom: 1px solid var(--border-light); }
.nv-line__img { width: 76px; height: 76px; object-fit: cover; border-radius: var(--r); border: 1px solid var(--border-light); }
.nv-line__name { font-family: var(--head); font-size: .92rem; line-height: 1.4; }
.nv-line__opt { font-size: .74rem; color: var(--text-muted); margin-top: .2rem; }
.nv-line__price { font-size: .9rem; font-weight: 700; font-family: var(--latin); margin-top: .3rem; }
.nv-line__foot { display: flex; align-items: center; justify-content: space-between; margin-top: .5rem; }
.nv-qtymini { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.nv-qtymini button { width: 40px; height: 44px; border: 0; background: var(--surface); font-size: 1rem; color: var(--text); cursor: pointer; }
.nv-qtymini input { width: 42px; height: 44px; text-align: center; border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border); font-family: var(--body); font-size: .84rem; }
.nv-qtymini input:focus { outline: none; }
.nv-line__rm { background: transparent; border: 0; color: var(--text-soft); font-size: .76rem; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; padding: .4rem; }
.nv-line__rm:hover { color: #b0583f; }
.nv-bag-sub { display: flex; align-items: center; justify-content: space-between; margin: .8rem 0; font-size: .95rem; }
.nv-bag-sub strong { font-family: var(--latin); font-size: 1.2rem; }

/* ---- Free-ship progress bar ---- */
.nv-ship { margin: .7rem 0; }
.nv-ship__track { height: 7px; border-radius: 999px; background: var(--border-light); overflow: hidden; }
.nv-ship__fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--sage), var(--accent)); border-radius: 999px; transition: width .4s; }
.nv-ship__label { font-size: .76rem; color: var(--text-muted); margin-top: .4rem; }
.nv-ship__label strong { color: var(--accent-deep); }

/* ---- Cart page ---- */
.nv-cartpage { display: grid; grid-template-columns: 1.55fr .95fr; gap: var(--space-xl); align-items: start; }
.nv-itembox { margin-bottom: var(--space-lg); }
.nv-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 1.5rem; position: sticky; top: calc(var(--nav-h) + 1rem); }
.nv-summary h2 { font-size: 1.15rem; margin-bottom: 1rem; }
.nv-sum-row { display: flex; justify-content: space-between; gap: 1rem; font-size: .88rem; padding: .45rem 0; color: var(--text-muted); }
.nv-sum-row--disc { color: #4f7a4a; }
.nv-sum-row--total { font-weight: 700; font-size: 1.1rem; color: var(--text); border-top: 2px solid var(--border); margin-top: .5rem; padding-top: .8rem; }
.nv-sum-row--total span:last-child { font-family: var(--latin); }
.nv-sum-note { font-size: .74rem; color: var(--text-soft); line-height: 1.6; margin-top: .6rem; }
.nv-sum-note code { font-family: var(--latin); letter-spacing: .05em; color: var(--accent-deep); }

.nv-promo { margin: var(--space-md) 0; padding: var(--space-md) 0; border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); }
.nv-promo__label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .5rem; }
.nv-promo__row { display: flex; gap: .5rem; }
.nv-promo__row input { flex: 1; min-height: 44px; padding: .6rem .8rem; border: 1px solid var(--border); border-radius: var(--r); font-family: var(--body); font-size: .86rem; background: var(--surface); text-transform: uppercase; }
.nv-promo__applied { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: .6rem; font-size: .82rem; color: #4f7a4a; background: var(--surface-2); padding: .5rem .7rem; border-radius: var(--r); }
.nv-promo__applied button { background: transparent; border: 0; color: var(--text-soft); font-size: .76rem; text-decoration: underline; cursor: pointer; }
.nv-promo__msg { font-size: .78rem; margin-top: .5rem; min-height: 1em; }
.nv-promo__msg.nv-bad { color: #b0583f; }
.nv-promo__msg.nv-ok { color: #4f7a4a; }

/* ---- Vertical progress-rail checkout ---- */
.nv-checkout { margin-top: var(--space-lg); }
.nv-co { display: grid; grid-template-columns: 180px 1fr; gap: var(--space-lg); align-items: start; }
.nv-rail { position: sticky; top: calc(var(--nav-h) + 1rem); display: flex; flex-direction: column; gap: 0; }
.nv-rail__step { display: flex; align-items: center; gap: .7rem; background: transparent; border: 0; text-align: left; font-family: var(--body); cursor: pointer; padding: .5rem 0; position: relative; color: var(--text-soft); }
.nv-rail__step:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 36px; bottom: -6px; width: 2px; background: var(--border); }
.nv-rail__step.nv-done:not(:last-child)::before { background: var(--accent); }
.nv-rail__n { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-family: var(--latin); font-weight: 700; font-size: .95rem; background: var(--bg); color: var(--text-soft); z-index: 1; }
.nv-rail__label { font-size: .86rem; font-weight: 600; }
.nv-rail__step.nv-active { color: var(--text); }
.nv-rail__step.nv-active .nv-rail__n { border-color: var(--accent); background: var(--accent); color: #fff; }
.nv-rail__step.nv-done .nv-rail__n { border-color: var(--accent); background: var(--accent); color: #fff; }

.nv-copanel { display: none; }
.nv-copanel.nv-active { display: block; animation: nvFade .3s ease; }
@keyframes nvFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.nv-copanel__title { font-size: 1.2rem; margin-bottom: var(--space-md); }
.nv-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.nv-copanel__nav { display: flex; justify-content: space-between; gap: .6rem; margin-top: var(--space-md); }

/* checkout fields reuse .nv-field from style.css */
.nv-span { grid-column: 1 / -1; }

/* ---- Payment methods ---- */
.nv-pays { display: flex; flex-direction: column; gap: .6rem; }
.nv-pay { display: flex; align-items: center; gap: .7rem; border: 1px solid var(--border); border-radius: var(--r); padding: .9rem 1rem; cursor: pointer; transition: border-color .2s, background .2s; flex-wrap: wrap; }
.nv-pay:hover { border-color: var(--accent); }
.nv-pay.nv-sel { border-color: var(--accent); background: var(--surface-2); }
.nv-pay input[type="radio"] { width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0; flex: none; accent-color: var(--accent); }
.nv-pay__label { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; font-weight: 600; }
.nv-pay__label .nv-ico { color: var(--accent); font-size: 1.2rem; }
.nv-pay__meta { font-size: .74rem; color: var(--text-muted); margin-left: auto; }
.nv-pay__chips { margin-left: auto; display: inline-flex; gap: .3rem; flex-wrap: wrap; }
.nv-pay__chips .nv-chip { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); }

.nv-cardfields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); margin-top: var(--space-md); padding: var(--space-md); border: 1px dashed var(--border); border-radius: var(--r); }
.nv-cardnum { position: relative; }
.nv-cardnum input { width: 100%; }
.nv-cardbrand { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); font-family: var(--latin); font-size: .72rem; font-weight: 700; letter-spacing: .05em; color: var(--accent-deep); }
.nv-card-note { grid-column: 1 / -1; font-size: .74rem; color: var(--text-soft); line-height: 1.6; }

.nv-gift { display: flex; align-items: flex-start; gap: .6rem; margin-top: var(--space-md); padding: 1rem; border: 1px solid var(--border-light); border-radius: var(--r); background: var(--surface-2); }
.nv-gift input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; padding: 0; margin-top: .3rem; flex: none; accent-color: var(--accent); }
.nv-gift label { font-size: .84rem; color: var(--text-muted); line-height: 1.6; cursor: pointer; }
.nv-gift label strong { color: var(--text); display: inline-flex; align-items: center; gap: .35rem; }

.nv-paynote { font-size: .78rem; color: var(--text-soft); line-height: 1.7; margin-top: var(--space-md); padding: .8rem 1rem; background: var(--surface-2); border-radius: var(--r); border-left: 3px solid var(--accent); }
.nv-agree { font-size: .82rem; color: var(--text-muted); margin-top: var(--space-md); }
.nv-agree a { color: var(--accent-deep); text-decoration: underline; }

/* ---- Confirm (最終確認) ---- */
.nv-cf-sec { margin-bottom: var(--space-md); padding-bottom: var(--space-md); border-bottom: 1px solid var(--border-light); }
.nv-cf-sec h3 { font-size: .95rem; margin-bottom: .6rem; color: var(--accent-deep); }
.nv-cf-sec p { font-size: .86rem; color: var(--text-muted); line-height: 1.8; }
.nv-cf-row { display: flex; justify-content: space-between; gap: 1rem; font-size: .86rem; padding: .35rem 0; }
.nv-cf-row--disc { color: #4f7a4a; }
.nv-cf-row--total { font-weight: 700; font-size: 1.1rem; border-top: 2px solid var(--border); margin-top: .4rem; padding-top: .7rem; }
.nv-cf-hint { font-size: .8rem !important; color: var(--accent-deep) !important; margin-top: .4rem; }
.nv-cf-rule { font-size: .8rem !important; }

/* ---- Processing overlay ---- */
.nv-proc { position: fixed; inset: 0; z-index: 450; background: rgba(43, 39, 33, .55); display: none; align-items: center; justify-content: center; }
.nv-proc.nv-open { display: flex; }
.nv-proc__card { background: var(--bg); border-radius: var(--r-lg); padding: 2.2rem 2.6rem; text-align: center; box-shadow: var(--shadow-lg); }
.nv-proc__card p { margin-top: 1rem; font-weight: 600; }
.nv-proc__sub { font-size: .78rem !important; font-weight: 400 !important; color: var(--text-muted); }
.nv-spinner { width: 44px; height: 44px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; margin: 0 auto; animation: nvSpin .8s linear infinite; }
@keyframes nvSpin { to { transform: rotate(360deg); } }

/* ---- Quick view ---- */
.nv-quick { position: fixed; inset: 0; z-index: 440; visibility: hidden; }
.nv-quick.nv-open { visibility: visible; }
.nv-quick__scrim { position: absolute; inset: 0; background: rgba(43, 39, 33, .55); opacity: 0; transition: opacity .25s; }
.nv-quick.nv-open .nv-quick__scrim { opacity: 1; }
.nv-quick__dialog { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -48%); width: min(760px, 94vw); max-height: 90vh; overflow: auto; background: var(--bg); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); display: grid; grid-template-columns: 1fr 1fr; opacity: 0; transition: opacity .25s, transform .25s; }
.nv-quick.nv-open .nv-quick__dialog { opacity: 1; transform: translate(-50%, -50%); }
.nv-quick__close { position: absolute; top: .6rem; right: .6rem; z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255, 253, 249, .9); font-size: 1.1rem; color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.nv-quick__media { background: var(--surface-2); }
.nv-quick__media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1 / 1; }
.nv-quick__body { padding: 1.6rem; }
.nv-quick__cat { font-family: var(--latin); font-size: .9rem; letter-spacing: .08em; text-transform: uppercase; color: var(--sage-deep); }
.nv-quick__name { font-size: 1.35rem; margin: .3rem 0 .4rem; }
.nv-quick__price { font-size: 1.3rem; font-weight: 700; font-family: var(--latin); margin-bottom: .5rem; }
.nv-quick__price small { font-size: .7rem; color: var(--text-muted); font-family: var(--body); font-weight: 400; }
.nv-quick__desc { font-size: .85rem; color: var(--text-muted); line-height: 1.8; margin: .6rem 0; }
.nv-quick__actions { display: flex; gap: .6rem; align-items: center; margin-top: var(--space-md); }
.nv-quick__wish { width: 48px; height: 48px; flex: none; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 1.15rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.nv-quick__wish.nv-sel { color: #b0583f; border-color: var(--accent); }
.nv-quick__link { display: inline-block; margin-top: var(--space-md); font-size: .82rem; color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 860px) {
  .nv-cartpage { grid-template-columns: 1fr; gap: var(--space-lg); }
  .nv-summary { position: static; }
  .nv-co { grid-template-columns: 1fr; }
  .nv-rail { position: static; flex-direction: row; overflow-x: auto; gap: .4rem; border-bottom: 1px solid var(--border-light); padding-bottom: var(--space-sm); margin-bottom: var(--space-md); }
  .nv-rail__step { flex-direction: column; gap: .3rem; flex: 1; min-width: 90px; }
  .nv-rail__step::before { display: none !important; }
  .nv-rail__label { font-size: .74rem; }
  .nv-quick__dialog { grid-template-columns: 1fr; }
  .nv-quick__media img { aspect-ratio: 16 / 10; }
}
@media (max-width: 560px) {
  .nv-cardfields { grid-template-columns: 1fr; }
  .nv-form-row { grid-template-columns: 1fr; }
}
