/**
 * Quick Cart Shopping - Cart Panel Styles
 *
 * @package Quick Cart Shopping
 * @since 1.0.0
 */

/* ──────────────────────────────────────────────
   Free Shipping Bar — Sticky (page top)
────────────────────────────────────────────── */
.qc-fsb-sticky-spacer {
  height: 0;
  width: 100%;
  flex-shrink: 0;
}

.qc-fsb-sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9997;
  background: #ffffff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

/* Push below WP admin bar when logged in */
.admin-bar .qc-fsb-sticky {
  top: 32px;
}
@media screen and (max-width: 782px) {
  .admin-bar .qc-fsb-sticky {
    top: 46px;
  }
}

.qc-fsb-sticky-track {
  height: 3px;
  background: #e2e8f0;
  overflow: hidden;
}

.qc-fsb-sticky-fill {
  height: 100%;
  border-radius: 0;
  transition: width 0.5s cubic-bezier(.4, 0, .2, 1);
}

.qc-fsb-sticky-inner {
  padding: 8px 20px;
}

.qc-fsb-sticky-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: #475569;
  line-height: 1;
  margin: 0;
}

.qc-fsb-sticky-msg svg {
  color: #94a3b8;
  flex-shrink: 0;
}

.qc-fsb-sticky.qc-fsb--complete .qc-fsb-sticky-msg {
  color: #16a34a;
  font-weight: 600;
}

.qc-fsb-sticky.qc-fsb--complete .qc-fsb-sticky-msg svg {
  color: #16a34a;
}

/* ──────────────────────────────────────────────
   Free Shipping Bar
────────────────────────────────────────────── */
.qc-free-shipping-bar {
  padding: 10px 18px 11px;
  background: #f8fafc;
  border-bottom: 1px solid #e8edf4;
}

.qc-fsb-track {
  height: 7px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 9px;
}

.qc-fsb-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(.4,0,.2,1);
}

.qc-fsb-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: #475569;
  line-height: 1.4;
  margin: 0;
}

.qc-fsb-message svg {
  color: #94a3b8;
  flex-shrink: 0;
}

.qc-fsb-amount {
  font-weight: 700;
}

.qc-fsb--complete .qc-fsb-message {
  color: #16a34a;
  font-weight: 600;
}

.qc-fsb--complete .qc-fsb-message svg {
  color: #16a34a;
}

/* ──────────────────────────────────────────────
   Overlay
────────────────────────────────────────────── */
.qc-cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.qc-cart-overlay.qc-active {
  opacity: 1;
  visibility: visible;
}

/* ──────────────────────────────────────────────
   Panel Base
────────────────────────────────────────────── */
.qc-cart-panel {
  position: fixed;
  background: #f4f6f9;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}
.qc-cart-panel.qc-active {
  pointer-events: auto;
}

/* Side cart */
.qc-cart-panel.qc-cart-side {
  top: 0;
  right: 0;
  bottom: 0;
  max-width: 90vw;
  box-shadow: -6px 0 32px rgba(0, 0, 0, 0.14);
}

/* Push cart below WP admin bar */
.admin-bar .qc-cart-panel.qc-cart-side { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar .qc-cart-panel.qc-cart-side { top: 46px; }
}

/* Popup cart */
.qc-cart-panel.qc-cart-popup {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  max-height: 90vh;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

/* ──────────────────────────────────────────────
   Header  — dark navy
────────────────────────────────────────────── */
.qc-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: #162035;
  flex-shrink: 0;
}

.qc-header-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.qc-cart-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.2px;
}

/* Cart icon wrapper with count badge */
.qc-hdr-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qc-hdr-icon-wrap svg { opacity: 0.9; }

.qc-hdr-cart-badge {
  position: absolute;
  top: -7px;
  right: -9px;
  min-width: 17px;
  height: 17px;
  background: #3b82f6;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  box-sizing: border-box;
  border: 1.5px solid #162035;
  line-height: 1;
}

.qc-cart-item-count {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 400;
  letter-spacing: 0.2px;
}

.qc-cart-close {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.qc-cart-close:hover {
  background: rgba(255, 255, 255, 0.22);
}
.qc-cart-close svg {
  width: 16px;
  height: 16px;
}

/* ──────────────────────────────────────────────
   Body
────────────────────────────────────────────── */
.qc-cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 0;
  background: #f4f6f9;
}

.qc-cart-body::-webkit-scrollbar { width: 5px; }
.qc-cart-body::-webkit-scrollbar-track { background: transparent; }
.qc-cart-body::-webkit-scrollbar-thumb { background: #c8cdd8; border-radius: 3px; }

/* ──────────────────────────────────────────────
   Empty state
────────────────────────────────────────────── */
.qc-cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}
.qc-cart-empty-icon {
  margin-bottom: 20px;
  color: #c5cad4;
  width: 64px;
  height: 64px;
}
.qc-cart-empty-text {
  font-size: 18px;
  font-weight: 700;
  color: #2d3748;
  margin: 0 0 8px;
}
.qc-cart-empty-subtext {
  font-size: 14px;
  color: #8a94a6;
  margin: 0;
  line-height: 1.5;
}

/* ──────────────────────────────────────────────
   Cart items list (card based)
────────────────────────────────────────────── */
.qc-cart-items {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.qc-cart-item + .qc-cart-item {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #eef0f3;
}

.qc-cart-item {
  background: #ffffff;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease;
}
.qc-cart-item:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.09);
}

/* Product image */
.qc-item-img {
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f2f5;
  border: 1px solid #e8eaed;
}
.qc-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Item body */
.qc-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Top row: name + remove */
.qc-item-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.qc-item-info {
  flex: 1;
  min-width: 0;
}
.qc-item-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a2332;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.qc-item-meta {
  font-size: 11.5px;
  color: #8a94a6;
  margin: 3px 0 0;
  font-weight: 400;
}

/* Remove button */
.qc-item-remove {
  background: #f0f2f5;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #9aa3b0;
  width: 22px;
  height: 22px;
  min-width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.qc-item-remove:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* Bottom row: qty stepper + subtotal */
.qc-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Qty stepper */
.qc-cart-item-qty {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  background: #f8f9fb;
}
.qc-qty-btn {
  width: 28px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: #4a5568;
  transition: background 0.15s ease, color 0.15s ease;
  line-height: 1;
}
.qc-qty-btn:hover:not(:disabled) {
  background: #162035;
  color: #ffffff;
}
.qc-qty-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.qc-qty-display {
  min-width: 28px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #2d3748;
  user-select: none;
}

/* Item subtotal */
.qc-item-subtotal {
  font-size: 14px;
  font-weight: 700;
  color: #1a2332;
}

/* ──────────────────────────────────────────────
   Totals section (inside body, below items)
────────────────────────────────────────────── */
.qc-cart-totals-section {
  margin-top: 14px;
  background: #ffffff;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* Coupon input */
.qc-cart-coupon {
  display: flex;
  gap: 0;
  margin-bottom: 14px;
}
.qc-cart-coupon-input {
  flex: 1;
  padding: 9px 13px;
  border: 1.5px solid #e2e8f0;
  border-right: none;
  border-radius: 7px 0 0 7px;
  font-size: 13px;
  color: #2d3748;
  background: #f8f9fb;
  transition: border-color 0.2s ease;
}
.qc-cart-coupon-input::placeholder { color: #9aa3b0; }
.qc-cart-coupon-input:focus {
  outline: none;
  border-color: #162035;
  background: #fff;
}
.qc-cart-coupon-btn {
  padding: 9px 18px;
  background: #162035;
  border: none;
  border-radius: 0 7px 7px 0;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
}
.qc-cart-coupon-btn:hover { background: #0f1928; }
.qc-cart-coupon-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Applied coupon chip */
.qc-cart-coupon-discount {
  margin-bottom: 10px;
}
.qc-coupon-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 20px;
  padding: 5px 10px 5px 8px;
  font-size: 12.5px;
  color: #15803d;
  font-weight: 500;
}
.qc-coupon-chip .qc-coupon-code {
  font-weight: 700;
  color: #166534;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.qc-coupon-chip .qc-cart-coupon-amount {
  color: #15803d;
  font-weight: 600;
}
.qc-coupon-remove {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #16a34a;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transition: all 0.2s ease;
  margin-left: 2px;
}
.qc-coupon-remove:hover {
  background: #bbf7d0;
  color: #dc2626;
}

/* Subtotal / Shipping / Total rows */
.qc-cart-subtotal,
.qc-cart-shipping-row,
.qc-cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
}
.qc-cart-subtotal {
  margin-bottom: 8px;
}
.qc-cart-subtotal-label { font-weight: 600; color: #2d3748; }
.qc-cart-subtotal-amount { font-weight: 600; color: #2d3748; }

/* Shipping section */
.qc-cart-shipping-section { margin-bottom: 0; }
.qc-cart-shipping-row { margin-bottom: 8px; }
.qc-cart-shipping-label { font-weight: 600; color: #2d3748; }
.qc-cart-shipping-amount { font-weight: 600; color: #2d3748; }

.qc-cart-shipping-methods {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 8px;
  padding-left: 4px;
}
.qc-shipping-method {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 5px 0;
}
.qc-shipping-method input[type="radio"] {
  width: 15px;
  height: 15px;
  margin: 0;
  cursor: pointer;
  accent-color: #162035;
}
.qc-shipping-method-label {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: #2d3748;
}
.qc-shipping-method-cost {
  font-size: 13px;
  font-weight: 600;
  color: #2d3748;
}
.qc-cart-shipping-destination {
  font-size: 12px;
  font-weight: 500;
  color: #9aa3b0;
  margin-top: 2px;
  padding-left: 4px;
}
.qc-cart-shipping-destination strong { color: #4a5568; font-weight: 600; }

/* Total row */
.qc-cart-total {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1.5px solid #e8eaed;
  margin-bottom: 0;
}
.qc-cart-total-label {
  font-size: 14px;
  font-weight: 700;
  color: #1a2332;
}
.qc-cart-total-amount {
  font-size: 17px;
  font-weight: 800;
  color: #1a2332;
}

/* ──────────────────────────────────────────────
   Upsell section
────────────────────────────────────────────── */
.qc-upsell-section {
  margin-top: 14px;
  padding-bottom: 4px;
}
.qc-upsell-heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #8a94a6;
  text-align: center;
  margin-bottom: 8px;
}
/* Two compact cards centered — not stretched full width */
.qc-upsell-grid {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 10px;
}
.qc-upsell-card {
  width: 155px;
  flex-shrink: 0;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease;
}
.qc-upsell-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.1); }

/* Image — full card width, fixed height */
.qc-upsell-img-link {
  display: block;
  width: 100%;
  height: 130px;
  background: #f0f2f5;
  flex-shrink: 0;
  margin-bottom: 0;
}
.qc-upsell-img-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.22s ease;
}
.qc-upsell-card:hover .qc-upsell-img-link img { transform: scale(1.06); }

/* Name + price */
.qc-upsell-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px 4px;
  box-sizing: border-box;
  margin-bottom: 0;
}
.qc-upsell-name {
  font-size: 11.5px;
  font-weight: 600;
  color: #1a2332;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.qc-upsell-name:hover { color: #162035; }
.qc-upsell-price {
  font-size: 12px;
  font-weight: 700;
  color: #059669;
}
.qc-upsell-price del { color: #9aa3b0; font-weight: 400; font-size: 10.5px; margin-right: 2px; }
.qc-upsell-price ins { text-decoration: none; }

/* Full-width compact add button at bottom */
.qc-upsell-add {
  width: calc(100% - 20px);
  margin: 4px 10px 10px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #162035;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #ffffff;
  font-size: 19px;
  font-weight: 300;
  line-height: 1;
  transition: background 0.2s ease;
}
.qc-upsell-add:hover { background: #0f1928; }
.qc-upsell-add.loading { opacity: 0.6; cursor: not-allowed; }
.qc-upsell-add.added { background: #059669; }

.qc-loading {
  text-align: center;
  padding: 30px 20px;
  color: #9aa3b0;
  font-size: 13px;
  grid-column: 1 / -1;
}

/* ──────────────────────────────────────────────
   Footer
────────────────────────────────────────────── */
.qc-cart-footer {
  border-top: 1px solid #e2e8f0;
  padding: 14px 14px 16px;
  flex-shrink: 0;
  background: #ffffff;
}

/* Trust badges */
.qc-trust-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}
.qc-trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #8a94a6;
  font-weight: 500;
}
.qc-trust-badge svg { color: #8a94a6; }
.qc-trust-sep {
  color: #d1d5db;
  font-size: 12px;
}

/* Footer buttons */
.qc-cart-footer-buttons {
  display: flex;
  gap: 10px;
  width: 100%;
}
.qc-cart-footer-buttons.qc-single-button {
  flex-direction: column;
}
.qc-cart-footer-buttons.qc-single-button .qc-cart-view-btn,
.qc-cart-footer-buttons.qc-single-button .qc-cart-checkout-btn {
  width: 100%;
}
.qc-cart-footer-buttons.qc-dual-buttons {
  flex-direction: row;
}
.qc-cart-footer-buttons.qc-dual-buttons .qc-cart-view-btn,
.qc-cart-footer-buttons.qc-dual-buttons .qc-cart-checkout-btn {
  flex: 1;
}

.qc-cart-view-btn {
  padding: 11px 16px;
  text-align: center;
  color: #162035;
  font-size: 13.5px;
  font-weight: 600;
  border: 1.5px solid #c8cdd8;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}
.qc-cart-view-btn:hover {
  border-color: #162035;
  background: #162035;
  color: #ffffff;
}

.qc-cart-checkout-btn {
  padding: 11px 16px;
  background: #162035;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.qc-cart-checkout-btn:hover { background: #0f1928; }

/* ──────────────────────────────────────────────
   Drag & drop
────────────────────────────────────────────── */
.qc-cart-item[draggable="true"] { cursor: grab; user-select: none; }
.qc-cart-item[draggable="true"]:active { cursor: grabbing; }
.qc-cart-item.qc-dragging {
  opacity: 0.45;
  outline: 2px dashed #3b82f6;
}
.qc-cart-item.qc-drag-over {
  outline: 2px solid #3b82f6;
  background: #eff6ff;
}
.qc-cart-item.qc-dragging * { pointer-events: none; }

/* ──────────────────────────────────────────────
   Shop product drag-to-cart
────────────────────────────────────────────── */
.product[draggable="true"] { cursor: grab; user-select: none; }
.product[draggable="true"]:active { cursor: grabbing; }
.product.qc-product-dragging { opacity: 0.5; transform: scale(0.95); }

.qc-cart-toggle.qc-drop-active {
  transform: scale(1.15);
  background-color: #00bcd4 !important;
  box-shadow: 0 0 0 4px rgba(0, 188, 212, 0.2), 0 8px 20px rgba(0, 188, 212, 0.3) !important;
  animation: qc-pulse-drop 0.6s ease-in-out infinite;
}
@keyframes qc-pulse-drop {
  0%, 100% { transform: scale(1.15); box-shadow: 0 0 0 4px rgba(0,188,212,.2), 0 8px 20px rgba(0,188,212,.3); }
  50% { transform: scale(1.2); box-shadow: 0 0 0 8px rgba(0,188,212,.3), 0 10px 25px rgba(0,188,212,.4); }
}

.qc-cart-toggle.qc-cart-added { animation: qc-cart-success 0.6s ease-out; }
@keyframes qc-cart-success {
  0% { transform: scale(1); }
  25% { transform: scale(1.2) rotate(5deg); }
  50% { transform: scale(1.1) rotate(-5deg); }
  75% { transform: scale(1.15) rotate(3deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Checkout mode */
[data-checkout-hidden="true"] { display: none !important; }

/* ──────────────────────────────────────────────
   Mobile
────────────────────────────────────────────── */
@media (max-width: 768px) {
  .qc-cart-panel.qc-cart-side {
    width: 100% !important;
    max-width: 100vw;
  }
  .qc-cart-panel.qc-cart-popup {
    width: 96vw;
    max-height: 95vh;
  }
  .qc-cart-header { padding: 14px 16px; }
  .qc-cart-body { padding: 12px 12px 0; }
  .qc-cart-footer { padding: 12px 12px 14px; }
  .qc-item-img { width: 58px; height: 58px; }
  .qc-cart-item { padding: 10px; gap: 10px; }
  .qc-upsell-grid { gap: 8px; }
}
