/* ==========================================================================
   WPV SIDE CART & ADD-TO-CART BUTTON STYLES
   ========================================================================== */

/* ── Floating Cart Trigger Button ── */
.wpv-floating-cart-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4), 0 0 0 1px rgba(16, 185, 129, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 99999;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.wpv-floating-cart-btn:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 16px 36px rgba(16, 185, 129, 0.55), 0 0 20px rgba(16, 185, 129, 0.4);
}

.wpv-floating-cart-btn:active {
  transform: scale(0.95);
}

/* Floating Cart Badge */
.wpv-cart-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 12px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wpv-cart-count-badge.bounce {
  transform: scale(1.4);
}

/* ── Navbar Cart Button ── */
.nav-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.nav-cart-btn:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  transform: translateY(-1px);
}

.nav-cart-btn .nav-cart-badge {
  background: #10b981;
  color: #ffffff;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 6px;
}

/* ── Slide-Out Cart Drawer ── */
.wpv-cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.wpv-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 94vw);
  background: var(--surface, #ffffff);
  color: var(--text-primary, #0f172a);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.35);
  z-index: 1000001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 1px solid var(--border, #e2e8f0);
}

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

/* Cart Header */
.wpv-cart-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-soft, #f8fafc);
}

.wpv-cart-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wpv-cart-header-title h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
}

.wpv-cart-header-badge {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.wpv-cart-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wpv-cart-close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* Cart Items Body */
.wpv-cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Single Cart Item */
.wpv-cart-item {
  background: var(--surface-soft, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s, transform 0.2s;
}

.wpv-cart-item:hover {
  border-color: rgba(16, 185, 129, 0.4);
}

.wpv-cart-item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wpv-cart-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.wpv-cart-item-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #ffffff;
  padding: 4px;
  border: 1px solid var(--border, #e2e8f0);
  object-fit: contain;
  flex-shrink: 0;
}

.wpv-cart-item-texts {
  min-width: 0;
  flex: 1;
}

.wpv-cart-item-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wpv-cart-item-meta {
  font-size: 0.72rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.wpv-cart-item-remove {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s;
}

.wpv-cart-item-remove:hover {
  color: #ef4444;
}

.wpv-cart-item-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px dashed var(--border, #e2e8f0);
}

.wpv-cart-qty-picker {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  overflow: hidden;
}

html[data-theme="dark"] .wpv-cart-qty-picker {
  background: #111c26;
}

.wpv-cart-qty-btn {
  background: transparent;
  border: none;
  padding: 4px 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  cursor: pointer;
  transition: background 0.15s;
}

.wpv-cart-qty-btn:hover {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.wpv-cart-qty-input {
  width: 44px;
  border: none;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  background: transparent;
  color: var(--text-primary, #0f172a);
  outline: none;
}

.wpv-cart-item-subtotal {
  font-weight: 800;
  font-size: 0.95rem;
  color: #10b981;
}

/* Empty State */
.wpv-cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
}

.wpv-cart-empty-icon {
  font-size: 3.5rem;
  margin-bottom: 15px;
  opacity: 0.7;
}

.wpv-cart-empty h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin-bottom: 6px;
}

.wpv-cart-empty p {
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.wpv-cart-browse-btn {
  padding: 10px 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  transition: transform 0.2s;
  cursor: pointer;
}

.wpv-cart-browse-btn:hover {
  transform: translateY(-2px);
}

/* Cart Footer Summary */
.wpv-cart-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border, #e2e8f0);
  background: var(--surface-soft, #f8fafc);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wpv-cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-secondary, #64748b);
}

.wpv-cart-summary-row.total {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  padding-top: 8px;
  border-top: 1px dashed var(--border, #e2e8f0);
}

.wpv-cart-summary-row.total span:last-child {
  color: #10b981;
}

.wpv-cart-checkout-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
  transition: all 0.25s ease;
}

.wpv-cart-checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.45);
}

.wpv-cart-clear-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.8rem;
  cursor: pointer;
  text-align: center;
  text-decoration: underline;
}

.wpv-cart-clear-btn:hover {
  color: #ef4444;
}

/* ── "Add to Cart" Button on Stock Cards ── */
.btn-add-to-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
  position: relative;
}

.btn-add-to-cart:hover {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-add-to-cart:active {
  transform: scale(0.95);
}

.btn-add-to-cart.in-cart {
  background: rgba(99, 102, 241, 0.15);
  border-color: #6366f1;
  color: #6366f1;
}

/* Action button row on cards */
.card-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}

/* Toast Alert */
.wpv-cart-toast {
  position: fixed;
  bottom: 100px;
  right: 28px;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 1000002;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.wpv-cart-toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
