/* ==========================================
   CART MODAL — ALISH Pharmaceuticals
   Yeh styles style.css ke END mein paste karo
========================================== */

/* Overlay */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 37, 64, 0.45);
  z-index: 1080;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(2px);
}
.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Drawer panel — right se slide in */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: 100vh;
  background: #fff;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 40px rgba(10, 37, 64, 0.15);
}
.cart-drawer.active {
  transform: translateX(0);
}

/* Header */
.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
  background: #0A2540;
  color: #fff;
}
.cart-drawer-header h5 {
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.cart-drawer-header h5 span {
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  opacity: 0.75;
  margin-left: 8px;
}
.cart-close-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
}
.cart-close-btn:hover {
  background: rgba(255,255,255,0.28);
}

/* Items list */
.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}
.cart-drawer-body::-webkit-scrollbar {
  width: 4px;
}
.cart-drawer-body::-webkit-scrollbar-track {
  background: #f5f5f5;
}
.cart-drawer-body::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

/* Empty state */
.cart-empty {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}
.cart-empty i {
  font-size: 52px;
  color: #ddd;
  margin-bottom: 16px;
  display: block;
}
.cart-empty p {
  font-size: 15px;
  margin-bottom: 20px;
}
.cart-empty a {
  background: #0A2540;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}
.cart-empty a:hover {
  background: #1a4a70;
}

/* Single cart item */
.cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
  animation: cartItemIn 0.25s ease;
}
@keyframes cartItemIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cart-item:last-child {
  border-bottom: none;
}
.cart-item-icon {
  width: 46px;
  height: 46px;
  background: #f0f6ff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
  color: #0A2540;
}
.cart-item-info {
  flex: 1;
  min-width: 0;
}
.cart-item-name {
  font-size: 14px;
  font-weight: 600;
  color: #0A2540;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.cart-item-price {
  font-size: 13px;
  color: #1D9E75;
  font-weight: 600;
}
.cart-item-unit {
  font-size: 11px;
  color: #999;
  font-weight: 400;
  margin-left: 4px;
}

/* Qty controls inside cart item */
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.cart-qty-btn {
  width: 30px;
  height: 30px;
  background: #f8f8f8;
  border: none;
  font-size: 16px;
  font-weight: 500;
  color: #0A2540;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.cart-qty-btn:hover {
  background: #e8f0fb;
}
.cart-qty-num {
  width: 32px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #0A2540;
  border-left: 1px solid #e0e0e0;
  border-right: 1px solid #e0e0e0;
  height: 30px;
  line-height: 30px;
  user-select: none;
}
.cart-item-remove {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  font-size: 15px;
  padding: 4px;
  flex-shrink: 0;
  transition: color 0.2s;
  border-radius: 4px;
}
.cart-item-remove:hover {
  color: #e24b4a;
  background: #fff0f0;
}

/* Footer */
.cart-drawer-footer {
  padding: 16px 24px 24px;
  border-top: 1px solid #eee;
  background: #fafafa;
}
.cart-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
  color: #888;
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-top: 10px;
  border-top: 1px dashed #ddd;
}
.cart-total-label {
  font-size: 15px;
  font-weight: 700;
  color: #0A2540;
}
.cart-total-amount {
  font-size: 20px;
  font-weight: 800;
  color: #0A2540;
  font-family: 'Playfair Display', serif;
}
.cart-checkout-btn {
  width: 100%;
  background: #0A2540;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.3px;
}
.cart-checkout-btn:hover {
  background: #1a4a70;
  transform: translateY(-1px);
}
.cart-continue-btn {
  width: 100%;
  background: transparent;
  color: #0A2540;
  border: 1.5px solid #0A2540;
  border-radius: 10px;
  padding: 11px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.2s;
  letter-spacing: 0.2px;
}
.cart-continue-btn:hover {
  background: #f0f6ff;
}

/* Badge pulse when item added */
@keyframes badgePulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}
.cart-count.pulse {
  animation: badgePulse 0.35s ease;
}

/* Mobile */
@media (max-width: 480px) {
  .cart-drawer {
    width: 100vw;
  }
}