/* فاز ۵: رفع سرریز + سبد/تسویه/سفارش + تیکت (مشترک فروشگاه و ادمین؛ var با fallback) */
.account-layout { grid-template-columns: 270px minmax(0, 1fr); }
.account-body, .acc-cols > *, .checkout-grid > *, .cart-page > * { min-width: 0; }
.acc-cols { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .acc-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .account-layout { grid-template-columns: minmax(0, 1fr); } }
.table-wrap { overflow-x: auto; max-width: 100%; }
.account-body { overflow-wrap: anywhere; }

/* لیست سفارش‌های داشبورد */
.ord-list { display: grid; gap: 10px; }
.ord-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; flex-wrap: wrap; }
.ord-row .mini { flex: none; }
.ord-row .ord-main { flex: 1; min-width: 140px; display: grid; }
.ord-row small { color: var(--muted); }

/* مراحل خرید */
.steps-bar { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 22px; padding: 0; list-style: none; flex-wrap: wrap; }
.steps-bar li { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 700; font-size: 14px; }
.steps-bar li b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--soft); }
.steps-bar li.on { color: var(--navy); } .steps-bar li.on b { background: var(--red); color: #fff; }
.steps-bar li.done b { background: #14803c; color: #fff; }
.steps-bar li + li::before { content: ""; width: 38px; height: 2px; background: var(--border); }

.cart-page, .co-page { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .cart-page, .co-page { grid-template-columns: minmax(0, 1fr); } }
.cart-item { display: grid; grid-template-columns: 96px 1fr auto; gap: 16px; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 14px; margin-bottom: 12px; transition: box-shadow .15s; }
.cart-item:hover { box-shadow: 0 8px 22px rgba(23, 38, 60, .08); }
.cart-item .ci-img { width: 96px; height: 80px; border-radius: 12px; background: var(--soft); object-fit: contain; }
.cart-item h3 { margin: 0 0 4px; font-size: 15px; } .cart-item h3 a:hover { color: var(--red); }
.cart-item .ci-price { color: var(--muted); font-size: 13px; }
.cart-item .ci-side { display: grid; gap: 8px; justify-items: end; }
.cart-item .ci-line { font-weight: 800; font-size: 16px; color: var(--navy); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.qty button { width: 34px; height: 36px; border: 0; background: var(--soft); font: inherit; font-size: 18px; cursor: pointer; }
.qty button:hover { background: var(--border); }
.qty input { width: 48px; height: 36px; border: 0; text-align: center; font: inherit; font-weight: 700; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.ci-remove { border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; font-size: 12px; padding: 4px; }
.ci-remove:hover { color: var(--red); }
@media (max-width: 560px) { .cart-item { grid-template-columns: 72px 1fr; } .cart-item .ci-img { width: 72px; height: 64px; } .cart-item .ci-side { grid-column: 1 / -1; grid-auto-flow: column; justify-content: space-between; justify-items: stretch; align-items: center; } }

.sum-card { position: sticky; top: 90px; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); }
.sum-card h2 { margin: 0 0 14px; font-size: 17px; }
.sum-card ul { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.sum-card li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.sum-card li img { width: 44px; height: 38px; object-fit: contain; background: var(--soft); border-radius: 8px; flex: none; }
.sum-card li span:first-of-type { flex: 1; } 
.sum-row { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px dashed var(--border); font-size: 14px; }
.sum-total { font-size: 18px; font-weight: 800; color: var(--navy); }
.sum-card .btn { width: 100%; justify-content: center; margin-top: 12px; }
.trust { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--muted); }
.trust li { display: flex; gap: 8px; align-items: center; } .trust .icon { width: 16px; height: 16px; color: #14803c; }

.co-card { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 22px; margin-bottom: 16px; }
.co-card > h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 16px; }
.co-card > h2 b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 13px; }

/* بعد از ثبت سفارش */
.placed { text-align: center; padding: 34px 20px; border-radius: 20px; color: #fff; margin-bottom: 18px; background: radial-gradient(circle at 20% 0, #1c8a4b 0, #0f5c32 60%, #0b3f24 100%); position: relative; overflow: hidden; }
.placed .tick { display: grid; place-items: center; width: 78px; height: 78px; margin: 0 auto 14px; border-radius: 50%; background: #fff; color: #14803c; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.placed .tick svg { width: 42px; height: 42px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s .35s forwards; }
.placed h1 { margin: 0 0 6px; font-size: 24px; } .placed p { margin: 0; color: #d5f0df; }
.placed .code { display: inline-block; margin-top: 14px; padding: 8px 20px; border-radius: 12px; background: rgba(255, 255, 255, .15); font-weight: 800; letter-spacing: 1px; direction: ltr; }
.placed .acts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } } @keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .placed .tick, .placed .tick svg { animation: none; stroke-dashoffset: 0; } }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } @media (max-width: 700px) { .info-grid { grid-template-columns: 1fr; } }
.oi { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.oi:last-child { border: 0; } .oi img, .oi .mini { flex: none; } .oi .oi-n { flex: 1; font-weight: 600; font-size: 14px; } .oi small { color: var(--muted); display: block; font-weight: 400; }

/* تیکت (فروشگاه + ادمین) */
.tk-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 20px 22px; border-radius: 18px; color: #fff; margin-bottom: 14px; background: linear-gradient(110deg, #0f1b2d 0%, #24385a 70%, #8c1420 150%); }
.tk-head h1, .tk-head h2 { margin: 0; font-size: 20px; font-weight: 800; flex: 1; min-width: 200px; color: #fff; }
.tk-pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; padding: 0; list-style: none; }
.tk-pills li { padding: 5px 12px; border-radius: 999px; background: var(--soft, #f3f5f8); font-size: 12px; color: var(--muted); } .tk-pills b { color: var(--navy); }
.tk-thread { display: flex; flex-direction: column; gap: 16px; padding: 18px; border: 1px solid var(--border, var(--line)); border-radius: 18px; background: linear-gradient(#f8fafc, #f3f5f8); margin-bottom: 16px; max-height: 640px; overflow-y: auto; }
.tk-msg { display: flex; gap: 10px; align-items: flex-end; max-width: 88%; }
.tk-msg .av { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; font-size: 14px; }
.tk-msg .bub { background: #fff; border: 1px solid var(--border, var(--line)); border-radius: 16px 16px 16px 4px; padding: 10px 14px; box-shadow: 0 1px 3px rgba(23, 38, 60, .05); min-width: 0; }
.tk-msg.staff { align-self: flex-end; flex-direction: row-reverse; }
.tk-msg.staff .av { background: var(--red); }
.tk-msg.staff .bub { background: #fff1f2; border-color: #f7c9ce; border-radius: 16px 16px 4px 16px; }
.tk-msg .who { display: flex; gap: 10px; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; } .tk-msg .who b { color: var(--navy); }
.tk-msg p { margin: 0; word-break: break-word; line-height: 1.9; }
.tk-files { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; padding: 0; list-style: none; }
.tk-files a { display: inline-block; padding: 3px 10px; border-radius: 8px; background: var(--soft, #f3f5f8); font-size: 12px; } .tk-files a:hover { background: #e3e8ef; }
.tk-reply { background: #fff; border: 1px solid var(--border, var(--line)); border-radius: 18px; padding: 18px; margin-bottom: 14px; }
.tk-reply h3 { margin: 0 0 10px; font-size: 15px; }
.tk-closed { text-align: center; padding: 22px; border: 2px dashed var(--border, var(--line)); border-radius: 18px; margin-bottom: 14px; color: var(--muted); }
