/* ══════════════════════════════════════════════════════════════════════════
   eStorePoint — Cart & Checkout.
   Loaded by cart.php and checkout.php ($head_css = ['cart']).
   Shared by intent: the order summary, line items, trust strip and payment
   method cards appear on both pages and must not drift apart.
   ══════════════════════════════════════════════════════════════════════════ */

/* Shared helper colours for the amount callouts on both pages. */
.c-free{color:var(--green-600);font-weight:600;}
.c-warn{color:#b45309;font-weight:700;}

/* ════════════════════════════════════════════════════════════════════════
   CART
   ════════════════════════════════════════════════════════════════════════ */

/* ── Empty state ────────────────────────────────────────────────────────
   The stock .empty is a text block; a cart with nothing in it is the single
   highest-bounce moment on the site, so it gets art and two ways out. */
.empty-cart{max-width:560px;margin:0 auto;padding:72px 20px;}
.empty-cart .empty-art{
  width:104px;height:104px;margin:0 auto 1.4rem;border-radius:50%;
  display:grid;place-items:center;color:var(--green-500);
  background:var(--green-50);border:1px solid var(--green-100);
}
.empty-cart h3{font-size:1.5rem;color:var(--green-900);margin:0 0 .5rem;}
.empty-cart p{margin:0;line-height:1.7;}
.empty-actions{display:flex;gap:.7rem;justify-content:center;flex-wrap:wrap;margin-top:1.6rem;}

/* ── Page header ──────────────────────────────────────────────────────── */
.cart-head{display:flex;align-items:flex-end;justify-content:space-between;gap:1.2rem;flex-wrap:wrap;margin-bottom:1.4rem;}
.cart-head h1{margin:0;font-size:clamp(1.5rem,3vw,2rem);line-height:1.15;}
.cart-head-sub{margin:.3rem 0 0;color:var(--muted);font-size:.9rem;}

/* ── Cash on Delivery progress ──────────────────────────────────────────
   Reports the one threshold the server actually enforces. It must never
   promise a reward the checkout does not grant. */
.cart-prog{
  display:flex;flex-direction:column;gap:.5rem;
  padding:.9rem 1.1rem;margin-bottom:1.4rem;
  border:1px solid var(--green-100);border-radius:var(--radius-sm);
  background:linear-gradient(140deg,#f2faf6,#e6f5ec);
}
.cart-prog-text{display:flex;align-items:center;gap:.55rem;font-size:.9rem;font-weight:600;color:var(--green-800);}
.cart-prog-icon{display:inline-flex;flex:none;}
.cart-prog-track{height:7px;border-radius:999px;background:rgba(29,153,65,.15);overflow:hidden;}
.cart-prog-fill{
  display:block;height:100%;border-radius:999px;
  background:linear-gradient(90deg,var(--green-600),var(--green-500));
  transition:width .35s cubic-bezier(.22,.8,.3,1);
}
/* Unlocked: warmer, calmer, and a tick instead of a cart. */
.cart-prog.is-done{background:linear-gradient(140deg,#eafaf0,#d9f2e3);border-color:#bfe6cf;}
.cart-prog.is-done .cart-prog-fill{background:linear-gradient(90deg,var(--green-700),var(--green-600));}

/* ── Line items ─────────────────────────────────────────────────────────
   Cards, not a five-column table: a table forces a horizontal scrollbar on a
   phone, and the quantity stepper is unusable at 320px inside it. */
.cart-list{list-style:none;margin:0;padding:0;display:grid;gap:.85rem;}
.ci{
  display:grid;grid-template-columns:96px minmax(0,1fr) auto;
  gap:1.1rem;align-items:start;
  background:#fff;border:1px solid var(--line);border-radius:var(--radius);
  padding:1.05rem 1.15rem;box-shadow:var(--shadow-sm);
  transition:border-color .2s,box-shadow .2s,opacity .2s,transform .22s;
}
.ci:hover{border-color:var(--green-200);box-shadow:var(--shadow-md);}
/* Brief confirmation flash after an in-place quantity change. */
.ci.is-updated{border-color:var(--green-400);box-shadow:0 0 0 3px rgba(29,153,65,.12);}
.ci.is-removing{opacity:0;transform:translateX(-12px);}

.ci-media a{display:block;border-radius:10px;overflow:hidden;background:var(--green-50);}
.ci-media img{display:block;width:96px;height:96px;object-fit:cover;}

.ci-body{min-width:0;}
.ci-name{
  font-weight:700;color:var(--green-900);text-decoration:none;
  font-size:1rem;line-height:1.35;display:inline-block;
}
.ci-name:hover{color:var(--green-700);text-decoration:underline;}

.ci-eco{display:flex;align-items:center;gap:.4rem;margin:.4rem 0 0;color:var(--green-700);font-size:.82rem;line-height:1.45;}
.ci-eco svg{flex:none;}

.ci-foot{display:flex;align-items:center;gap:.9rem;flex-wrap:wrap;margin-top:.9rem;}
.ci-unit{font-size:.82rem;color:var(--muted);}
.ci-form{margin:0;}

.ci-remove-btn{
  display:inline-flex;align-items:center;gap:.3rem;
  background:none;border:0;padding:.3rem .5rem;border-radius:8px;cursor:pointer;
  color:#a01c1c;font:inherit;font-size:.82rem;font-weight:600;
  transition:background .15s,color .15s;
}
.ci-remove-btn:hover{background:#fdeaea;color:#7d1212;}

.ci-total{display:flex;flex-direction:column;align-items:flex-end;gap:.1rem;text-align:right;}
.ci-total-label{font-size:.72rem;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;}
.ci-total strong{font-size:1.12rem;font-weight:800;color:var(--green-800);white-space:nowrap;}

/* ── Trust strip ──────────────────────────────────────────────────────── */
.cart-trust{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.9rem;
  margin-top:1.3rem;padding:1.1rem 1.2rem;
  background:#fff;border:1px solid var(--line);border-radius:var(--radius);
}
.cart-trust-item{display:flex;align-items:flex-start;gap:.6rem;font-size:.8rem;color:var(--muted);line-height:1.45;}
.cart-trust-item svg{flex:none;color:var(--green-600);margin-top:2px;}
.cart-trust-item b{display:block;color:var(--ink);font-size:.84rem;font-weight:700;}

/* ── Summary ──────────────────────────────────────────────────────────── */
.cart-summary .c-free{font-size:1rem;}
.cart-sum-note{margin:.7rem 0 0;font-size:.8rem;color:var(--muted);line-height:1.6;}
.cart-cta{justify-content:center;margin-top:1.1rem;}
.cart-sum-foot{
  margin-top:1.1rem;padding-top:1rem;border-top:1px solid var(--line);
  display:flex;flex-direction:column;gap:.8rem;
}
.cart-clear{font-size:.8rem;color:var(--muted);text-decoration:underline;}
.cart-clear:hover{color:var(--danger);}

/* ── Upsell ───────────────────────────────────────────────────────────── */
.cart-upsell{margin-top:3.4rem;}

/* ════════════════════════════════════════════════════════════════════════
   CHECKOUT
   ════════════════════════════════════════════════════════════════════════ */

/* ── Steps ────────────────────────────────────────────────────────────── */
.co-steps,.pay-steps,.done-next{list-style:none;margin:0;padding:0;}

.co-steps{
  display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;
  margin:0 0 1.6rem;font-size:.85rem;
}
.co-steps li{display:flex;align-items:center;gap:.5rem;color:var(--muted);font-weight:600;}
.co-steps li + li::before{
  content:"";width:26px;height:1px;background:var(--line);margin-right:.1rem;
}
.co-step-n{
  width:24px;height:24px;flex:none;border-radius:50%;
  display:grid;place-items:center;font-size:.76rem;font-weight:700;
  background:#eef2f5;color:var(--muted);border:1px solid var(--line);
}
.co-steps li.is-now{color:var(--green-800);}
.co-steps li.is-now .co-step-n{background:var(--green-700);color:#fff;border-color:var(--green-700);}
.co-steps li.is-done{color:var(--green-700);}
.co-steps li.is-done .co-step-n{background:#eaf7ee;color:var(--green-700);border-color:#cbe9d4;}

/* ── Form sections ────────────────────────────────────────────────────── */
.co-section{
  border:1px solid var(--line);border-radius:var(--radius);
  padding:1.35rem 1.4rem 1.4rem;margin:0 0 1.2rem;background:#fff;
}
.co-legend{
  display:flex;align-items:center;gap:.6rem;padding:0;
  font-weight:800;color:var(--green-900);font-size:1.02rem;line-height:1.3;
}
.co-legend-n{
  width:26px;height:26px;flex:none;border-radius:50%;
  display:grid;place-items:center;font-size:.82rem;
  background:var(--green-700);color:#fff;
}
/* Legend sits on the fieldset's top border by default in some engines; the
   padding here pulls it back into the flow. */
.co-legend{float:none;margin:0 0 1.1rem;}
.co-cod-min{font-size:.8rem;margin:.6rem 0 0;}

.co-submit{margin-top:1.5rem;}
.co-cta{width:100%;justify-content:center;padding:.9rem 1.2rem;font-size:1rem;}
.co-secure{display:flex;align-items:center;justify-content:center;gap:.4rem;margin:.75rem 0 0;font-size:.78rem;color:var(--muted);}
.co-secure svg{flex:none;color:var(--green-600);}

/* ── Summary with line items ──────────────────────────────────────────── */
.co-lines{list-style:none;margin:0 0 .4rem;padding:0;display:grid;gap:.65rem;}
.co-line{display:grid;grid-template-columns:46px minmax(0,1fr) auto;gap:.7rem;align-items:center;}
.co-line-img{
  width:46px;height:46px;border-radius:8px;object-fit:cover;
  background:var(--green-50);border:1px solid var(--line);
}
.co-line-name{font-size:.86rem;font-weight:600;color:var(--ink);line-height:1.35;min-width:0;}
.co-line-name em{display:block;font-style:normal;font-weight:500;color:var(--muted);font-size:.78rem;margin-top:.1rem;}
.co-line-price{font-size:.86rem;font-weight:700;color:var(--green-800);white-space:nowrap;}

.co-sum-rows{border-top:1px solid var(--line);margin-top:.8rem;padding-top:.4rem;}
.co-sum-trust{
  display:grid;gap:.5rem;margin:1rem 0 0;padding-top:1rem;border-top:1px solid var(--line);
  font-size:.8rem;color:var(--muted);
}
.co-sum-trust div{display:flex;align-items:center;gap:.5rem;}
.co-sum-trust svg{flex:none;color:var(--green-600);}
.cart-summary .cart-sum-foot,.co-summary .cart-sum-foot{align-items:stretch;}
.co-summary .cart-sum-foot a{text-align:center;}

/* ── PayU handoff ─────────────────────────────────────────────────────── */
.pay-redirect{max-width:620px;margin:0 auto;}
.pay-redirect-card{
  background:#fff;border:1px solid var(--line);border-radius:var(--radius);
  padding:2.6rem 2rem;text-align:center;box-shadow:var(--shadow-md);
}
.pay-redirect-card h1{font-size:1.5rem;margin:0 0 .6rem;color:var(--green-900);}
.pay-redirect-card p{margin:0 auto;max-width:44ch;line-height:1.7;}

.pay-spinner{
  width:56px;height:56px;margin:0 auto 1.5rem;border-radius:50%;
  border:5px solid var(--green-100);border-top-color:var(--green-600);
  animation:coSpin 1s linear infinite;
}
@keyframes coSpin{to{transform:rotate(360deg)}}

.pay-steps{
  display:flex;align-items:center;justify-content:center;gap:.5rem;flex-wrap:wrap;
  margin:1.8rem 0 1.3rem;font-size:.82rem;
}
.pay-steps li{
  display:flex;align-items:center;gap:.4rem;padding:.45rem .8rem;border-radius:999px;
  background:#f5f7f8;color:var(--muted);font-weight:600;border:1px solid var(--line);
}
.pay-steps li + li::before{content:"";width:18px;height:1px;background:var(--line);}
.pay-steps li.is-done{background:#eaf7ee;color:var(--green-700);border-color:#cbe9d4;}
.pay-steps li.is-now{background:var(--green-50);color:var(--green-800);border-color:var(--green-200);}
.pay-redirect-note{display:flex;align-items:center;justify-content:center;gap:.4rem;font-size:.78rem;color:var(--muted);margin:1.4rem 0 0;}
.pay-redirect-note svg{flex:none;color:var(--green-600);}

/* ── COD confirmation ─────────────────────────────────────────────────── */
.done-wrap{max-width:660px;margin:0 auto;}
.done-card{
  background:#fff;border:1px solid var(--line);border-radius:var(--radius);
  padding:2.6rem 2rem;box-shadow:var(--shadow-md);text-align:center;
}
.done-tick{
  width:78px;height:78px;margin:0 auto 1.1rem;border-radius:50%;
  display:grid;place-items:center;color:#fff;background:var(--green-600);
  box-shadow:0 0 0 8px rgba(29,153,65,.12);
}
.done-card .kicker{justify-content:center;margin:0;}
.done-card h1{font-size:clamp(1.4rem,3vw,1.85rem);margin:.2rem 0 0;color:var(--green-900);}
.done-sub{margin:.7rem 0 0;color:var(--muted);line-height:1.7;}

.done-facts{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem;
  margin:1.8rem 0 0;text-align:left;
}
.done-fact{
  display:flex;flex-direction:column;gap:.15rem;
  padding:.85rem 1rem;border:1px solid var(--line);border-radius:var(--radius-sm);
  background:#fbfdfc;
}
.done-fact-k{display:flex;align-items:center;gap:.4rem;font-size:.76rem;color:var(--muted);}
.done-fact-k svg{flex:none;color:var(--green-600);}
.done-fact-v{font-weight:700;color:var(--ink);font-size:.95rem;}
.done-fact-total{background:var(--green-50);border-color:var(--green-100);}
.done-fact-total .done-fact-v{color:var(--green-800);font-size:1.1rem;font-weight:800;}

.done-items{
  list-style:none;margin:1.5rem 0 0;padding:1rem 1.1rem;
  border:1px solid var(--line);border-radius:var(--radius-sm);text-align:left;
  display:grid;gap:.5rem;
}
.done-items li{display:flex;justify-content:space-between;gap:1rem;font-size:.88rem;}
.done-item-price{font-weight:700;color:var(--green-800);white-space:nowrap;}

.done-next{
  display:grid;gap:.75rem;margin:1.8rem 0 0;padding:1.2rem 1.1rem;
  background:#fbfdfc;border:1px solid var(--green-100);border-radius:var(--radius-sm);
  text-align:left;counter-reset:dn;
}
.done-next li{display:flex;flex-direction:column;gap:.1rem;padding-left:2rem;position:relative;}
.done-next li::before{
  counter-increment:dn;content:counter(dn);
  position:absolute;left:0;top:1px;
  width:20px;height:20px;border-radius:50%;display:grid;place-items:center;
  background:var(--green-700);color:#fff;font-size:.72rem;font-weight:700;
}
.done-next b{color:var(--green-900);font-size:.92rem;}
.done-next span{color:var(--muted);font-size:.84rem;line-height:1.6;}

.done-actions{display:flex;gap:.7rem;justify-content:center;flex-wrap:wrap;margin-top:1.9rem;}

/* ════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════════ */
@media (max-width:960px){
  .cart-trust{grid-template-columns:repeat(2,minmax(0,1fr));}
}

@media (max-width:760px){
  .ci{grid-template-columns:80px minmax(0,1fr);gap:.9rem;padding:.95rem;}
  .ci-media img{width:80px;height:80px;}
  .ci-total{grid-column:2;align-items:flex-end;flex-direction:row;gap:.5rem;justify-self:end;}
  .ci-total-label{display:none;}   /* "Subtotal" is unambiguous this late */
}

@media (max-width:640px){
  .cart-head{align-items:flex-start;}
  .cart-trust{grid-template-columns:minmax(0,1fr);padding:1rem;}
  .co-steps li + li::before{width:14px;}
  .co-section{padding:1.1rem 1rem 1.15rem;}
  .done-facts{grid-template-columns:minmax(0,1fr);}
  .done-card,.pay-redirect-card{padding:2rem 1.25rem;}
  .pay-steps li + li::before{display:none;}
  .ci-foot{gap:.6rem;}
}
