/* CAPITAL VAPE - Cart Drawer & Free Shipping Meter */

/* Overlay */
.cv-cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cv-cart-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Cart Drawer */
.cv-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 440px;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  z-index: 2100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
}

.cv-cart-drawer.open {
  transform: translateX(0);
}

.cv-cart-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-dark);
}

.cv-cart-title {
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cv-cart-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
}

.cv-cart-close-btn:hover {
  color: #fff;
}

/* Free Shipping Meter */
.shipping-meter-box {
  padding: 16px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
}

.dest-toggle-group {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.dest-btn {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.dest-btn:hover, .dest-btn.active {
  background: var(--accent-gold);
  color: #000;
  border-color: var(--accent-gold);
}

.meter-status {
  font-size: 0.82rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.free-badge {
  color: var(--accent-green);
  font-weight: 700;
}

.meter-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.meter-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #F59E0B, #10B981);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.meter-bar-fill.complete {
  background: var(--accent-green);
}

/* Items List */
/* Items List */
.cv-cart-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
}

.cart-item-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  width: 100%;
}

.cart-item-row.detal-item-row {
  border-left: 3.5px solid var(--accent-purple);
}

.cart-item-row.ws-item-row {
  border-left: 3.5px solid var(--accent-gold);
  background: linear-gradient(135deg, rgba(229, 183, 0, 0.05) 0%, var(--bg-surface) 100%);
}

.ws-item-header, .detal-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 8px;
}

.ws-item-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  width: 100%;
}

.item-title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  margin: 0;
  word-break: break-word;
}

.item-variant-line {
  font-size: 0.78rem;
  color: var(--accent-gold);
  margin-top: 2px;
}

.item-variant {
  font-size: 0.78rem;
  color: var(--accent-gold);
}

.item-unit-price {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.unit-price-label, .price-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.unit-price-val, .price-val {
  color: var(--accent-gold);
  font-weight: 700;
}

.item-promo-tag {
  color: var(--accent-gold);
  font-weight: 700;
  margin-left: 6px;
}

.ws-item-footer, .detal-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
}

.item-actions-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.item-qty-selector {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.btn-qty-mini {
  background: transparent;
  border: none;
  color: var(--text-primary);
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 800;
  font-size: 1rem;
  transition: var(--transition);
  user-select: none;
}

.btn-qty-mini:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--accent-gold);
}

.qty-num {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0 6px;
  min-width: 26px;
  text-align: center;
  color: var(--text-primary);
  white-space: nowrap;
}

.item-subtotal-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  text-align: right;
  flex-shrink: 0;
}

.subtotal-label, .subtotal-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.item-total-price {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
}

.item-total-price.ws-total {
  color: var(--accent-gold);
  font-size: 1rem;
}

.btn-remove-item {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  opacity: 0.65;
  padding: 4px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: var(--transition);
}

.btn-remove-item:hover {
  opacity: 1;
  transform: scale(1.15);
}

/* Empty State */
.cart-empty-state {
  text-align: center;
  padding: 48px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.empty-icon {
  font-size: 3.5rem;
  opacity: 0.5;
}

.cart-empty-state h3 {
  font-size: 1.3rem;
}

.cart-empty-state p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 280px;
}

/* Footer Summary */
.cv-cart-footer {
  padding: 18px 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-dark);
  box-sizing: border-box;
}

.cart-summary-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.summary-line.ws-summary-line {
  color: var(--accent-gold);
  font-weight: 600;
}

.summary-line.total-line {
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.total-amount {
  color: var(--accent-gold);
}

.cart-footer-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-checkout {
  padding: 13px 20px;
  font-size: 1rem;
}

.cart-secondary-actions {
  display: flex;
  justify-content: space-between;
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--accent-gold);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.btn-link.text-muted {
  color: var(--text-muted);
}

/* Cart flavor selector */
.cart-flavor-select-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0;
  flex-wrap: wrap;
}

.cart-flavor-select-row label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  white-space: nowrap;
}

.cart-flavor-dropdown {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--accent-yellow);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  max-width: 170px;
  transition: var(--transition);
}

.cart-flavor-dropdown:focus {
  border-color: var(--accent-gold);
}

@keyframes badgePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.pulse-anim {
  animation: badgePulse 0.35s ease-out;
}

/* ==========================================================================
   UNIFIED CART SECTION DIVIDERS (DETAL & MAYORISTA)
   ========================================================================== */
.cart-section-block {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
  box-sizing: border-box;
  width: 100%;
}

.cart-section-block.wholesale-block {
  border-color: rgba(229, 183, 0, 0.4);
  background: linear-gradient(180deg, rgba(229, 183, 0, 0.06) 0%, rgba(20, 8, 33, 0.4) 100%);
}

.cart-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  gap: 8px;
}

.ws-header-tag-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cart-sec-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--accent-purple);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(216, 27, 183, 0.12);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(216, 27, 183, 0.3);
  white-space: nowrap;
}

.cart-sec-tag.wholesale-tag {
  color: var(--accent-yellow);
  background: rgba(229, 183, 0, 0.14);
  border-color: rgba(229, 183, 0, 0.4);
}

.ws-header-tier-pill {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(229, 183, 0, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(229, 183, 0, 0.25);
  white-space: nowrap;
}

.ws-tier-progress-banner {
  background: rgba(229, 183, 0, 0.08);
  border: 1px dashed rgba(229, 183, 0, 0.35);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.35;
}

.ws-tier-progress-banner.max-tier {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--accent-green);
}

.ws-tier-progress-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
}

.cart-sec-subtotal {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.cart-items-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ws-pack-badge {
  display: inline-flex;
  width: fit-content;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent-gold);
  background: rgba(229, 183, 0, 0.15);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(229, 183, 0, 0.3);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.checkout-sec-divider {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-purple);
  padding: 6px 10px;
  background: rgba(216, 27, 183, 0.12);
  border-radius: var(--radius-sm);
  margin: 10px 0 6px;
  letter-spacing: 0.04em;
}

.checkout-sec-divider.ws-divider {
  color: var(--accent-gold);
  background: rgba(229, 183, 0, 0.12);
}

.checkout-item-line.ws-checkout-line {
  border-left: 2px solid var(--accent-gold);
  padding-left: 8px;
}

/* ==========================================================================
   CART DRAWER RESPONSIVE FIXES (MOBILE PHONES & SMALL SCREENS)
   ========================================================================== */
@media (max-width: 480px) {
  .cv-cart-drawer {
    max-width: 100vw;
  }
  .cv-cart-header {
    padding: 14px 16px;
  }
  .shipping-meter-box {
    padding: 12px 14px;
  }
  .cv-cart-body {
    padding: 12px 14px;
    gap: 12px;
  }
  .cart-section-block {
    padding: 10px;
    margin-bottom: 10px;
  }
  .cart-item-row {
    padding: 10px;
    gap: 6px;
  }
  .cv-cart-footer {
    padding: 14px 16px;
  }
  .cart-flavor-dropdown {
    max-width: 135px;
    font-size: 0.72rem;
  }
  .ws-header-tier-pill {
    font-size: 0.66rem;
  }
}

@media (max-width: 360px) {
  .cv-cart-body {
    padding: 10px 8px;
  }
  .cart-section-block {
    padding: 8px;
  }
  .cart-item-row {
    padding: 8px;
  }
  .btn-qty-mini {
    width: 24px;
    height: 24px;
    min-width: 24px;
  }
  .qty-num {
    font-size: 0.76rem;
    padding: 0 4px;
  }
  .item-total-price {
    font-size: 0.88rem;
  }
  .cart-flavor-dropdown {
    max-width: 110px;
  }
}
