/* qlean.co cart drawer + /cart page (Paper board 04, ported from qlean-theme qo-cart.css). Mobile-first, site tokens. */

/* ---------- drawer shell ---------- */
.qc-drawer { position: fixed; inset: 0; z-index: 60; display: block; }
.qc-drawer[hidden] { display: none !important; }
.qc-overlay { position: absolute; inset: 0; background: rgba(28, 28, 28, .45); opacity: 0; transition: opacity .25s ease; }
.qc-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(92vw, 440px); max-width: 100%; background: #fff; display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(28, 28, 28, .12); transform: translateX(100%); transition: transform .26s ease; outline: none; font-family: var(--font); color: var(--ink); }
.qc-drawer.is-open .qc-overlay { opacity: 1; }
.qc-drawer.is-open .qc-panel { transform: none; }
@media (prefers-reduced-motion: reduce) { .qc-overlay, .qc-panel { transition: none; } }

.qc-head { display: flex; align-items: baseline; gap: 10px; padding: 18px 16px 14px 20px; border-bottom: 1px solid var(--rule); flex: none; }
.qc-head__title { margin: 0; color: var(--ruby); font: 700 18px/1.2 var(--font); letter-spacing: 0; text-transform: none; }
.qc-count { color: var(--soft); font: 500 14px/1.2 var(--font); }
.qc-x { margin-left: auto; align-self: center; display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--ruby); cursor: pointer; }
.qc-x:hover { background: var(--blush); }
.qc-x:focus-visible, .qc-panel :focus-visible { outline: 2px solid var(--ruby); outline-offset: 2px; }

.qc-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 20px 16px; }
.qc-foot { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--rule); background: #fff; }
.qc-foot[hidden] { display: none; }

/* ---------- reassurance strip + free-shipping bar ---------- */
.qc-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; padding: 10px 0; color: var(--ruby); font: 600 12px/1.3 var(--font); }
.qc-strip span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.qc-ship { padding: 4px 0 12px; }
.qc-ship__row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.qc-ship__text { color: var(--ink); font: 500 13px/1.35 var(--font); min-width: 0; }
.qc-ship__goal { color: var(--soft); font: 600 12px/1 var(--font); flex: none; }
.qc-ship__track { display: block; height: 8px; border-radius: 99px; background: var(--rule); overflow: hidden; }
.qc-ship__fill { display: block; height: 100%; border-radius: inherit; background: var(--ruby); transition: width .3s ease; }

/* TBYB single-unit note (same hooks as tbyb-cart-lock.js) */
.qc-tbyb-note { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 9px 12px; border-radius: var(--radius); background: var(--blush); color: var(--ruby); font: 600 12.5px/1.35 var(--font); }
.qc-tbyb-note[hidden] { display: none; }
.qc-tbyb-note svg { flex: none; }
.tbyb-trial-note--flash { animation: qc-flash .9s ease; }
@keyframes qc-flash { 0%, 100% { box-shadow: 0 0 0 0 rgba(131, 20, 34, 0); } 30% { box-shadow: 0 0 0 4px rgba(131, 20, 34, .18); } }

.qc-error { margin: 8px 0; padding: 8px 12px; border-radius: var(--radius); background: #FDECEC; color: var(--sale); font: 500 13px/1.4 var(--font); }

/* ---------- line items ---------- */
.qc-lines { list-style: none; margin: 0; padding: 0; }
.qc-line { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--rule); transition: opacity .2s; }
.qc-line:first-child { border-top: 0; }
.qc-line.is-busy, .qc-row.is-busy, .qc-upgrade.is-busy { opacity: .55; pointer-events: none; }
.qc-line__img { display: block; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; background: var(--cream); }
.qc-line__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qc-line__info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.qc-line__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.qc-line__title { color: var(--ruby); font: 700 14px/1.3 var(--font); text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.qc-line__title:hover { text-decoration: underline; }
.qc-line__price { display: flex; flex-direction: column; align-items: flex-end; flex: none; font: 700 14px/1.3 var(--font); color: var(--ink); }
.qc-line__price s { color: var(--strike); font-weight: 500; font-size: 12px; }
.qc-line__variant { margin: 0; color: var(--soft); font: 500 12px/1.3 var(--font); text-transform: uppercase; letter-spacing: .02em; }
.qc-line__pill { align-self: flex-start; max-width: 100%; margin: 2px 0 0; padding: 4px 9px; border-radius: 99px; background: var(--ruby); color: #fff; font: 700 10px/1.3 var(--font); letter-spacing: .03em; }
.qc-line__props { list-style: none; margin: 0; padding: 0; color: var(--soft); font: 400 12px/1.4 var(--font); overflow-wrap: anywhere; }
.qc-plan select { width: 100%; max-width: 240px; min-height: 34px; padding: 5px 30px 5px 12px; border: 1px solid var(--rule-2); border-radius: 99px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23831422' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center; color: var(--ink); font: 500 12.5px/1.2 var(--font); appearance: none; -webkit-appearance: none; cursor: pointer; }
.qc-line__actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.qc-qty { display: inline-flex; align-items: center; height: 36px; border: 1px solid var(--rule-2); border-radius: 99px; overflow: hidden; }
.qc-qty button { display: inline-grid; place-items: center; width: 36px; height: 100%; border: 0; background: transparent; color: var(--ruby); cursor: pointer; }
.qc-qty button:hover { background: var(--blush); }
.qc-qty input { width: 34px; height: 100%; border: 0; padding: 0; text-align: center; font: 600 14px/1 var(--font); color: var(--ink); background: transparent; -moz-appearance: textfield; }
.qc-qty input::-webkit-outer-spin-button, .qc-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qc-trialqty { color: var(--soft); font: 500 12.5px/1.3 var(--font); }
.qc-remove { padding: 6px 0; border: 0; background: none; color: var(--soft); font: 500 12.5px/1 var(--font); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.qc-remove:hover { color: var(--ruby); }

/* ---------- upgrade band ---------- */
.qc-upgrade { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px 12px; margin: 6px 0 12px; padding: 12px; border: 1.5px solid var(--ruby); border-radius: 12px; background: var(--blush); }
.qc-upgrade__art { display: flex; }
.qc-upgrade__art img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #fff; border: 2px solid var(--blush); }
.qc-upgrade__art img + img { margin-left: -14px; }
.qc-upgrade__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.qc-upgrade__title { color: var(--ruby); font: 700 13.5px/1.3 var(--font); }
.qc-upgrade__sub { color: var(--soft); font: 400 12px/1.4 var(--font); }
.qc-upgrade__btn { grid-column: 1 / -1; min-height: 40px; border: 0; border-radius: var(--radius-btn); background: var(--ruby); color: #fff; font: italic 800 12px/1 var(--font); letter-spacing: .06em; cursor: pointer; }
.qc-upgrade__btn:hover { background: var(--ruby-deep); }
@media (min-width: 420px) { .qc-upgrade { grid-template-columns: auto minmax(0, 1fr) auto; } .qc-upgrade__btn { grid-column: auto; padding: 0 16px; } }

.qc-stock { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; color: var(--ink); font: 500 12.5px/1.3 var(--font); }
.qc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(26, 143, 74, .16); flex: none; }

/* ---------- complete the routine ---------- */
.qc-routine { margin: 0 -20px -16px; padding: 16px 20px 18px; background: var(--cream); }
.qc-routine__title { margin: 0; color: var(--ruby); font: 800 13px/1.2 var(--font); letter-spacing: .06em; }
.qc-routine__sub { margin: 4px 0 12px; color: var(--soft); font: 400 12.5px/1.4 var(--font); }
.qc-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; background: #fff; transition: opacity .2s; }
.qc-row + .qc-row { margin-top: 8px; }
.qc-row__img { display: block; width: 52px; height: 52px; border-radius: 8px; overflow: hidden; background: var(--cream); }
.qc-row__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qc-row__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.qc-row__name { color: var(--ruby); font: 700 13px/1.25 var(--font); overflow-wrap: anywhere; }
.qc-row__sub { color: var(--soft); font: 400 11.5px/1.3 var(--font); }
.qc-row__sub:empty { display: none; }
.qc-row__price { color: var(--sunset); font: 700 13px/1.2 var(--font); }
.qc-add { min-height: 34px; padding: 0 14px; border: 1.3px solid var(--ruby); border-radius: var(--radius-btn); background: #fff; color: var(--ruby); font: italic 800 10px/1 var(--font); letter-spacing: .06em; white-space: nowrap; cursor: pointer; }
.qc-add:hover { background: var(--ruby); color: #fff; }

/* ---------- totals + checkout + footer ---------- */
.qc-totals { display: flex; flex-direction: column; gap: 6px; }
.qc-totals__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qc-totals__row--subtotal { color: var(--ink); font: 600 15px/1.2 var(--font); }
.qc-totals__subtotal { color: var(--ruby); font: 700 20px/1.2 var(--font); }
.qc-totals__row--save { color: var(--sunset); font: 600 13px/1.2 var(--font); }
.qc-totals__row--save span:last-child { font-weight: 700; }
.qc-totals__row--shipping { color: var(--soft); font: 400 13px/1.2 var(--font); }
.qc-totals__shipping { color: var(--ink); font-weight: 700; }
.qc-checkout { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 58px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--ruby); color: #fff; font: 700 16px/1 var(--font); letter-spacing: .02em; text-transform: uppercase; cursor: pointer; transition: background .2s; }
.qc-checkout:hover { background: var(--ruby-deep); }
.qc-checkout__sep { width: 4px; height: 4px; background: currentColor; opacity: .7; }
.qc-pay { list-style: none; margin: 0; padding: 2px 0 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: center; justify-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.qc-pay li { display: block; width: 100%; max-width: 38px; min-width: 0; }
.qc-pay__icon { display: block; width: 100%; height: auto; aspect-ratio: 38 / 24; }
.qc-under { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.qc-under p { margin: 0; color: var(--soft); font: 400 12px/17px var(--font); }

/* ---------- narrow / short phones: keep the trust strip on one line and the footer compact,
   so the drawer's line items keep most of the screen ---------- */
@media (max-width: 389px) {
  .qc-drawer .qc-strip { gap: 6px 12px; font-size: 11px; }
  .qc-drawer .qc-strip svg { width: 10px; height: 10px; }
}
@media (max-height: 760px) {
  .qc-foot { gap: 7px; padding-top: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .qc-foot .qc-totals { gap: 3px; }
  .qc-foot .qc-checkout { min-height: 50px; }
  .qc-foot .qc-under p { font-size: 11px; line-height: 15px; }
}

/* ---------- empty state ---------- */
.qc-empty { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 48px 0; text-align: center; }
.qc-empty__title { margin: 0; color: var(--ruby); font: 600 18px/1.3 var(--font); }

/* ---------- /cart page ---------- */
#cart-page-root { min-width: 0; }
/* site.css `.q-page { padding: 40px 0 72px }` zeroes .container's side gutter; restore it on /cart only */
.q-page.container:has(> #cart-page-root) { padding-left: var(--gutter); padding-right: var(--gutter); }
.qc-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.qc-page__main, .qc-page__side { min-width: 0; }
.qc-page .qc-strip { justify-content: flex-start; padding-top: 0; }
.qc-lines--page { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.qc-lines--page .qc-line:first-child { border-top: 0; }
.qc-summary { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; }
.qc-page__side .qc-stock { margin-top: 14px; }
.qc-page__side .qc-routine { margin: 0; border-radius: var(--radius); }
@media (min-width: 700px) {
  .qc-lines--page .qc-line { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; }
  .qc-lines--page .qc-line__img { width: 96px; height: 96px; }
  .qc-lines--page .qc-line__title { font-size: 15px; }
}
@media (min-width: 1000px) {
  .qc-page { grid-template-columns: minmax(0, 1fr) 380px; gap: 48px; align-items: start; }
  .qc-page__side { position: sticky; top: calc(var(--header-h, 93px) + 20px); }
}
