/* ===== سبد خرید — فقط فرانت ===== */
.linkbtn{background:none;border:0;color:var(--muted);font-family:inherit;font-size:14px;cursor:pointer;text-decoration:underline}
.linkbtn:hover{color:#ff4d5a}
.btn.ghost{background:linear-gradient(180deg,#1f1f25,#0a0a0d);border:1px solid #3a3a42;box-shadow:inset 0 1px 0 rgba(255,255,255,.08);text-shadow:none}
.btn.ghost:hover{border-color:var(--red-hi);box-shadow:0 0 14px rgba(255,31,46,.6)}
.btn.block{display:flex;width:100%}
/* مراحل */
.cx-steps{list-style:none;margin:18px 0 6px;padding:0;display:grid;grid-template-columns:repeat(4,1fr)}
.cx-steps li{position:relative;display:flex;flex-direction:column;align-items:center;gap:8px;font-size:13px;color:var(--muted);text-align:center}
.cx-steps li:not(:last-child):before{content:"";position:absolute;top:17px;right:calc(50% + 24px);left:calc(-50% + 24px);height:2px;background:#2a2a31;transform:scaleX(-1)}
.cx-steps i{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;font-style:normal;font-weight:800;background:#101014;border:2px solid #34343c}
.cx-steps li.on{color:#fff;font-weight:700}
.cx-steps li.on i{background:linear-gradient(180deg,#ff5460 0%,#e3182a 48%,#b50e1a 52%,#d41624 100%);border-color:#ff7a84;box-shadow:0 0 14px rgba(255,31,46,.75)}
/* چیدمان */
.cx{display:grid;grid-template-columns:minmax(0,1fr) 370px;gap:22px;align-items:start;padding-top:20px}
.cx-main{display:flex;flex-direction:column;gap:14px;min-width:0}
.cx-free{padding:14px 18px;border-radius:14px;border:1px solid #31313a;background:linear-gradient(180deg,#17171c,#09090c)}
.cx-free p{margin:0 0 10px;font-size:14px}
.cx-free b{color:#ff6571}
.cx-free.done{border-color:rgba(38,180,95,.6)}
.cx-free.done p{color:#3ddc84;font-weight:700}
.cx-bar{height:8px;border-radius:4px;background:#22222a;overflow:hidden}
.cx-bar i{display:block;height:100%;width:var(--w,0%);max-width:100%;border-radius:4px;background:linear-gradient(90deg,#ff5460,#b50e1a);box-shadow:0 0 10px rgba(255,31,46,.8);transition:width .8s ease}
.cx-free.done .cx-bar i{background:linear-gradient(90deg,#3ddc84,#13863f);box-shadow:0 0 10px rgba(38,180,95,.7)}
.cx-warn{padding:12px 16px;border-radius:12px;border:1px solid #6a4a1a;background:#2a1a0a;color:#ffc27a;font-size:14px;line-height:1.9}
.cx-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
.cx-item{position:relative;display:grid;grid-template-columns:110px minmax(0,1fr) auto 150px 42px;gap:16px;align-items:center;padding:14px;border-radius:16px;border:1px solid #31313a;background:linear-gradient(180deg,#17171c,#09090c);transition:opacity .2s,border-color .2s}
.cx-item:hover{border-color:#4a4a54}
.cx-item.off{opacity:.65}
.cx-item.busy{opacity:.5;pointer-events:none}
.cx-img{display:block;height:90px;border-radius:12px;background:#ececee;overflow:hidden}
.cx-img img{width:100%;height:100%;object-fit:contain}
.cx-info{min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:4px}
.cx-title{font-weight:700;line-height:1.7}
.cx-title:hover{color:#ff6571}
.cx-meta{font-size:12px;color:var(--muted)}
.cx-na{font-size:12px;font-weight:700;color:#ff7a84}
.cx-unit{margin-top:4px;font-size:14px}
.cx-unit s{color:#8a8a92;margin-inline-end:6px}
.cx-unit small{color:var(--muted)}
.cx-qty{display:flex;align-items:center;border-radius:12px;border:1px solid #34343c;background:#000;overflow:hidden}
.cx-qty button{width:38px;height:42px;border:0;background:none;color:#fff;font-size:20px;cursor:pointer}
.cx-qty button:hover:not(:disabled){color:var(--red-hi);background:rgba(255,31,46,.08)}
.cx-qty button:disabled{opacity:.3;cursor:not-allowed}
.cx-qty output{min-width:36px;text-align:center;font-weight:700}
.cx-total{font-weight:800;font-size:17px;color:#ff2230;text-align:left;text-shadow:0 0 12px rgba(255,31,46,.4)}
.cx-total small{font-size:12px;font-weight:600}
.cx-del button{width:42px;height:42px;border-radius:12px;border:1px solid #34343c;background:#000;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s}
.cx-del svg{width:20px;height:20px;fill:none;stroke:#e4e4ea;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.cx-del button:hover{border-color:var(--red-hi);box-shadow:0 0 12px rgba(255,31,46,.6)}
.cx-back{align-self:flex-start;color:var(--muted);font-size:14px}
.cx-back:hover{color:#ff6571}
/* خلاصه */
.cx-sum{position:sticky;top:16px;padding:22px;border:1px solid var(--red-hi);border-radius:18px;background:linear-gradient(180deg,#16161a,#050507);box-shadow:0 0 20px rgba(255,31,46,.35),inset 0 0 0 3px #000}
.cx-sum dl{margin:0 0 14px}
.cx-sum dl>div{display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid var(--line);font-size:14px}
.cx-sum dt{color:var(--muted)}
.cx-sum dd{margin:0;font-weight:600;text-align:left}
.cx-sum .disc dd{color:#3ddc84}
.cx-sum .grand{border-bottom:0;padding-top:14px;font-size:16px}
.cx-sum .grand dt{color:#fff;font-weight:700}
.cx-sum .grand dd{color:#ff2230;font-size:21px;font-weight:800;text-shadow:0 0 14px rgba(255,31,46,.45)}
.cx-sum .grand small{font-size:12px}
.cx-save{margin:0 0 14px;padding:8px 12px;border-radius:10px;background:rgba(38,180,95,.12);border:1px solid rgba(38,180,95,.45);color:#3ddc84;font-size:13px;text-align:center}
.cx-coupon{display:flex;gap:8px;margin-bottom:14px}
.cx-coupon input{flex:1;min-width:0;padding:11px 14px;border-radius:10px;border:1px solid #34343c;background:#000;color:#fff;font-family:inherit;outline:0}
.cx-coupon input:focus{border-color:var(--red-hi);box-shadow:0 0 0 3px rgba(255,31,46,.22)}
.cx-coupon .btn{padding:0 18px}
.cx-go{justify-content:center;font-size:16px;padding:14px 20px}
.cx-go.dis{opacity:.5;pointer-events:none;filter:grayscale(.6)}
.cx-safe{list-style:none;margin:16px 0 0;padding:0;display:grid;gap:6px;color:var(--muted);font-size:13px}
.cx-safe li:before{content:"✓";color:var(--red-hi);margin-inline-end:8px}
.muted{color:var(--muted)}
/* سبد خالی */
.cx-empty{display:flex;flex-direction:column;align-items:center;gap:12px;margin-top:26px;padding:60px 20px;border-radius:20px;text-align:center;border:1px solid #31313a;background:radial-gradient(70% 90% at 50% 0%,rgba(217,20,31,.2),transparent 70%),linear-gradient(180deg,#15151a,#07070a)}
.cx-eic{display:flex;align-items:center;justify-content:center;width:96px;height:96px;border-radius:50%;border:2px solid var(--red-hi);box-shadow:0 0 22px rgba(255,31,46,.6),inset 0 0 18px rgba(255,31,46,.25)}
.cx-eic svg{width:46px;height:46px;fill:none;stroke:#fff;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.cx-empty h2{margin:6px 0 0;font-size:24px}
.cx-empty p{margin:0;color:var(--muted)}
.cx-eact{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin-top:8px}
/* پنجره‌ی تأیید */
.cx-dlg{border:1px solid var(--red-hi);border-radius:16px;background:linear-gradient(180deg,#17171c,#08080b);color:#fff;padding:24px;width:min(420px,90vw);box-shadow:0 0 30px rgba(255,31,46,.45)}
.cx-dlg::backdrop{background:rgba(0,0,0,.75)}
.cx-dlg h3{margin:0 0 10px}
.cx-dlg p{margin:0 0 20px;color:#d4d4da;line-height:2}
.cx-dact{display:flex;gap:10px;justify-content:flex-end}
/* نوار پایین موبایل */
.cx-mob{display:none}
@media(max-width:1000px){
  .cx{grid-template-columns:1fr}
  .cx-sum{position:static}
  .cx-item{grid-template-columns:90px minmax(0,1fr) 42px;grid-template-areas:"img info del" "qty qty total"}
  .cx-img{grid-area:img;height:76px}.cx-info{grid-area:info}.cx-del{grid-area:del}.cx-qty{grid-area:qty;justify-self:start}.cx-total{grid-area:total}
  .cx-mob{display:flex;position:fixed;z-index:40;right:0;left:0;bottom:0;align-items:center;justify-content:space-between;gap:14px;padding:12px 16px calc(12px + env(safe-area-inset-bottom,0px));background:rgba(5,5,7,.96);backdrop-filter:blur(8px);border-top:1px solid var(--red-hi);box-shadow:0 -6px 24px rgba(255,31,46,.35)}
  .cx-mob span{display:block;font-size:12px;color:var(--muted)}
  .cx-mob b{font-size:17px;color:#ff2230}
  .cx-mob b small{font-size:11px}
  .cx-mob .btn{padding:12px 24px}
  .cx-sum .cx-go{display:none}
  body{padding-bottom:80px}
}
@media(max-width:560px){.cx-steps span{font-size:11px}.cx-steps i{width:30px;height:30px}.cx-steps li:not(:last-child):before{top:14px}}
@media(prefers-reduced-motion:reduce){.cx-bar i{transition:none}}
