/* ChaiBD cart page (public/js/chai-cart.js). Uses each website design's own colours; follows light/dark mode. */
@keyframes ct-in { from { opacity: 0; transform: translateY(18px) scale(.98); } }
@keyframes ct-pop { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes ct-tick { from { stroke-dashoffset: 24; } }
@keyframes ct-shine { 0%, 60% { transform: translateX(-130%) skewX(-20deg); } 100% { transform: translateX(260%) skewX(-20deg); } }
@keyframes ct-float { 50% { transform: translateY(-10px) rotate(-4deg); } }
@keyframes ct-orbit { to { transform: rotate(360deg) translateX(66px) rotate(-360deg); } }

.cart-layout.ct-on { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.ct-main { display: grid; gap: 12px; min-width: 0; }

/* tick boxes */
.ct-box { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 2px solid color-mix(in srgb, var(--ink) 25%, transparent); background: var(--card); transition: background .2s, border-color .2s, transform .3s cubic-bezier(.34,1.56,.64,1); }
.ct-box svg { width: 14px; height: 14px; fill: none; stroke: var(--on-accent, #fff); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .25s ease; }
.on > .ct-box, .ct-row-i.on .ct-box, .ct-all.on .ct-box { background: var(--red); border-color: var(--red); animation: ct-pop .35s cubic-bezier(.34,1.56,.64,1); }
.on > .ct-box svg, .ct-row-i.on .ct-box svg, .ct-all.on .ct-box svg { stroke-dashoffset: 0; }

/* top bar of the list */
.ct-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--card-b); }
.ct-all, .ct-del-sel { display: inline-flex; align-items: center; gap: 9px; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.ct-del-sel { color: var(--ink-soft); font-weight: 500; font-size: 13px; gap: 6px; transition: color .2s; }
.ct-del-sel svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ct-del-sel:hover:not(:disabled) { color: #e11d48; } .ct-del-sel:disabled { opacity: .4; cursor: default; }

/* free delivery progress */
.ct-free { padding: 12px 16px; border-radius: 18px; background: linear-gradient(110deg, color-mix(in srgb, var(--red) 8%, var(--card)), var(--card)); border: 1px dashed color-mix(in srgb, var(--red) 40%, var(--card-b)); animation: ct-in .5s both; }
.ct-free[hidden] { display: none; }
.ct-free-t { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.ct-free-t svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--red); stroke-width: 1.8; stroke-linejoin: round; animation: ct-float 2.4s ease-in-out infinite; }
.ct-free-t b { color: var(--red); }
.ct-free-bar { height: 7px; margin-top: 8px; border-radius: 99px; overflow: hidden; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.ct-free-bar i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--red) 70%, #ffb347), var(--red)); transition: width .6s cubic-bezier(.2,.8,.2,1); position: relative; overflow: hidden; }
.ct-free-bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent); animation: ct-shine 2.6s ease-in-out infinite; }
.ct-free.done { border-style: solid; border-color: #22c55e; background: color-mix(in srgb, #22c55e 8%, var(--card)); }
.ct-free.done .ct-free-bar i { background: linear-gradient(90deg, #4ade80, #16a34a); }

/* rows */
.ct-list { display: grid; gap: 10px; }
.ct-row-i { position: relative; border-radius: 20px; overflow: hidden; max-height: 400px; transition: max-height .38s ease, opacity .3s, margin .38s; }
.ct-enter .ct-row-i { animation: ct-in .55s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 70ms); }
.ct-row-i.gone { max-height: 0 !important; opacity: 0; margin-top: -10px; }
.ct-row-i.gone .ct-card { transform: translateX(-110%) !important; transition: transform .35s ease-in !important; }
.ct-acts { position: absolute; inset: 0 0 0 auto; width: 150px; display: grid; grid-template-columns: 1fr 1fr; }
.ct-acts button { border: 0; display: grid; place-content: center; justify-items: center; gap: 4px; font: inherit; font-size: 11.5px; font-weight: 700; color: #fff; cursor: pointer; }
.ct-acts svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ct-a-wish { background: #f59e0b; } .ct-a-del { background: #e11d48; }
.ct-card { position: relative; z-index: 1; display: grid; grid-template-columns: auto 92px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px; background: var(--card); border: 1px solid var(--card-b); border-radius: 20px; transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .3s, border-color .3s, opacity .3s; touch-action: pan-y; }
.ct-row-i:not(.on) .ct-card > :not(.ct-pick) { opacity: .62; transition: opacity .25s; }
.ct-row-i.on .ct-card { border-color: color-mix(in srgb, var(--red) 28%, var(--card-b)); box-shadow: 0 12px 26px -20px color-mix(in srgb, var(--red) 60%, transparent); }
@media (hover: hover) { .ct-card:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -22px rgba(0,0,0,.4); } }
.ct-pick { border: 0; background: none; padding: 6px; margin: -6px; cursor: pointer; }
.ct-img { display: block; width: 92px; height: 92px; border-radius: 14px; overflow: hidden; background: color-mix(in srgb, var(--red) 6%, var(--card)); }
.ct-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.ct-card:hover .ct-img img { transform: scale(1.06); }
.ct-info { display: grid; gap: 4px; min-width: 0; }
.ct-name { font-weight: 600; font-size: 14.5px; line-height: 1.35; color: var(--ink); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ct-name:hover { color: var(--red); }
.ct-opt { justify-self: start; max-width: 100%; font-size: 12px; padding: 3px 9px; border-radius: 8px; color: var(--ink-soft); background: color-mix(in srgb, var(--ink) 5%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-warn { font-size: 12px; font-weight: 600; color: var(--red); }
.ct-row-i.oos .ct-card { filter: grayscale(.6); }
.ct-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }
.ct-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ct-price b { font: 800 17px Poppins, sans-serif; color: var(--red); } .ct-price s { font-size: 12px; color: var(--ink-soft); }
.ct-step { display: inline-flex; align-items: center; border-radius: 99px; background: color-mix(in srgb, var(--ink) 5%, transparent); padding: 3px; }
.ct-step button { width: 30px; height: 30px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--card); color: var(--ink); cursor: pointer; box-shadow: 0 2px 6px -3px rgba(0,0,0,.3); transition: transform .2s cubic-bezier(.34,1.56,.64,1), background .2s, color .2s; }
.ct-step button:active:not(:disabled) { transform: scale(.85); }
.ct-step button:hover:not(:disabled) { background: var(--red); color: var(--on-accent, #fff); }
.ct-step button:disabled { opacity: .35; cursor: default; box-shadow: none; }
.ct-step svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.ct-step b { min-width: 32px; text-align: center; font: 700 15px Poppins, sans-serif; }
.pop { display: inline-block; animation: ct-pop .4s cubic-bezier(.34,1.56,.64,1); }
.ct-side { display: grid; gap: 6px; align-self: start; }
.ct-side button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--card-b); background: none; display: grid; place-items: center; color: var(--ink-soft); cursor: pointer; transition: color .2s, border-color .2s, transform .3s cubic-bezier(.34,1.56,.64,1); }
.ct-side svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ct-x-wish:hover { color: #f59e0b; border-color: #f59e0b; transform: translateY(-2px); } .ct-x-del:hover { color: #e11d48; border-color: #e11d48; transform: rotate(-10deg); }

/* summary */
.ct-sum { position: sticky; top: 96px; display: grid; gap: 10px; padding: 20px; border-radius: 22px; background: var(--card); border: 1px solid var(--card-b); box-shadow: 0 18px 40px -30px rgba(0,0,0,.45); animation: ct-in .6s .15s both; }
.ct-sum h3 { margin: 0 0 4px; font-size: 18px; }
.ct-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-soft); }
.ct-row[hidden] { display: none; }
.ct-row b { color: var(--ink); font-family: Poppins, sans-serif; }
.ct-save-row b, .ct-disc-row b, .ct-ship.free { color: #16a34a !important; }
.ct-cp-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--card-b); background: none; color: var(--ink); font: inherit; font-size: 13.5px; cursor: pointer; }
.ct-cp-toggle svg { width: 17px; height: 17px; fill: none; stroke: var(--red); stroke-width: 1.8; stroke-linejoin: round; }
.ct-cp-toggle span { flex: 1; text-align: left; }
.ct-cp-toggle svg:last-child { stroke: currentColor; transition: transform .3s; } .ct-cp-toggle.open svg:last-child { transform: rotate(90deg); }
.ct-cp { display: flex; gap: 8px; animation: ct-in .3s both; }
.ct-cp[hidden] { display: none; }
.ct-cp input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--card-b); background: var(--bg); color: var(--ink); font: inherit; text-transform: uppercase; outline: none; }
.ct-cp input:focus { border-color: var(--red); }
.ct-cp button { border: 0; border-radius: 12px; padding: 0 14px; background: var(--ink); color: var(--bg); font: inherit; font-weight: 700; cursor: pointer; }
.ct-cp-msg { margin: -2px 0 0; font-size: 12.5px; font-weight: 600; } .ct-cp-msg:empty { display: none; } .ct-cp-msg.bad { color: #e11d48; } .ct-cp-msg.good { color: #16a34a; }
.ct-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 10px; border-top: 1px dashed var(--card-b); font-weight: 700; }
.ct-total b { font: 800 26px Poppins, sans-serif; color: var(--red); }
.ct-min { margin: 0; font-size: 12.5px; color: #e11d48; font-weight: 600; } .ct-min[hidden] { display: none; }
.ct-go { position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border-radius: 16px; text-decoration: none; font-weight: 800; font-size: 15.5px; color: var(--on-accent, #fff); background: var(--red); box-shadow: 0 14px 26px -14px var(--red); transition: transform .25s cubic-bezier(.34,1.56,.64,1), filter .2s, opacity .2s; }
.ct-go::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; z-index: -1; background: linear-gradient(100deg, transparent, rgba(255,255,255,.4), transparent); animation: ct-shine 3.4s 1s ease-in-out infinite; }
.ct-go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s; }
.ct-go:hover { transform: translateY(-2px); } .ct-go:hover svg { transform: translateX(4px); } .ct-go:active { transform: scale(.97); }
.ct-go em { font-style: normal; opacity: .85; }
.ct-go.off { opacity: .5; filter: grayscale(.4); box-shadow: none; } .ct-go.off::before { display: none; }
.ct-more { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; border-radius: 14px; border: 1px solid var(--card-b); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; transition: border-color .2s, color .2s; }
.ct-more svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; } .ct-more:hover { border-color: var(--red); color: var(--red); }
.ct-safe { display: flex; align-items: center; gap: 7px; justify-content: center; font-size: 12px; color: var(--ink-soft); }
.ct-safe svg { width: 15px; height: 15px; fill: none; stroke: #16a34a; stroke-width: 2; }

/* undo */
.ct-undo { position: fixed; left: 50%; bottom: 24px; z-index: 1300; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 11px 12px 11px 18px; border-radius: 16px; background: #1b1b1f; color: #fff; font-size: 14px; box-shadow: 0 18px 40px -16px rgba(0,0,0,.5); animation: ct-in .35s cubic-bezier(.2,1.2,.3,1) both; }
.ct-undo button { border: 0; border-radius: 10px; padding: 7px 12px; background: rgba(255,255,255,.14); color: #ffd23d; font: inherit; font-weight: 700; cursor: pointer; }
.ct-undo.out { opacity: 0; transform: translate(-50%, 12px); transition: .3s; }

/* empty cart */
.cart-layout.ct-empty-on { display: block; }
.ct-empty { display: grid; justify-items: center; gap: 8px; padding: 40px 16px 30px; text-align: center; border-radius: 24px; background: var(--card); border: 1px solid var(--card-b); animation: ct-in .5s both; }
.ct-empty-art { position: relative; width: 150px; height: 150px; display: grid; place-items: center; margin-bottom: 6px; }
.ct-empty-art::before { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--red) 16%, transparent), transparent 70%); }
.ct-e-cart { position: relative; width: 74px; height: 74px; border-radius: 22px; display: grid; place-items: center; background: var(--red); color: var(--on-accent, #fff); box-shadow: 0 18px 30px -14px var(--red); animation: ct-float 3s ease-in-out infinite; }
.ct-e-cart svg { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ct-empty-art i { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: color-mix(in srgb, var(--red) 55%, #ffb347); animation: ct-orbit 6s linear infinite; }
.ct-empty-art i:nth-child(3) { animation-duration: 8s; animation-direction: reverse; width: 7px; height: 7px; background: var(--amber, #f2b705); }
.ct-empty-art i:nth-child(4) { animation-duration: 10s; width: 6px; height: 6px; opacity: .6; }
.ct-empty h3 { margin: 0; font-size: 20px; } .ct-empty p { margin: 0 0 10px; max-width: 380px; color: var(--ink-soft); font-size: 14px; }
.ct-empty .ct-go { padding: 13px 26px; }

/* phones and tablets: a checkout bar at the bottom (above the site's bottom bar on phones) */
.ct-bar { display: none; }
@media (max-width: 1100px) {
  .cart-layout.ct-on { grid-template-columns: minmax(0, 1fr); }
  .ct-sum { position: static; }
  .ct-bar { display: flex; align-items: center; gap: 10px; position: fixed; left: 8px; right: 8px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 860; padding: 8px 8px 8px 14px; border-radius: 20px; background: color-mix(in srgb, var(--card) 94%, transparent); border: 1px solid var(--card-b); box-shadow: 0 18px 40px -18px rgba(0,0,0,.45); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); animation: ct-in .5s .2s cubic-bezier(.2,1.1,.3,1) both; }
  .ct-bar .ct-all { font-size: 13px; gap: 7px; }
  .ct-bar-t { flex: 1; min-width: 0; display: grid; text-align: right; line-height: 1.2; font-size: 13px; }
  .ct-bar-t b { font: 800 19px Poppins, sans-serif; color: var(--red); }
  .ct-bar-s { font-size: 11px; color: #16a34a; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ct-bar .ct-go { flex: none; padding: 12px 18px; border-radius: 14px; font-size: 14.5px; }
  html.ct-page body { padding-bottom: 150px; }
  html.ct-page .cw-fab { transform: translateY(-74px); }
}
@media (min-width: 981px) and (max-width: 1100px) { .ct-bar { bottom: 14px; left: 50%; right: auto; transform: translateX(-50%); width: min(760px, calc(100% - 28px)); } html.ct-page body { padding-bottom: 90px; } }
@media (max-width: 620px) {
  .ct-card { grid-template-columns: auto 78px minmax(0, 1fr); gap: 10px; padding: 12px; }
  .ct-img { width: 78px; height: 78px; border-radius: 12px; }
  /* phones: the remove button stays in sight at the card's corner (swiping still works) */
  .ct-card { position: relative; }
  .ct-side { display: grid; position: absolute; top: 8px; right: 8px; }
  .ct-side .ct-x-wish { display: none; }
  .ct-side button { width: 30px; height: 30px; border-radius: 9px; color: #e11d48; border-color: color-mix(in srgb, #e11d48 30%, transparent); background: color-mix(in srgb, #e11d48 6%, var(--card)); }
  .ct-info { padding-right: 32px; }
  .ct-name { font-size: 13.5px; }
  .ct-price b { font-size: 16px; }
  .ct-step button { width: 28px; height: 28px; } .ct-step b { min-width: 26px; font-size: 14px; }
  .ct-head { padding: 10px 14px; }
  .ct-sum { padding: 16px; }
  .ct-sum .ct-go, .ct-sum .ct-more, .ct-sum .ct-safe { display: none; }
}
@media (min-width: 621px) { .ct-acts { display: none; } }
@media (prefers-reduced-motion: reduce) { .ct-free-t svg, .ct-free-bar i::after, .ct-go::before, .ct-e-cart, .ct-empty-art i, .ct-enter .ct-row-i { animation: none !important; } }
@media (max-width: 1100px) { .ct-undo { bottom: calc(150px + env(safe-area-inset-bottom)); } }
@media (min-width: 981px) and (max-width: 1100px) { .ct-undo { bottom: 90px; } }
/* phones: no search bar or category row on this page — just the logo row */
@media (max-width: 720px) {
  header.main form.search, header.main .sx, nav.catnav { display: none !important; }
  header.main .wrap { row-gap: 0 !important; grid-template-rows: auto !important; padding-bottom: 8px; }
}
/* tighter page: less space above the breadcrumb and above the footer */
body > section:first-of-type { padding-top: 10px !important; }
body > section:last-of-type { padding-bottom: 14px !important; }
html body > footer { margin-top: 8px !important; }
html body > footer > .wrap { padding-top: 18px !important; }
@media (min-width: 1101px) { body > section:first-of-type { padding-top: 18px !important; } html body > footer > .wrap { padding-top: 36px !important; } }
@media (max-width: 1100px) { html body > footer > .wrap { padding-top: 4px !important; } }

/* wholesale: the shipping estimate, "the rest" with when and how much weight under it */
.ct-cg-row { align-items: flex-start; } .ct-cg-n { display: grid; } .ct-cg-n small { font-size: 12px; color: var(--ink-soft); font-weight: 500; }
.ct-cg-row b { white-space: nowrap; }
