/* upsell-drawer.css — post-add-to-cart slide-in upsell drawer styles */

/* ── Overlay ── */
#upsellOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 10000;
  transition: opacity .25s;
  opacity: 0;
}
#upsellOverlay.open {
  display: block;
  opacity: 1;
}

/* ── Drawer ── */
#upsellDrawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 100vw);
  background: #fff;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 32px rgba(15,23,42,.18);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
#upsellDrawer.open {
  transform: translateX(0);
}

/* ── Free-shipping progress bar ── */
.upsell-shipping-bar {
  background: #0f172a;
  color: #e2e8f0;
  padding: 10px 20px;
  font-size: .8rem;
  font-weight: 600;
  text-align: center;
}
.upsell-shipping-bar .bar-track {
  height: 6px;
  background: rgba(255,255,255,.15);
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}
.upsell-shipping-bar .bar-fill {
  height: 100%;
  background: #22d3ee;
  border-radius: 3px;
  transition: width .4s ease;
}
.upsell-shipping-bar.unlocked {
  background: #064e3b;
  color: #a7f3d0;
}

/* ── Header ── */
.upsell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 12px;
  border-bottom: 1px solid #e2e8f0;
  gap: 8px;
}
.upsell-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}
.upsell-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color .15s;
}
.upsell-close-btn:hover { color: #0f172a; }

/* ── Added confirmation ── */
.upsell-added-confirm {
  background: #f0fdf4;
  border-bottom: 1px solid #bbf7d0;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .85rem;
  color: #15803d;
  font-weight: 600;
}
.upsell-added-img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: #e2e8f0;
  flex-shrink: 0;
}

/* ── Scrollable body ── */
.upsell-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 16px;
}

/* ── Mini-cart in drawer ── */
.upsell-mini-cart {
  padding: 14px 20px;
  border-bottom: 1px solid #f1f5f9;
}
.upsell-mini-cart h3 {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
  margin: 0 0 10px;
}
.upsell-mini-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.upsell-mini-item-name {
  flex: 1;
  font-size: .83rem;
  color: #374151;
  line-height: 1.3;
}
.upsell-mini-item-meta {
  font-size: .8rem;
  color: #94a3b8;
  white-space: nowrap;
}
.upsell-mini-total {
  display: flex;
  justify-content: space-between;
  padding: 8px 0 0;
  border-top: 1px solid #f1f5f9;
  margin-top: 8px;
  font-size: .85rem;
  font-weight: 700;
  color: #0f172a;
}

/* ── Upsell recommendation ── */
.upsell-rec-section {
  padding: 16px 20px;
}
.upsell-rec-section h3 {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
  margin: 0 0 12px;
}
.upsell-rec-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
}
.upsell-rec-img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: #e2e8f0;
  flex-shrink: 0;
}
.upsell-rec-img-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.upsell-rec-info {
  flex: 1;
  min-width: 0;
}
.upsell-rec-name {
  font-size: .88rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.upsell-rec-price {
  font-size: .85rem;
  color: #475569;
  font-weight: 500;
}
.upsell-rec-add-btn {
  background: #0f172a;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
  flex-shrink: 0;
}
.upsell-rec-add-btn:hover { background: #1e293b; }
.upsell-rec-add-btn.added { background: #16a34a; }

/* ── Footer CTAs ── */
.upsell-footer {
  padding: 14px 20px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.upsell-checkout-btn {
  display: block;
  background: #FF6B35;
  color: #fff;
  text-align: center;
  font-weight: 700;
  font-size: .95rem;
  padding: 14px;
  border-radius: 10px;
  text-decoration: none;
  transition: background .15s;
}
.upsell-checkout-btn:hover { background: #e55a24; }
.upsell-continue-btn {
  display: block;
  text-align: center;
  font-size: .85rem;
  color: #475569;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  font-family: inherit;
  transition: color .15s;
}
.upsell-continue-btn:hover { color: #0f172a; }

/* ── Mobile tweak ── */
@media (max-width: 420px) {
  #upsellDrawer { width: 100vw; }
  .upsell-rec-card { flex-wrap: wrap; }
}
