/* ============================================================
   ARIO — 08 CART
   Cart Bar · Cart Modal · Toast · Checkout
   ============================================================ */

.cart-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9997;
  padding: .85rem 1rem;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-top: 1.5px solid rgba(59, 130, 246, .22);
  box-shadow: 0 -10px 40px rgba(31, 38, 135, .12), inset 0 1px 0 rgba(255, 255, 255, .9);
  transform: translateY(120%);
  transition: transform .45s cubic-bezier(.34, 1.3, .5, 1);
}
.cart-bar.active { transform: translateY(0); }
.cart-bar-inner {
  max-width: 1100px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.cart-bar-info {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: .25rem .35rem;
  border-radius: 12px;
  transition: background .25s;
  font-family: var(--font-fa);
  color: inherit;
}
.cart-bar-info:hover { background: rgba(59, 130, 246, .08); }
.cart-bar-icon {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #7c3aed);
  color: #fff;
  box-shadow: 0 8px 20px rgba(59, 130, 246, .35);
  flex-shrink: 0;
}
.cart-bar-icon svg { width: 20px; height: 20px; }
.cart-bar-text { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; text-align: right; }
.cart-bar-count { font-size: .82rem; font-weight: 700; color: var(--text-soft); }
.cart-bar-count b { color: var(--blue-700); font-weight: 900; font-family: var(--font-fa); }
.cart-bar-total { font-size: .92rem; font-weight: 800; color: var(--ink-900); font-family: var(--font-fa); }
.cart-bar-total b {
  font-weight: 900;
  font-size: 1.05rem;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed 60%, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cart-bar-actions { display: flex; align-items: center; gap: .5rem; }
.cart-bar-clear {
  padding: .55rem .95rem;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, .3);
  background: rgba(239, 68, 68, .06);
  color: #b91c1c;
  font-family: var(--font-fa);
  font-weight: 800;
  font-size: .78rem;
  cursor: pointer;
  transition: all .25s;
}
.cart-bar-clear:hover { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .55); transform: translateY(-1px); }
.cart-bar-show {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .65rem 1.2rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-family: var(--font-fa);
  font-weight: 900;
  font-size: .84rem;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(16, 185, 129, .38);
  transition: transform .25s, box-shadow .25s;
}
.cart-bar-show svg { width: 14px; height: 14px; transition: transform .3s; }
.cart-bar-show:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 14px 32px rgba(16, 185, 129, .5); }
.cart-bar-show:hover svg { transform: translateX(-4px); }

.cart-modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 4, 15, .68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 1rem;
  animation: fadeIn .22s ease;
}
.cart-modal.active { display: flex; }
.cart-modal-card {
  position: relative;
  background: #fff;
  border-radius: 24px;
  padding: 2rem 1.6rem 1.6rem;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 40px 100px rgba(0, 0, 0, .45);
  animation: modalIn .4s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.cart-modal-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #7c3aed, #ec4899, #f59e0b, #10b981, #3b82f6);
  background-size: 300% 100%;
  animation: borderShine 5s linear infinite;
}
.cart-modal-close {
  position: absolute;
  top: .9rem; left: .9rem;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, .06);
  color: #475569;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .2s, transform .2s, color .2s;
  z-index: 5;
}
.cart-modal-close:hover { background: rgba(239, 68, 68, .15); color: #dc2626; transform: rotate(90deg); }
.cart-modal-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1.5px dashed rgba(59, 130, 246, .2);
  padding-inline-start: 2.5rem;
}
.cart-modal-icon { font-size: 1.5rem; }
.cart-modal-head h3 {
  font-family: var(--font-fa);
  font-size: 1.15rem;
  font-weight: 900;
  margin: 0;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed 60%, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cart-modal-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin-bottom: 1rem;
  max-height: 320px;
  overflow-y: auto;
  padding-inline-end: .25rem;
}
.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .75rem .9rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, .06), rgba(168, 85, 247, .04));
  border: 1px solid rgba(59, 130, 246, .14);
  transition: transform .2s, box-shadow .2s;
}
.cart-item:hover { transform: translateX(-3px); box-shadow: 0 8px 20px rgba(59, 130, 246, .12); }
.cart-item-info { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.cart-item-name { font-family: var(--font-fa); font-size: .92rem; font-weight: 800; color: var(--ink-900); }
.cart-item-price { font-family: var(--font-fa); font-size: .82rem; font-weight: 700; color: var(--blue-700); }
.cart-item-remove {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 10px;
  border: none;
  background: rgba(239, 68, 68, .08);
  color: #b91c1c;
  cursor: pointer;
  display: grid; place-items: center;
  font-size: .9rem;
  transition: all .22s;
}
.cart-item-remove:hover { background: rgba(239, 68, 68, .18); transform: scale(1.08); }
.cart-empty { text-align: center; padding: 2rem 1rem; color: var(--text-soft); font-family: var(--font-fa); font-weight: 600; font-size: .92rem; }
.cart-modal-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(16, 185, 129, .1), rgba(6, 182, 212, .06));
  border: 1.5px solid rgba(16, 185, 129, .3);
  margin-bottom: 1rem;
}
.cart-modal-total span { font-family: var(--font-fa); font-size: .9rem; font-weight: 800; color: #047857; }
.cart-modal-total b {
  font-family: var(--font-fa);
  font-size: 1.25rem;
  font-weight: 900;
  background: linear-gradient(135deg, #047857, #10b981, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cart-modal-actions { display: flex; gap: .6rem; }
.cart-modal-actions .btn { flex: 1; }

/* ✅ cart-toast — پاپ از مرکز */
.cart-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) scale(.85);
  padding: .7rem 1.4rem;
  border-radius: 100px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-family: var(--font-fa);
  font-weight: 800;
  font-size: .85rem;
  box-shadow: 0 14px 34px rgba(16, 185, 129, .45);
  opacity: 0;
  transition: opacity .3s, transform .35s cubic-bezier(.34, 1.4, .5, 1);
  z-index: 99998;
  pointer-events: none;
  transform-origin: center;
}
.cart-toast.active {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

@media (max-width: 640px) {
  .cart-bar { padding: .7rem .8rem; }
  .cart-bar-inner { gap: .6rem; }
  .cart-bar-icon { width: 36px; height: 36px; }
  .cart-bar-icon svg { width: 17px; height: 17px; }
  .cart-bar-count { font-size: .72rem; }
  .cart-bar-total { font-size: .82rem; }
  .cart-bar-total b { font-size: .92rem; }
  .cart-bar-clear { padding: .5rem .75rem; font-size: .72rem; }
  .cart-bar-show { padding: .55rem 1rem; font-size: .78rem; }
  .cart-modal-card { padding: 1.6rem 1.2rem 1.2rem; border-radius: 20px; }
  .cart-modal-head h3 { font-size: 1rem; }
  .cart-modal-total b { font-size: 1.1rem; }
}

/* ---------- Checkout ---------- */
.checkout-card { max-width: 620px; }
.checkout-summary {
  margin: 1.4rem 0;
  padding: 1.2rem 1.2rem 1rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(59, 130, 246, .06), rgba(168, 85, 247, .05));
  border: 1.5px solid rgba(59, 130, 246, .18);
}
.checkout-summary-head {
  font-family: var(--font-fa);
  font-size: .9rem;
  font-weight: 800;
  color: var(--blue-700);
  margin-bottom: .8rem;
  padding-bottom: .6rem;
  border-bottom: 1px dashed rgba(59, 130, 246, .25);
}
.checkout-summary-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: 1rem;
  max-height: 280px;
  overflow-y: auto;
}
.checkout-summary-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(16, 185, 129, .12), rgba(6, 182, 212, .06));
  border: 1.5px solid rgba(16, 185, 129, .35);
}
.checkout-summary-total span { font-family: var(--font-fa); font-weight: 800; color: #047857; font-size: .9rem; }
.checkout-summary-total b {
  font-family: var(--font-fa);
  font-weight: 900;
  font-size: 1.2rem;
  background: linear-gradient(135deg, #047857, #10b981, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cart-modal-actions { display: flex; gap: .6rem; }
.cart-modal-checkout {
  width: 100%;
  padding: 1rem 1.2rem !important;
  font-size: 1rem !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #10b981, #059669) !important;
  box-shadow: 0 14px 32px rgba(16, 185, 129, .4) !important;
}
.cart-modal-checkout:hover { transform: translateY(-2px); box-shadow: 0 18px 42px rgba(16, 185, 129, .55) !important; }

/* ============================================================
   DISCOUNT BLOCK
   ============================================================ */
.discount-block {
  margin: 1.4rem 0 1.2rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, .06), rgba(245, 158, 11, .05));
  border: 1.5px solid rgba(59, 130, 246, .2);
}
.discount-label {
  display: block;
  font-family: var(--font-fa);
  font-size: .9rem;
  font-weight: 800;
  color: var(--ink-800);
  margin-bottom: .55rem;
}
.discount-row {
  display: flex;
  gap: .55rem;
  align-items: stretch;
}
.discount-row input[type="text"] {
  flex: 1;
  min-width: 0;
  margin: 0 !important;
  padding: .8rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .05em;
  background: var(--ink-50);
  color: var(--text);
  transition: border-color .2s, box-shadow .2s, background .2s;
  text-transform: uppercase;
}
.discount-row input[type="text"]:focus {
  outline: none;
  border-color: var(--blue-500);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .12);
}
.discount-apply {
  padding: .8rem 1.4rem !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
  color: #fff !important;
  font-weight: 900 !important;
  font-size: .88rem !important;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(59, 130, 246, .3);
  transition: transform .25s, box-shadow .25s, filter .25s;
}
.discount-apply:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(59, 130, 246, .45);
  filter: brightness(1.05);
}
.discount-apply:disabled { opacity: .7; cursor: wait; }
.discount-msg {
  margin-top: .6rem;
  font-family: var(--font-fa);
  font-size: .84rem;
  font-weight: 700;
  line-height: 1.6;
  min-height: 1.4em;
}
.discount-msg:empty { display: none; }
.discount-msg.is-success { color: #047857; }
.discount-msg.is-error   { color: #b91c1c; }

/* ============================================================
   STRIKETHROUGH PRICE
   ============================================================ */
.checkout-summary-total { position: relative; }

.checkout-summary-original,
.ppb-original {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem 1rem;
  margin-top: .55rem;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(245, 158, 11, .08), rgba(239, 68, 68, .06));
  border: 1px dashed rgba(245, 158, 11, .35);
  font-family: var(--font-fa);
  font-size: .86rem;
  font-weight: 700;
  flex-wrap: wrap;
}
.co-orig-label,
.ppb-original > span:first-child { color: var(--text-soft); }
.co-orig-price,
.ppb-orig-strike {
  font-family: var(--font-fa);
  font-weight: 900;
  color: #b91c1c;
  text-decoration: line-through;
  text-decoration-color: rgba(239, 68, 68, .8);
  text-decoration-thickness: 2px;
  font-size: 1rem;
}
.co-save-badge,
.ppb-save {
  margin-inline-start: auto;
  padding: .3rem .75rem;
  border-radius: 100px;
  font-family: var(--font-fa);
  font-size: .76rem;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 12px rgba(16, 185, 129, .35);
  animation: savePop .4s cubic-bezier(.4, 0, .2, 1);
}
@keyframes savePop {
  from { transform: scale(.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* Payment page price box */
.payment-price-box {
  margin-bottom: 1.4rem;
  padding: 1.1rem 1.2rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, .08), rgba(124, 58, 237, .05));
  border: 1.5px solid rgba(59, 130, 246, .22);
}
.ppb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  flex-wrap: wrap;
}
.ppb-label {
  font-family: var(--font-fa);
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-soft);
}
.ppb-price {
  font-family: var(--font-fa);
  font-size: 1.4rem;
  font-weight: 900;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed 50%, #ec4899);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: statNumShine 5s linear infinite;
  transition: all .3s;
}

@media (max-width: 640px) {
  .discount-row { flex-direction: column; }
  .discount-apply { width: 100%; }
  .checkout-summary-original,
  .ppb-original { flex-direction: column; align-items: flex-start; gap: .4rem; }
  .co-save-badge,
  .ppb-save { margin-inline-start: 0; }
}