/* ═══════════════════════════════════════════════
   متجر فرح مصر — Cart drawer · Toasts · Checkout
   بيتحمّل بعد css/style.css في كل صفحة. المتغيرات الأساسية من style.css
   (--navy / --gold / --cream ...) ولو مش موجودة فيه قيم احتياطية للبراند.
   ═══════════════════════════════════════════════ */
:root {
  --cd-navy: var(--navy-900, #0B1929);
  --cd-navy-2: var(--navy-800, #12263F);
  --cd-gold: var(--gold-500, #D4A853);
  --cd-gold-l: var(--gold-300, #F0D78C);
  --cd-gold-d: var(--gold-700, #9A7428);
  --cd-cream: var(--cream, #F7F3EA);
  --cd-ink: var(--ink, #0B1929);
  --cd-muted: #5B6475;
  --cd-soft: #8A93A3;
  --cd-line: rgba(11, 25, 41, 0.09);
  --cd-surface: #FFFFFF;
  --cd-ok: var(--success, #157F4F);
  --cd-ok-bg: #E8F6EF;
  --cd-warn: #A15C00;
  --cd-err: #C0362C;
  --cd-err-bg: #FDEEEC;
  --cd-r: 18px;
  --cd-r-sm: 12px;
  --cd-shadow: 0 1px 2px rgba(11, 25, 41, 0.05), 0 10px 30px rgba(11, 25, 41, 0.08);
  --cd-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --cd-font: var(--font, 'Cairo', system-ui, sans-serif);
}

/* ═════════════ DRAWER ═════════════ */
.drawer-overlay#cart-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(11, 25, 41, 0.45);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s var(--cd-ease);
}
.drawer-overlay#cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer.cd {
  position: fixed; top: 0; bottom: 0; left: 0; right: auto;
  width: min(430px, 100vw); height: 100%; height: 100dvh;
  z-index: 1201;
  display: flex; flex-direction: column;
  background: var(--cd-surface);
  border: 0; border-radius: 0 22px 22px 0;
  box-shadow: 0 24px 80px rgba(11, 25, 41, 0.28);
  font-family: var(--cd-font);
  color: var(--cd-ink);
  transform: translateX(-104%);
  transition: transform 0.42s var(--cd-ease), visibility 0s linear 0.42s;
  visibility: hidden;
  backdrop-filter: none;
  overflow: hidden;
}
.cart-drawer.cd.open { transform: none; visibility: visible; transition: transform 0.42s var(--cd-ease); }
html.cd-locked { overflow: hidden; }
.cart-drawer.cd [hidden] { display: none !important; }

.cd-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--cd-line);
}
.cd-title { display: flex; align-items: baseline; gap: 10px; }
.cd-title h2 { font-family: var(--cd-font); font-size: 1.3rem; font-weight: 800; color: var(--cd-navy); letter-spacing: 0; line-height: 1.3; margin: 0; }
.cd-count { font-size: 0.82rem; font-weight: 700; color: var(--cd-muted); background: var(--cd-cream); padding: 2px 10px; border-radius: 999px; }
.cd-close {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--cd-navy); background: #F2F3F5;
  transition: background 0.2s, transform 0.2s;
}
.cd-close:hover { background: var(--cd-navy); color: #fff; }

/* شحن مجاني */
.cd-ship { padding: 12px 20px 14px; background: linear-gradient(180deg, #FFFBF1, #fff); border-bottom: 1px solid var(--cd-line); }
.cd-ship-msg { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; font-weight: 600; color: var(--cd-ink); margin-bottom: 8px; }
.cd-ship-msg svg { flex-shrink: 0; color: var(--cd-gold-d); }
.cd-ship-msg strong { color: var(--cd-navy); font-weight: 800; }
.cd-ship-track { height: 8px; border-radius: 999px; background: #EFEAE0; overflow: hidden; }
.cd-ship-fill {
  height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--cd-gold-l), var(--cd-gold));
  transition: width 0.5s var(--cd-ease), background 0.3s;
  margin-inline-start: 0;
}
.cd-ship.is-done { background: linear-gradient(180deg, var(--cd-ok-bg), #fff); }
.cd-ship.is-done .cd-ship-msg svg { color: var(--cd-ok); }
.cd-ship.is-done .cd-ship-fill { background: linear-gradient(90deg, #3CC486, var(--cd-ok)); }

/* الجسم */
.cd-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 18px; }
.cd-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.cd-item {
  display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px;
  padding: 10px; border-radius: 16px;
  background: #fff; border: 1px solid var(--cd-line);
  transition: opacity 0.2s, transform 0.2s;
}
.cd-item.is-new { animation: cdItemIn 0.4s var(--cd-ease); }
.cd-item.is-leaving { opacity: 0; transform: translateX(-12px); }
.cd-item-img { display: block; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; background: var(--cd-cream); }
.cd-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cd-item-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cd-item-top { display: flex; align-items: flex-start; gap: 6px; }
.cd-item-name {
  flex: 1; min-width: 0;
  font-size: 0.92rem; font-weight: 700; line-height: 1.45; color: var(--cd-ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
a.cd-item-name:hover { color: var(--cd-gold-d); }
.cd-remove {
  flex-shrink: 0; width: 32px; height: 32px; margin: -4px -4px 0 0; border-radius: 10px;
  display: grid; place-items: center; color: var(--cd-soft);
  transition: color 0.2s, background 0.2s;
}
.cd-remove:hover { color: var(--cd-err); background: var(--cd-err-bg); }
.cd-item-variant { font-size: 0.78rem; color: var(--cd-muted); }
.cd-item-offer {
  align-self: flex-start; font-size: 0.72rem; font-weight: 700;
  color: #7A5A12; background: #FBF1D9; padding: 1px 8px; border-radius: 999px;
}
.cd-item-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 2px; flex-wrap: wrap; }
.cd-item-price { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.cd-item-price strong { font-size: 0.98rem; font-weight: 800; color: var(--cd-navy); }
.cd-item-price s { font-size: 0.76rem; color: var(--cd-soft); }
.cd-item-price small { font-size: 0.7rem; color: var(--cd-muted); }

.cd-qty {
  display: inline-flex; align-items: center;
  height: 36px; border-radius: 999px;
  border: 1px solid var(--cd-line); background: #FAFAFB;
}
.cd-qty button {
  width: 36px; height: 34px; border-radius: 999px;
  font-size: 1.15rem; font-weight: 700; color: var(--cd-navy);
  display: grid; place-items: center;
  transition: background 0.15s;
}
.cd-qty button:hover:not(:disabled) { background: var(--cd-cream); }
.cd-qty button:disabled { color: #C5CAD3; cursor: not-allowed; }
.cd-qty output { min-width: 26px; text-align: center; font-weight: 800; font-size: 0.95rem; font-variant-numeric: tabular-nums; }

/* فاضية */
.cd-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 48px 16px 24px; }
.cd-empty-ic { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; color: var(--cd-gold-d); background: radial-gradient(circle at 30% 30%, #FFF8E6, var(--cd-cream)); margin-bottom: 8px; }
.cd-empty h3 { font-family: var(--cd-font); font-size: 1.15rem; font-weight: 800; color: var(--cd-navy); letter-spacing: 0; }
.cd-empty p { color: var(--cd-muted); font-size: 0.9rem; margin-bottom: 10px; }

/* Upsell */
.cd-upsell { margin-top: 14px; padding: 12px; border-radius: 16px; background: linear-gradient(135deg, #FFFBF0, #FBF3E0); border: 1px dashed rgba(212, 168, 83, 0.6); }
.cd-upsell-label { font-size: 0.8rem; font-weight: 800; color: #7A5A12; margin-bottom: 8px; }
.cd-upsell-row { display: flex; align-items: center; gap: 10px; }
.cd-upsell-row img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: #fff; flex-shrink: 0; }
.cd-upsell-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cd-upsell-name { font-size: 0.85rem; font-weight: 700; color: var(--cd-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-upsell-info strong { font-size: 0.88rem; color: var(--cd-navy); }

/* Footer */
.cd-foot { padding: 14px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--cd-line); background: #fff; box-shadow: 0 -10px 30px rgba(11, 25, 41, 0.05); }
.cd-sum { margin: 0 0 6px; }
.cd-sum > div { display: flex; justify-content: space-between; align-items: baseline; padding: 3px 0; font-size: 0.9rem; color: var(--cd-muted); }
.cd-sum dd { margin: 0; font-weight: 700; color: var(--cd-ink); }
.cd-sum .cd-sum-total { margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--cd-line); font-size: 1.05rem; color: var(--cd-ink); font-weight: 800; }
.cd-sum .cd-sum-total dd { font-size: 1.2rem; font-weight: 900; color: var(--cd-navy); }
.cd-sum-note { font-size: 0.74rem; color: var(--cd-soft); margin: 0 0 12px; }
.cd-foot-links { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.cd-link { font-size: 0.9rem; font-weight: 700; color: var(--cd-navy); padding: 8px 4px; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(212, 168, 83, 0.7); }
.cd-link-muted { color: var(--cd-soft); font-weight: 600; text-decoration: none; }
.cd-link-muted:hover { color: var(--cd-err); }
.cd-trust { font-size: 0.74rem; color: var(--cd-muted); text-align: center; margin-top: 6px; }

/* أزرار مشتركة (السلة + الدفع) */
.cd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 14px;
  font-family: var(--cd-font); font-size: 1rem; font-weight: 800; line-height: 1.2;
  border: 0; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, filter 0.2s;
}
.cd-btn:active { transform: scale(0.98); }
.cd-btn-primary { background: var(--cd-navy); color: #fff; box-shadow: 0 8px 22px rgba(11, 25, 41, 0.22); }
.cd-btn-primary:hover { filter: brightness(1.15); }
.cd-btn-gold { background: linear-gradient(135deg, var(--cd-gold-l), var(--cd-gold)); color: var(--cd-ink); box-shadow: 0 6px 18px rgba(212, 168, 83, 0.35); }
.cd-btn-gold:hover { filter: brightness(1.04); }
.cd-btn-ghost { background: #fff; color: var(--cd-navy); border: 1.5px solid var(--cd-line); }
.cd-btn-ghost:hover { border-color: var(--cd-gold); }
.cd-btn-lg { width: 100%; min-height: 56px; font-size: 1.08rem; border-radius: 16px; }
.cd-btn-sm { min-height: 38px; padding: 0 16px; font-size: 0.88rem; border-radius: 12px; }
.cd-btn svg { flex-shrink: 0; }

/* ═════════════ ADD-TO-CART FEEDBACK ═════════════ */
.cd-fly {
  position: fixed; z-index: 3000; pointer-events: none;
  border-radius: 16px; background: #fff center / cover no-repeat;
  box-shadow: 0 12px 30px rgba(11, 25, 41, 0.3);
  border: 2px solid #fff;
  will-change: transform, opacity;
}
.cd-bump { animation: cdBump 0.6s var(--cd-ease) !important; }
@keyframes cdBump { 0% { transform: scale(1); } 30% { transform: scale(1.35); } 60% { transform: scale(0.92); } 100% { transform: scale(1); } }
@keyframes cdItemIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ═════════════ TOASTS ═════════════
   مكان وشكل التوست الأساسي من style.css — هنا زرار الأكشن ("عرض السلة" / "تراجع") بس */
.toast-text { flex: 1; min-width: 0; }
.toast-icon { flex-shrink: 0; }
.toast .toast-action {
  flex-shrink: 0; min-height: 34px; padding: 0 12px; border-radius: 10px;
  font-family: var(--cd-font); font-size: 0.85rem; font-weight: 800;
  color: var(--cd-navy); background: var(--cd-gold-l);
  transition: background 0.2s;
}
.toast .toast-action:hover { background: #fff; }
@media (max-width: 899px) {
  body.pp-buybar-on .toast-stack { bottom: calc(92px + env(safe-area-inset-bottom)); }
}
@media (max-width: 480px) {
  .cart-drawer.cd { width: 100vw; border-radius: 0; }
}

/* ═══════════════════════════════════════════════
   CHECKOUT (pages/checkout.html)
   ═══════════════════════════════════════════════ */
.co-body { background: #F6F4EF; }
.co-page {
  font-family: var(--cd-font);
  color: var(--cd-ink);
  padding: 24px 0 64px; /* الهيدر sticky — مفيش إزاحة */
  min-height: 70vh;
}
.co-wrap { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.co-page [hidden] { display: none !important; }

.co-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.co-head h1 { font-family: var(--cd-font); font-size: clamp(1.45rem, 3.4vw, 2rem); font-weight: 900; color: var(--cd-navy); letter-spacing: 0; line-height: 1.3; }
.co-steps { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; font-size: 0.8rem; font-weight: 700; color: var(--cd-soft); flex-wrap: wrap; }
.co-steps li { display: inline-flex; align-items: center; gap: 6px; }
.co-steps li + li::before { content: ''; width: 18px; height: 2px; border-radius: 2px; background: #DAD6CC; margin-inline-end: 2px; }
.co-steps .co-step-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 0.72rem; background: #E7E3D9; color: var(--cd-muted); }
.co-steps .is-done { color: var(--cd-ok); }
.co-steps .is-done .co-step-n { background: var(--cd-ok); color: #fff; }
.co-steps .is-current { color: var(--cd-navy); }
.co-steps .is-current .co-step-n { background: var(--cd-navy); color: #fff; }

.co-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 960px) {
  .co-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; }
  .co-aside { position: sticky; top: calc(var(--top-h, 0px) + var(--nav-h, 64px) + 16px); order: 2; }
}

.co-card {
  background: #fff; border-radius: 20px; padding: 20px;
  border: 1px solid var(--cd-line); box-shadow: var(--cd-shadow);
}
.co-card + .co-card { margin-top: 16px; }
.co-card-title { display: flex; align-items: center; gap: 10px; font-family: var(--cd-font); font-size: 1.12rem; font-weight: 800; color: var(--cd-navy); letter-spacing: 0; line-height: 1.3; margin: 0 0 16px; }
.co-card-title .co-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 0.85rem; background: var(--cd-navy); color: var(--cd-gold-l); flex-shrink: 0; }
.co-card-sub { font-size: 0.82rem; color: var(--cd-muted); margin: -10px 0 14px; }

.co-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 640px) { .co-fields-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.co-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.co-field label { font-size: 0.88rem; font-weight: 700; color: var(--cd-ink); display: flex; align-items: center; gap: 6px; }
.co-field label .co-opt { font-weight: 500; color: var(--cd-soft); font-size: 0.8rem; }
.co-input {
  width: 100%; min-height: 52px; padding: 12px 14px;
  font-family: var(--cd-font); font-size: 16px; /* 16px = مفيش zoom على iOS */
  color: var(--cd-ink); background: #FBFBFC;
  border: 1.5px solid #DFE2E8; border-radius: 14px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none; appearance: none;
}
.co-input::placeholder { color: #A3AAB6; }
.co-input:focus { outline: none; border-color: var(--cd-gold); background: #fff; box-shadow: 0 0 0 4px rgba(212, 168, 83, 0.18); }
.co-input:disabled { background: #F2F3F5; color: var(--cd-soft); cursor: not-allowed; }
textarea.co-input { min-height: 84px; resize: vertical; line-height: 1.6; }
select.co-input {
  cursor: pointer; padding-inline-start: 14px; padding-inline-end: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24' stroke='%230B1929' stroke-width='2.4'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 14px center; background-size: 16px;
}
.co-input-wrap { position: relative; }
.co-input-wrap .co-input { padding-left: 44px; }
.co-status { position: absolute; top: 50%; left: 14px; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; display: none; place-items: center; font-size: 0.75rem; font-weight: 900; color: #fff; pointer-events: none; }
.co-field.is-valid .co-status { display: grid; background: var(--cd-ok); }
.co-field.is-valid .co-input { border-color: rgba(22, 134, 90, 0.55); }
.co-field.is-invalid .co-input { border-color: var(--cd-err); background: #FFF9F8; }
.co-field.is-invalid .co-input:focus { box-shadow: 0 0 0 4px rgba(192, 54, 44, 0.14); }
.co-help { font-size: 0.78rem; color: var(--cd-muted); min-height: 0; }
.co-field.is-invalid .co-help { color: var(--cd-err); font-weight: 600; }
.co-field.is-valid .co-help { color: var(--cd-ok); }
.co-govship { font-size: 0.8rem; font-weight: 700; color: var(--cd-navy); background: var(--cd-cream); border-radius: 10px; padding: 6px 10px; align-self: flex-start; }

/* الدفع */
.co-pay { display: grid; gap: 10px; }
.co-pay-card {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: 16px; cursor: pointer;
  border: 1.5px solid #DFE2E8; background: #fff;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.co-pay-card:hover { border-color: rgba(212, 168, 83, 0.7); }
.co-pay-card input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.co-pay-radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #C5CAD3; flex-shrink: 0; display: grid; place-items: center; transition: border-color 0.2s; }
.co-pay-radio::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--cd-navy); transform: scale(0); transition: transform 0.2s var(--cd-ease); }
.co-pay-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: var(--cd-cream); flex-shrink: 0; }
.co-pay-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.co-pay-txt strong { font-size: 0.98rem; font-weight: 800; color: var(--cd-ink); }
.co-pay-txt small { font-size: 0.8rem; color: var(--cd-muted); }
.co-pay-tag { align-self: flex-start; margin-top: 4px; font-size: 0.7rem; font-weight: 800; color: var(--cd-ok); background: var(--cd-ok-bg); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.co-pay-card.selected, .co-pay-card:has(input:checked) { border-color: var(--cd-navy); background: #FAFBFD; box-shadow: 0 0 0 3px rgba(11, 25, 41, 0.06); }
.co-pay-card.selected .co-pay-radio, .co-pay-card:has(input:checked) .co-pay-radio { border-color: var(--cd-navy); }
.co-pay-card.selected .co-pay-radio::after, .co-pay-card:has(input:checked) .co-pay-radio::after { transform: scale(1); }
.co-pay-card:has(input:focus-visible) { outline: 3px solid var(--cd-gold); outline-offset: 2px; }

.co-paynote { margin-top: 12px; padding: 14px; border-radius: 14px; background: #FFF8E8; border: 1px solid rgba(212, 168, 83, 0.45); font-size: 0.88rem; line-height: 1.75; color: var(--cd-ink); }
.co-paynote-num { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0; padding: 4px 6px 4px 12px; background: #fff; border-radius: 10px; border: 1px solid rgba(212, 168, 83, 0.5); font-weight: 800; font-size: 1.02rem; color: var(--cd-navy); }
.co-copy { font-size: 0.78rem; font-weight: 800; color: var(--cd-navy); background: var(--cd-gold-l); border-radius: 8px; padding: 4px 10px; }

/* ملخص الطلب */
.co-summary { background: #fff; border-radius: 20px; border: 1px solid var(--cd-line); box-shadow: var(--cd-shadow); overflow: hidden; }
.co-summary > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 18px; font-weight: 800; color: var(--cd-navy);
}
.co-summary > summary::-webkit-details-marker { display: none; }
.co-summary > summary .co-sum-label { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.co-summary > summary .co-sum-label small { font-weight: 600; color: var(--cd-muted); font-size: 0.82rem; }
.co-summary > summary .co-sum-right { display: flex; align-items: center; gap: 10px; }
.co-summary > summary strong { font-size: 1.05rem; font-weight: 900; }
.co-chev { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--cd-cream); transition: transform 0.25s var(--cd-ease); }
.co-summary[open] .co-chev { transform: rotate(180deg); }
.co-summary-body { padding: 0 18px 18px; border-top: 1px solid var(--cd-line); }
@media (min-width: 960px) {
  .co-summary > summary { cursor: default; pointer-events: none; }
  .co-summary > summary .co-chev, .co-summary > summary strong { display: none; }
}

.co-items { list-style: none; margin: 0; padding: 12px 0 4px; display: flex; flex-direction: column; gap: 12px; }
.co-it { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.co-it-img { position: relative; width: 58px; height: 58px; }
.co-it-img img { width: 58px; height: 58px; border-radius: 12px; object-fit: cover; background: var(--cd-cream); border: 1px solid var(--cd-line); }
.co-it-qty { position: absolute; top: -6px; left: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font-size: 0.72rem; font-weight: 800; background: var(--cd-navy); color: #fff; border: 2px solid #fff; }
.co-it-name { font-size: 0.88rem; font-weight: 700; line-height: 1.45; color: var(--cd-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.co-it-meta { font-size: 0.75rem; color: var(--cd-muted); }
.co-it-offer { font-size: 0.7rem; font-weight: 700; color: #7A5A12; background: #FBF1D9; padding: 0 7px; border-radius: 999px; display: inline-block; margin-top: 2px; }
.co-it-price { text-align: left; display: flex; flex-direction: column; align-items: flex-end; font-size: 0.9rem; font-weight: 800; color: var(--cd-navy); white-space: nowrap; }
.co-it-price s { font-size: 0.74rem; font-weight: 600; color: var(--cd-soft); }

.co-lines { margin: 8px 0 0; padding-top: 10px; border-top: 1px dashed var(--cd-line); }
.co-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 0; font-size: 0.92rem; color: var(--cd-muted); }
.co-line span:last-child { font-weight: 700; color: var(--cd-ink); text-align: left; }
.co-line small { color: var(--cd-soft); font-size: 0.76rem; }
.co-line.co-total { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--cd-line); font-size: 1.05rem; font-weight: 800; color: var(--cd-ink); }
.co-line.co-total span:last-child { font-size: 1.3rem; font-weight: 900; color: var(--cd-navy); }
.co-sum-note { font-size: 0.74rem; color: var(--cd-soft); margin-top: 8px; }
.co-back { display: inline-flex; margin-top: 10px; font-size: 0.85rem; font-weight: 700; color: var(--cd-navy); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(212, 168, 83, 0.7); }

/* زرار التأكيد + الثقة */
.co-submit { margin-top: 18px; }
.co-total-inline { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 2px; font-weight: 800; }
.co-total-inline span:first-child { color: var(--cd-muted); font-size: 0.92rem; }
.co-total-inline strong { font-size: 1.3rem; font-weight: 900; color: var(--cd-navy); }
.co-total-inline small { display: block; font-size: 0.72rem; font-weight: 600; color: var(--cd-soft); text-align: left; }
.co-place { width: 100%; min-height: 58px; font-size: 1.12rem; border-radius: 16px; }
.co-place .co-spin { display: none; width: 20px; height: 20px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: coSpin 0.8s linear infinite; }
.co-place.is-loading .co-spin { display: inline-block; }
.co-place:disabled { cursor: progress; filter: saturate(0.7); }
@keyframes coSpin { to { transform: rotate(360deg); } }
.co-legal { font-size: 0.74rem; color: var(--cd-soft); text-align: center; margin-top: 10px; }
.co-legal a { color: var(--cd-navy); text-decoration: underline; text-underline-offset: 3px; }
.co-trust { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.co-trust li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.84rem; color: var(--cd-muted); line-height: 1.55; }
.co-trust li span:first-child { flex-shrink: 0; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--cd-cream); font-size: 0.95rem; }
.co-trust strong { color: var(--cd-ink); }

/* فاضية */
.co-empty { text-align: center; padding: 48px 20px; background: #fff; border-radius: 20px; border: 1px solid var(--cd-line); box-shadow: var(--cd-shadow); max-width: 520px; margin: 0 auto; }
.co-empty .cd-empty-ic { margin: 0 auto 12px; }
.co-empty h2 { font-family: var(--cd-font); font-size: 1.3rem; font-weight: 800; color: var(--cd-navy); letter-spacing: 0; margin-bottom: 6px; }
.co-empty p { color: var(--cd-muted); margin-bottom: 18px; }

/* نجاح */
.co-success { max-width: 620px; margin: 0 auto; text-align: center; }
.co-success-card { background: #fff; border-radius: 24px; border: 1px solid var(--cd-line); box-shadow: var(--cd-shadow); padding: 28px 20px; }
.co-check { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--cd-ok-bg); color: var(--cd-ok); animation: coPop 0.5s var(--cd-ease); }
.co-check svg { width: 40px; height: 40px; stroke-dasharray: 30; stroke-dashoffset: 30; animation: coDraw 0.5s 0.25s var(--cd-ease) forwards; }
@keyframes coPop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes coDraw { to { stroke-dashoffset: 0; } }
.co-success h1 { font-family: var(--cd-font); font-size: clamp(1.4rem, 4vw, 1.9rem); font-weight: 900; color: var(--cd-navy); letter-spacing: 0; line-height: 1.35; margin-bottom: 6px; }
.co-success-lead { color: var(--cd-muted); font-size: 0.95rem; }
.co-orderno { margin: 18px auto; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 26px; border-radius: 18px; background: var(--cd-navy); color: #fff; }
.co-orderno small { font-size: 0.78rem; color: var(--cd-gold-l); font-weight: 700; }
.co-orderno strong { font-size: clamp(1.7rem, 7vw, 2.3rem); font-weight: 900; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
.co-orderno button { margin-top: 4px; font-size: 0.75rem; font-weight: 700; color: var(--cd-navy); background: var(--cd-gold-l); padding: 3px 12px; border-radius: 999px; }
.co-callnote { display: flex; gap: 10px; align-items: flex-start; text-align: start; background: #F3F7FF; border: 1px solid #DCE6F7; border-radius: 16px; padding: 14px; font-size: 0.9rem; line-height: 1.7; color: var(--cd-ink); margin-bottom: 14px; }
.co-callnote > span:first-child { font-size: 1.3rem; }
.co-details { text-align: start; background: #FAFAF8; border: 1px solid var(--cd-line); border-radius: 16px; padding: 14px; font-size: 0.88rem; line-height: 1.7; }
.co-details h2 { font-family: var(--cd-font); font-size: 0.95rem; font-weight: 800; color: var(--cd-navy); letter-spacing: 0; margin-bottom: 8px; }
.co-details ul { list-style: none; margin: 0 0 8px; padding: 0; }
.co-details li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--cd-line); }
.co-details li:last-child { border-bottom: 0; }
.co-details .co-d-total { display: flex; justify-content: space-between; font-weight: 900; color: var(--cd-navy); font-size: 1.02rem; padding-top: 8px; border-top: 1px solid var(--cd-line); }
.co-details dl { margin: 10px 0 0; display: grid; gap: 2px; }
.co-details dl div { display: flex; gap: 6px; }
.co-details dt { color: var(--cd-muted); flex-shrink: 0; }
.co-details dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.co-success-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 18px; }
.co-success-actions .cd-btn { white-space: normal; text-align: center; padding: 10px 16px; }
.co-wa { background: #1FAF53; color: #fff; box-shadow: 0 8px 22px rgba(31, 175, 83, 0.3); }
.co-wa:hover { filter: brightness(1.06); }

/* Dialog: العنوان المحفوظ */
.co-dialog { border: 0; border-radius: 22px; padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(11, 25, 41, 0.35); font-family: var(--cd-font); color: var(--cd-ink); }
.co-dialog::backdrop { background: rgba(11, 25, 41, 0.5); backdrop-filter: blur(3px); }
.co-dialog-body { padding: 22px 20px 18px; }
.co-dialog h2 { font-family: var(--cd-font); font-size: 1.15rem; font-weight: 800; color: var(--cd-navy); letter-spacing: 0; margin-bottom: 10px; }
.co-dialog p { font-size: 0.88rem; color: var(--cd-muted); margin-bottom: 10px; }
.co-addr { background: var(--cd-cream); border-radius: 12px; padding: 10px 12px; font-size: 0.88rem; font-weight: 600; margin-bottom: 10px; overflow-wrap: anywhere; }
.co-addr small { display: block; font-size: 0.74rem; color: var(--cd-muted); font-weight: 700; margin-bottom: 2px; }
.co-dialog-actions { display: grid; gap: 8px; margin-top: 14px; }

@media (max-width: 768px) {
  .co-page { padding-top: 16px; padding-bottom: 40px; }
  .co-card { padding: 16px; border-radius: 18px; }
  .co-wrap { width: calc(100% - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  .cart-drawer.cd, .cd-item, .cd-ship-fill, .co-chev { transition: none !important; }
  .cd-item.is-new, .cd-bump, .toast-stack .toast, .co-check, .co-check svg { animation: none !important; }
  .co-check svg { stroke-dashoffset: 0; }
}

/* عروض السلة: اللي اتطبق أو "ضيف كمان منتج" */
.cd-promo { margin: 12px 0 4px; padding: 10px 12px; border-radius: 12px; font-size: .88rem; line-height: 1.7; background: var(--cream, #F7F3EA); border: 1px dashed var(--gold-500, #D4A853); color: var(--ink, #0B1929); }
.cd-promo.is-applied { background: rgba(0, 160, 100, .08); border: 1px solid rgba(0, 160, 100, .35); }
.cd-sum-discount dd { color: var(--success, #0a8f5a); font-weight: 800; }

/* صفحة الدفع: سطر خصم عرض السلة والهدية */
.co-line.co-discount span:last-child, .co-line.co-gift span:last-child { color: var(--success, #0a8f5a); font-weight: 800; }

/* عروض السلة في صفحة المنتج والصفحة الرئيسية */
.pp-cart-offer { margin: 8px 0; padding: 9px 12px; border-radius: 12px; background: var(--cream, #F7F3EA); border: 1px dashed var(--gold-500, #D4A853); font-size: .9rem; line-height: 1.7; }
.offer-banner-rule { display: inline-block; margin: 6px 0; padding: 6px 12px; border-radius: 99px; background: var(--gold-500, #D4A853); color: #1a1405; font-weight: 800; font-size: .9rem; }
.co-pay-card.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; filter: grayscale(.6); }
.co-farnote { background: #EEF4FF; border-color: rgba(11, 25, 41, 0.18); margin-bottom: 4px; }
.co-consent { font-size: 0.72rem; color: var(--cd-soft); margin: 4px 0 0; }
.co-refusal { margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; background: #FFF4E5; border: 1px solid rgba(212, 140, 40, 0.45); font-size: 0.82rem; line-height: 1.8; color: var(--cd-ink); }
.co-refusal a { color: inherit; font-weight: 700; text-decoration: underline; }
.co-coupon { margin-top: 14px; }
.co-coupon-toggle { background: none; border: 0; padding: 4px 0; font: inherit; font-weight: 700; color: var(--cd-navy); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.co-coupon-row { display: flex; gap: 8px; margin-top: 8px; }
.co-coupon-row .co-input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .06em; }
.co-coupon-row .cd-btn { flex-shrink: 0; background: var(--cd-navy); color: #fff; }
.co-coupon-msg { font-size: 0.85rem; margin: 6px 0 0; min-height: 0; }
.co-coupon-msg.is-ok { color: #157F4F; font-weight: 700; }
.co-coupon-msg.is-bad { color: #B42318; font-weight: 700; }
.co-coupon-x { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; font-weight: 400; margin-inline-start: 6px; }
