/* Qbit side cart drawer — the page is pushed left while the drawer is open */
:root {
  --qc-w: 420px;
  --qc-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --qc-dur: 420ms;
}
@media (max-width: 600px) {
  :root { --qc-w: min(88vw, 420px); }
}

/* ---------- push: every top-level page block moves left by the drawer width ---------- */
html.qc-anim body > :not(script):not(style):not(link):not(.qc-drawer):not(.qc-backdrop):not(.qbitik-root) {
  transition: translate var(--qc-dur) var(--qc-ease) !important;
}
html.qc-open body > :not(script):not(style):not(link):not(.qc-drawer):not(.qc-backdrop):not(.qbitik-root) {
  translate: calc(-1 * var(--qc-w)) 0;
}
html.qc-open, html.qc-open body { overflow-x: clip; }

/* chat widget sits exactly where the drawer opens: hide it meanwhile */
.qbitik-root { transition: opacity 200ms ease, visibility 0s linear 0s; }
html.qc-open .qbitik-root { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 150ms ease, visibility 0s linear 150ms; }

/* ---------- backdrop over the visible (pushed) part of the page ---------- */
.qc-backdrop {
  position: fixed;
  inset: 0 var(--qc-w) 0 0;
  z-index: 100000;
  background: rgba(10, 30, 48, 0.32);
  opacity: 0;
  visibility: hidden;
  cursor: pointer;
  transition: opacity var(--qc-dur) var(--qc-ease), visibility 0s linear var(--qc-dur);
}
html.qc-open .qc-backdrop {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--qc-dur) var(--qc-ease), visibility 0s;
}

/* ---------- drawer ---------- */
.qc-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100001;
  width: var(--qc-w);
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  background: var(--qb-surface, #fff);
  color: var(--qb-ink, #162033);
  border-left: 1px solid var(--qb-line, #e7ebf1);
  box-shadow: -18px 0 48px rgba(16, 36, 58, 0.14);
  translate: 100% 0;
  visibility: hidden;
  transition: translate var(--qc-dur) var(--qc-ease), visibility 0s linear var(--qc-dur);
  font-size: 14px;
  line-height: 1.35;
  outline: none;
}
html.qc-open .qc-drawer {
  translate: 0 0;
  visibility: visible;
  transition: translate var(--qc-dur) var(--qc-ease), visibility 0s;
}

.qc-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--qb-line, #e7ebf1);
}
.qc-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--qb-navy, #0e4568);
}
.qc-badge {
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--qb-orange, #e24a22);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.qc-badge:empty { display: none; }
.qc-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: var(--qb-soft, #eef3f8);
  color: var(--qb-navy, #0e4568);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.qc-close:hover, .qc-close:focus-visible { background: var(--qb-navy, #0e4568); color: #fff; }

.qc-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 20px 12px;
  scrollbar-width: thin;
}

/* ---------- item ---------- */
.qc-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--qb-line, #e7ebf1);
  transition: opacity .25s ease, max-height .3s var(--qc-ease), padding .3s var(--qc-ease);
  max-height: 260px;
  overflow: hidden;
}
.qc-item:last-child { border-bottom: 0; }
.qc-item.qc-removing { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; }
.qc-item.qc-busy { opacity: .6; pointer-events: none; }

.qc-img {
  width: 72px;
  height: 72px;
  border: 1px solid var(--qb-line, #e7ebf1);
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.qc-img img { width: 64px; height: 64px; object-fit: contain; }

.qc-info { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.qc-name {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.qc-name:hover { color: var(--qb-navy, #0e4568); text-decoration: underline; }
.qc-unit { font-size: 13px; color: var(--qb-muted, #5e6b7c); }
.qc-unit s { margin-left: 6px; }

.qc-row2 { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }
.qc-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--qb-line, #e7ebf1);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.qc-qty button {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--qb-navy, #0e4568);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.qc-qty button:hover:not(:disabled) { background: var(--qb-soft, #eef3f8); }
.qc-qty button:disabled { color: #c3cbd6; cursor: not-allowed; }
.qc-qty input {
  width: 40px;
  height: 32px;
  border: 0;
  border-left: 1px solid var(--qb-line, #e7ebf1);
  border-right: 1px solid var(--qb-line, #e7ebf1);
  text-align: center;
  font: inherit;
  font-weight: 600;
  color: inherit;
  background: #fff;
  -moz-appearance: textfield;
}
.qc-qty input::-webkit-outer-spin-button, .qc-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qc-qty input:focus { outline: 2px solid rgba(14, 69, 104, .25); outline-offset: -2px; }
.qc-line { font-weight: 700; color: var(--qb-navy, #0e4568); white-space: nowrap; }
.qc-maxnote { font-size: 12px; color: var(--qb-orange-deep, #c73c16); }

.qc-remove {
  align-self: start;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--qb-muted, #5e6b7c);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qc-remove:hover, .qc-remove:focus-visible { background: #fdecea; color: var(--qb-orange-deep, #c73c16); }
.qc-remove svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- footer ---------- */
.qc-foot {
  flex: 0 0 auto;
  padding: 14px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--qb-line, #e7ebf1);
  background: var(--qb-bg, #f5f7fa);
}
.qc-sum { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 6px; color: var(--qb-muted, #5e6b7c); }
.qc-sum b { color: var(--qb-ink, #162033); font-weight: 600; }
.qc-sum.qc-save b { color: var(--qb-orange-deep, #c73c16); }
.qc-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 10px 0 4px;
  padding-top: 10px;
  border-top: 1px dashed #d5dce6;
  font-size: 16px;
  font-weight: 700;
}
.qc-total b { font-size: 22px; color: var(--qb-navy, #0e4568); }
.qc-note { margin: 0 0 12px; font-size: 12px; color: var(--qb-muted, #5e6b7c); }
.qc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none !important;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.qc-btn-primary { background: var(--qb-orange, #e24a22); color: #fff !important; border: 0; }
.qc-btn-primary:hover, .qc-btn-primary:focus-visible { background: var(--qb-orange-deep, #c73c16); }
.qc-btn-secondary {
  margin-top: 8px;
  background: transparent;
  color: var(--qb-navy, #0e4568) !important;
  border: 1px solid #cfd8e3;
  min-height: 44px;
  font-weight: 600;
}
.qc-btn-secondary:hover, .qc-btn-secondary:focus-visible { border-color: var(--qb-navy, #0e4568); background: #fff; }

.qc-error { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: #fdecea; color: var(--qb-orange-deep, #c73c16); font-size: 13px; }

/* ---------- empty & loading ---------- */
.qc-empty { text-align: center; padding: 36px 6px 10px; }
.qc-empty svg { width: 64px; height: 64px; fill: none; stroke: #b9c4d2; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.qc-empty h3 { margin: 12px 0 4px; font-size: 18px; color: var(--qb-navy, #0e4568); }
.qc-empty p { margin: 0 0 18px; color: var(--qb-muted, #5e6b7c); }
.qc-pop-title { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--qb-muted, #5e6b7c); margin: 8px 0 10px; }
.qc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.qc-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--qb-line, #e7ebf1); color: inherit; text-decoration: none; font-size: 13px; background: #fff;
}
.qc-chip img { width: 20px; height: 20px; object-fit: contain; }
.qc-chip:hover { border-color: var(--qb-navy, #0e4568); color: var(--qb-navy, #0e4568); text-decoration: none; }

.qc-skel { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 14px 0; }
.qc-skel i { display: block; border-radius: 8px; background: linear-gradient(90deg, #eef2f6 25%, #f7f9fb 50%, #eef2f6 75%); background-size: 200% 100%; animation: qc-shimmer 1.2s infinite; }
.qc-skel i:first-child { height: 72px; }
.qc-skel span { display: flex; flex-direction: column; gap: 8px; }
.qc-skel span i { height: 12px; }
.qc-skel span i:last-child { width: 50%; }
@keyframes qc-shimmer { to { background-position: -200% 0; } }

@media (max-width: 600px) {
  .qc-head { padding: 14px 16px 12px; }
  .qc-body { padding: 4px 16px 10px; }
  .qc-foot { padding-left: 16px; padding-right: 16px; }
  .qc-item { grid-template-columns: 60px 1fr auto; gap: 10px; }
  .qc-img { width: 60px; height: 60px; }
  .qc-img img { width: 54px; height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --qc-dur: 1ms; }
}

/* =================== Gifts by steps (drawer + /cart page) =================== */
.qg-slot:empty, .qg-slot[hidden] { display: none; }
.qg-box {
  margin: 12px 0 6px;
  padding: 14px 14px 12px;
  border: 1px solid #f6cbbb;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff7f3 0%, #fff 100%);
}
.qg-box svg { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.qg-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.qg-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--qb-orange-deep, #c73c16); }
.qg-msg { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--qb-ink, #162033); }
.qg-msg b { color: var(--qb-orange-deep, #c73c16); }
.qg-msg-pick { color: var(--qb-orange-deep, #c73c16); font-weight: 600; animation: qg-pulse 1.6s ease-in-out infinite; }
.qg-msg-done { color: #1f8a4c; font-weight: 600; }
@keyframes qg-pulse { 50% { opacity: .55; } }

.qg-track { position: relative; height: 8px; margin: 18px 14px 26px 4px; border-radius: 8px; background: #f1e3dd; }
.qg-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; background: linear-gradient(90deg, #f39a7a, var(--qb-orange, #e24a22)); transition: width .5s var(--qc-ease, ease); }
.qg-mark {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 2px solid #e5cfc6; color: #c9b2a8;
  transition: background .3s, border-color .3s, color .3s;
}
.qg-mark svg { width: 13px; height: 13px; flex-basis: 13px; }
.qg-mark.on { background: var(--qb-orange, #e24a22); border-color: var(--qb-orange, #e24a22); color: #fff; }
.qg-mark-lbl { position: absolute; top: 17px; transform: translateX(-70%); font-size: 11px; color: var(--qb-muted, #5e6b7c); white-space: nowrap; }

.qg-steps { display: flex; flex-direction: column; gap: 10px; }
.qg-step-head { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--qb-ink, #162033); }
.qg-step-head > span:nth-child(2) { flex: 1; min-width: 0; }
.qg-step-n { font-weight: 700; }
.qg-left { font-size: 12px; color: var(--qb-muted, #5e6b7c); white-space: nowrap; }
.qg-left b { color: var(--qb-ink, #162033); }
.qg-pick { color: var(--qb-orange-deep, #c73c16); font-weight: 600; }
.qg-locked .qg-step-head { color: var(--qb-muted, #5e6b7c); }
.qg-upgraded .qg-step-head { color: var(--qb-muted, #5e6b7c); text-decoration: line-through; text-decoration-color: #d7dde5; }
.qg-upgraded .qg-left { text-decoration: none; }
.qg-open .qg-step-head svg { color: var(--qb-orange, #e24a22); }
.qg-has .qg-step-head svg { color: #1f8a4c; }

.qg-peek { display: flex; gap: 6px; margin: 6px 0 0 22px; }
.qg-peek img { width: 30px; height: 30px; object-fit: contain; border-radius: 6px; background: #fff; border: 1px solid #eee; filter: grayscale(1); opacity: .55; }

.qg-cards { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.qg-card {
  flex: 0 0 118px; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 8px 8px; border: 2px solid #ece4e0; border-radius: 12px; background: #fff;
  cursor: pointer; font: inherit; color: inherit; text-align: center;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.qg-card:hover { border-color: #f0a58c; transform: translateY(-1px); }
.qg-card:focus-visible { outline: 3px solid rgba(226, 74, 34, .3); outline-offset: 1px; }
.qg-card.on { border-color: var(--qb-orange, #e24a22); box-shadow: 0 6px 16px rgba(226, 74, 34, .18); }
.qg-card.busy { opacity: .6; pointer-events: none; }
.qg-card-img { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; }
.qg-card-img img { max-width: 64px; max-height: 64px; object-fit: contain; }
.qg-card-name { font-size: 12px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 30px; }
.qg-card-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #fff1eb; color: var(--qb-orange-deep, #c73c16); }
.qg-card.on .qg-card-tag { background: var(--qb-orange, #e24a22); color: #fff; }
.qg-card-tag svg { width: 12px; height: 12px; flex-basis: 12px; }

/* footer additions in the drawer */
.qc-sum.qc-gift span { display: inline-flex; align-items: center; gap: 6px; }
.qc-sum.qc-gift svg, .qc-gift-need svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.qc-sum.qc-gift b { color: #1f8a4c; }
.qc-gift-need {
  display: flex; align-items: center; gap: 6px; margin: -4px 0 10px; padding: 8px 10px; border-radius: 8px;
  background: #fff1eb; color: var(--qb-orange-deep, #c73c16); font-size: 13px; font-weight: 600; cursor: pointer;
}

/* /cart page */
.qg-page { margin: 0 0 18px; }
.qg-page .qg-box { margin: 0; padding: 16px 18px 14px; }
.qg-page .qg-card { flex-basis: 140px; }
@media (min-width: 900px) { .qg-page .qg-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); } }
/* message wraps as normal text */
.qg-msg { display: block; flex: 1 1 200px; text-align: right; }
.qg-msg svg { vertical-align: -3px; margin-right: 4px; }
.qg-card-tag { white-space: nowrap; }

/* account: order history gifts */
.qg-account-gifts { margin: 10px 0; padding: 10px 12px; border: 1px dashed #f0a58c; border-radius: 10px; background: #fff8f5; }
.qg-account-title { font-weight: 700; color: var(--qb-orange-deep, #c73c16); margin-bottom: 6px; }
.qg-account-item { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.qg-account-item img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid #eee; }
.qg-account-item span { flex: 1; }
.qg-account-item b { color: #1f8a4c; font-size: 13px; }

/* checkout button: green */
.qc-btn-primary { background: #1f9d55; }
.qc-btn-primary:hover, .qc-btn-primary:focus-visible { background: #17834a; }
