/* =====================================================================
   Floating cart redesign  (Sigma Guys)
   Adapted from the "Your Cart" mockup. ALL selectors are prefixed with
   #floating-cart so nothing leaks into the rest of the site. Restyles the
   existing functional classes (.product, .quantity-controller, etc.) so the
   JS hooks in main.js keep working.
   ===================================================================== */

#floating-cart {
  --sgc-green: #1ba94c;
  --sgc-green-dark: #0b3b3c;
  --sgc-green-soft: #e8f7ee;
  --sgc-green-soft2: #f1faf4;
  --sgc-ink: #15181c;
  --sgc-muted: #828a93;
  --sgc-line: #ebedf0;
}

/* Panel: compact white cart, full height, flex column so the header,
   scrollable body and sticky footer stack like the mockup. The id+class
   selector outranks the theme's .side---cart width rule. */
#floating-cart.offcanvas {
  width: 420px;
  max-width: 100vw;
  background: #fff;
  display: flex;
  flex-direction: column;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
}
#floating-cart .offcanvas-header {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-bottom: 1px solid var(--sgc-line);
}

/* keep top (rewards) + footer fixed, items scroll */
#floating-cart .offcanvas-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  position: relative;
  min-height: 0;
}
#floating-cart #confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* ===== STICKY TOP: timer + rewards ===== */
#floating-cart .sgc-top {
  flex: 0 0 auto;
  background: #fff;
  border-bottom: 1px solid var(--sgc-line);
}
#floating-cart .reward-card {
  margin: 0 10px 10px;
  border: 1px solid var(--sgc-line);
  border-radius: 11px;
  padding: 11px 12px;
}
#floating-cart .reward-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 8px 16px 10px;
}
#floating-cart .gift-circle {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--sgc-green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}
#floating-cart .reward-head h2 {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 2px;
  line-height: 1.3;
}
#floating-cart .reward-head h2 .hl,
#floating-cart .reward-head .sub .hl {
  color: var(--sgc-green);
  font-weight: 600;
}
#floating-cart .reward-head .sub {
  font-size: 12px;
  margin: 0;
  color: var(--sgc-muted);
}
#floating-cart .progress-wrap {
  position: relative;
  padding: 6px 4px 0;
}
#floating-cart .track {
  position: absolute;
  top: 17px;
  left: 18px;
  right: 18px;
  height: 3.5px;
  background: #e4e7ea;
  border-radius: 999px;
  z-index: 0;
}
#floating-cart .track-fill {
  position: absolute;
  top: 17px;
  left: 18px;
  height: 3.5px;
  background: var(--sgc-green);
  border-radius: 999px;
  z-index: 1;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
#floating-cart .milestones {
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}
#floating-cart .ms {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  text-align: center;
}
#floating-cart .ms .node {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  background: #c4c9cf;
  transition: background 0.3s, transform 0.3s;
}
#floating-cart .ms.active .node {
  background: var(--sgc-green);
}
#floating-cart .ms.justunlocked .node {
  animation: sgcPop 0.6s ease;
}
@keyframes sgcPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.45); }
  100% { transform: scale(1); }
}
#floating-cart .ms .price {
  font-weight: 700;
  font-size: 11px;
  margin-top: 5px;
  color: var(--sgc-ink);
}
#floating-cart .ms.active .price {
  color: var(--sgc-green);
}
#floating-cart .ms .label {
  font-size: 9.5px;
  line-height: 1.2;
  margin-top: 1px;
  color: var(--sgc-muted);
}
#floating-cart .ms .label .free {
  color: var(--sgc-green);
  font-weight: 700;
}

/* ===== SCROLLABLE MIDDLE ===== */
#floating-cart .sgc-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 0 4px;
  min-height: 0;
}
#floating-cart .sgc-scroll::-webkit-scrollbar {
  width: 5px;
}
#floating-cart .sgc-scroll::-webkit-scrollbar-thumb {
  background: #d6d9dd;
  border-radius: 999px;
}

/* When there are more than 2 items, cap the product list and let it scroll on
   its own (the rewards header + footer stay put). ~2.5 cards visible. */
#floating-cart .products.has-scroll {
  max-height: max-content;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}
#floating-cart .products.has-scroll::-webkit-scrollbar {
  width: 5px;
}
#floating-cart .products.has-scroll::-webkit-scrollbar-thumb {
  background: #d6d9dd;
  border-radius: 999px;
}

/* ----- item card (restyles existing .product) ----- */
#floating-cart .products .product {
  margin: 0 2px 10px;
  border: 1px solid var(--sgc-line);
  border-radius: 11px;
  padding: 11px;
  display: flex;
  gap: 10px;
  position: relative;
}
#floating-cart .product .img-container {
  flex: 0 0 64px;
  width: 64px;
  position: relative;
}
#floating-cart .product .img-container img {
  width: 64px;
  height: 74px;
  border-radius: 9px;
  object-fit: cover;
  background: #eef1f4;
}
#floating-cart .product .product-removal {
  position: absolute;
  top: 4px;
  right: 4px;
}
#floating-cart .product .product-removal .remove-product {
  border: none;
  background: none;
  cursor: pointer;
  color: #2b2f36;
  font-size: 14px;
  padding: 2px;
}
#floating-cart .product .product-info {
  flex: 1;
  min-width: 0;
}
#floating-cart .product .product-info h2 {
  font-size: 13.5px;
  font-weight: 700;
  margin: 0;
  line-height: 1.25;
}
#floating-cart .product .product-info h2 a {
  color: var(--sgc-ink);
  text-decoration: none;
}
#floating-cart .product .cart__meta-text {
  font-size: 11px;
  color: var(--sgc-muted);
  margin: 2px 0;
}
#floating-cart .product .product-price p {
  font-size: 13.5px;
  font-weight: 700;
  margin: 2px 0 6px;
}
#floating-cart .product .product-price .line-through {
  text-decoration: line-through;
  color: var(--sgc-muted);
  font-weight: 500;
  font-size: 11px;
  margin-left: 4px;
}
/* qty box (restyles existing .quantity-controller) */
#floating-cart .quantity-controller {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--sgc-line);
  border-radius: 8px;
  overflow: hidden;
}
#floating-cart .quantity-controller button {
  border: none;
  background: #fff;
  width: 28px;
  height: 28px;
  font-size: 14px;
  color: var(--sgc-ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
#floating-cart .quantity-controller button:active {
  background: #f0f1f3;
}
#floating-cart .quantity-controller .product-quantity {
  width: 26px;
  text-align: center;
  font-weight: 600;
  font-size: 12.5px;
  margin: 0;
}
/* Keep the line total in normal flow (its own line). It was absolutely
   positioned, so the theme's "Product Total: " prefix made it overflow the
   card's right edge and get clipped by the scroll container. */
#floating-cart .product .product-line-price {
  position: absolute;
  right: 11px;
  bottom: 11px;
  font-size: 13.5px;
  font-weight: 700;
}

/* ----- free reward gift line ----- */
#floating-cart .product.is-reward-gift {
  background: var(--sgc-green-soft2);
  border-color: #d6efdf;
}
#floating-cart .reward-gift-badge {
  display: inline-block;
  background: var(--sgc-green);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 999px;
  margin: 1px 0 4px;
}
#floating-cart .product .free-tag,
#floating-cart .product.is-reward-gift .product-line-price {
  color: var(--sgc-green);
  font-weight: 800;
}

/* ----- free gift teaser card ----- */
#floating-cart .free-card {
  margin: 0 10px 10px;
  background: var(--sgc-green-soft2);
  border: 1px solid #d6efdf;
  border-radius: 11px;
  padding: 11px;
  display: flex;
  align-items: center;
  gap: 10px;
}
#floating-cart .free-card.locked {
  opacity: 0.6;
  filter: grayscale(0.5);
}
#floating-cart .free-card.disabled {
  opacity: 0.45;
  filter: grayscale(0.85);
  background: #f6f7f8;
  border-color: var(--sgc-line);
}
#floating-cart .free-card.disabled .fc-title {
  text-decoration: line-through;
  color: var(--sgc-muted);
}
#floating-cart .free-card.disabled .fc-price .free {
  color: var(--sgc-muted);
}
#floating-cart .free-card img {
  width: 40px;
  height: 50px;
  object-fit: contain;
  border-radius: 6px;
}
#floating-cart .free-card .fc-price .old {
  text-decoration: line-through;
  color: var(--sgc-muted);
  margin-right: 5px;
  font-size: 11px;
}
#floating-cart .free-card .fc-price .free {
  color: var(--sgc-green);
  font-weight: 800;
  font-size: 12.5px;
}
#floating-cart .free-card .fc-body {
  flex: 1;
}
#floating-cart .free-card .fc-title {
  font-weight: 700;
  font-size: 13px;
}
#floating-cart .free-card .fc-cap {
  font-size: 11px;
  color: var(--sgc-muted);
}
#floating-cart .status-pill {
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
#floating-cart .status-pill.unlocked {
  border: 1.3px solid var(--sgc-green);
  color: var(--sgc-green-dark);
}
#floating-cart .status-pill.lockedpill {
  border: 1.3px solid #c4c9cf;
  color: #9aa0a8;
}
#floating-cart .status-pill.disabledpill {
  border: 1.3px solid #d6d9dd;
  color: #aab0b7;
}

/* ===== STICKY BOTTOM ===== */
#floating-cart .offcanvas-footer {
  flex: 0 0 auto;
  background: #fff;
  border-top: 1px solid var(--sgc-line);
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.05);
}
#floating-cart .addmore-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 12px 4px;
}
#floating-cart .addmore-head h4 {
  font-size: 12.5px;
  font-weight: 700;
  margin: 0;
}
#floating-cart .coupon-row {
  margin: 6px 10px 8px;
  border: 1px solid var(--sgc-line);
  border-radius: 10px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#floating-cart .coupon-row .c-left {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--sgc-muted);
  font-size: 12px;
}
#floating-cart .coupon-row .c-offers {
  color: var(--sgc-green);
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  text-decoration: none;
}
#floating-cart .sgc-footer-bar {
  padding: 4px 12px 11px;
}
#floating-cart .sgc-footer-bar .buy-detail {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin: 2px 0;
}
#floating-cart .sgc-footer-bar .buy-detail.total-line {
  font-weight: 800;
  font-size: 15px;
  border-top: 1px solid var(--sgc-line);
  padding-top: 6px;
  margin-top: 6px;
}
#floating-cart .sgc-footer-bar .saved-line {
  color: var(--sgc-green);
  font-size: 11px;
  font-weight: 600;
  margin: 4px 0 0;
}
#floating-cart .sgc-footer-bar .uni--button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
#floating-cart .empty-msg {
  text-align: center;
  color: var(--sgc-muted);
  font-size: 13px;
  padding: 30px 10px;
}

/* Hide "REPLACED" free-gift cards in the floating cart */
.free-card.disabled { display: none !important; }
.free-card.locked { display: none !important; }
.free-card { display: none !important; }  /* all free-gift cards hidden — the unlocked gift already shows as a cart line */
