/* components.css - Cart, Product Cards, Modal, Toast (Tailwind theme compatible) */

/* Product Card */
.pkg-card {
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}
.pkg-card:hover {
  box-shadow: 0 20px 50px rgba(99, 102, 241, 0.12);
  transform: translateY(-6px);
}
.pkg-card-img {
  position: relative;
  height: 200px;
  overflow: hidden;
}
.pkg-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.pkg-card:hover .pkg-card-img img {
  transform: scale(1.08);
}
.pkg-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #f43f5e;
  color: #fff;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.pkg-stock {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  backdrop-filter: blur(4px);
}
.pkgCardBody {
  padding: 1.25rem;
}
.pkgRating {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
}
.pkgRating i { color: #cbd5e1; }
.pkgRating i.active { color: #f59e0b; }
.pkgRating span { color: #94a3b8; margin-left: 4px; }
.pkgName {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.35rem;
}
.pkgDesc {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pkgFooter {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pkgPrice { display: flex; flex-direction: column; }
.pkgPrice .old { color: #94a3b8; text-decoration: line-through; font-size: 0.85rem; }
.pkgPrice .current { color: #6366f1; font-weight: 800; font-size: 1.3rem; }
.pkgAddBtn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: #6366f1;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.25s ease;
}
.pkgAddBtn:hover { background: #4f46e5; transform: scale(1.1); }
.pkgAddBtn.in-cart { background: #10b981; }

/* Cart Sidebar */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.cart-overlay.active { opacity: 1; pointer-events: auto; }

.cart-sidebar {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 100vw;
  height: 100vh;
  background: #fff;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
  z-index: 200;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.cart-sidebar.active { right: 0; }

.cart-head {
  padding: 1.25rem 1.5rem;
  background: #6366f1;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-head h3 { font-size: 1.25rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.cart-close-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.cart-close-btn:hover { background: rgba(255,255,255,0.2); }

.cart-body {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}
.cart-empty {
  text-align: center;
  padding: 3rem 0;
  color: #94a3b8;
}
.cart-empty i { font-size: 3rem; margin-bottom: 0.75rem; display: block; opacity: 0.4; }

.cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #e2e8f0;
}
.cart-item img {
  width: 72px;
  height: 72px;
  border-radius: 0.75rem;
  object-fit: cover;
}
.cart-item-info { flex: 1; }
.cart-item-info h4 { font-size: 0.95rem; font-weight: 600; color: #0f172a; margin-bottom: 0.3rem; }
.cart-item-price { color: #6366f1; font-weight: 700; font-size: 0.95rem; margin-bottom: 0.5rem; }

.qty-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.qty-controls button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.qty-controls button:hover { background: #6366f1; color: #fff; border-color: #6366f1; }
.qty-controls span { font-weight: 600; min-width: 24px; text-align: center; }

.cart-remove {
  background: transparent;
  border: none;
  color: #f43f5e;
  cursor: pointer;
  padding: 0.4rem;
  transition: all 0.2s;
}
.cart-remove:hover { background: rgba(244, 63, 94, 0.1); border-radius: 0.5rem; }

.cart-foot {
  padding: 1.25rem 1.5rem;
  border-top: 2px solid #e2e8f0;
  background: #f8fafc;
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 1.15rem;
  font-weight: 700;
}
.cart-total-row .amt { color: #6366f1; }

/* Checkout Modal */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.overlay.active { opacity: 1; pointer-events: auto; }
.overlay.hidden { display: none; }

.checkout-modal {
  background: #fff;
  border-radius: 1.5rem;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
  animation: modalUp 0.3s ease;
}
@keyframes modalUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.drawer-head {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.drawer-head p { font-size: 0.8rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.drawer-head h3 { font-size: 1.2rem; font-weight: 700; color: #0f172a; }
.icon-btn {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  color: #64748b;
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s;
}
.icon-btn:hover { color: #f43f5e; }

.form-grid {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}
.form-grid label.full { grid-column: 1 / -1; }
.form-grid input {
  padding: 0.7rem 0.85rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.75rem;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.form-grid input:focus { border-color: #6366f1; }

.drawer-foot {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 0 0 1.5rem 1.5rem;
}
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 700;
}
.total-row strong { color: #6366f1; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #6366f1;
  color: #fff;
  border: none;
  padding: 0.85rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s;
  font-family: inherit;
}
.btn-primary:hover { background: #4f46e5; transform: translateY(-1px); }
.btn-primary.full { width: 100%; }

/* Toast */
.toast-wrap {
  position: fixed;
  top: 90px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  background: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: 0.75rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 260px;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.35s ease;
  font-size: 0.9rem;
  font-weight: 500;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast-success { border-left: 4px solid #10b981; }
.toast-success i { color: #10b981; }

/* Product Modal */
.pkg-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 250;
  display: none;
  align-items: center;
  justify-content: center;
}
.pkg-modal-overlay.active { display: flex; }
.pkg-modal {
  background: #fff;
  border-radius: 1.5rem;
  max-width: 800px;
  width: 92%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0,0,0,0.2);
  animation: modalUp 0.3s ease;
  position: relative;
}
.pkg-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f43f5e;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  z-index: 10;
  transition: transform 0.2s;
}
.pkg-modal-close:hover { transform: rotate(90deg); }
.pkg-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem;
}
.pkg-modal-img img { width: 100%; border-radius: 1rem; }
.pkg-modal-details h2 { font-size: 1.6rem; font-weight: 800; color: #0f172a; margin-bottom: 0.75rem; }
.pkg-modal-details .desc { color: #64748b; line-height: 1.7; margin-bottom: 1rem; }
.pkg-modal-details .features { list-style: none; margin-bottom: 1.5rem; }
.pkg-modal-details .features li { padding: 0.3rem 0; color: #334155; font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; }
.pkg-modal-details .features li i { color: #10b981; font-size: 0.75rem; }
.pkg-modal-price { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }
.pkg-modal-price .old { color: #94a3b8; text-decoration: line-through; font-size: 1rem; }
.pkg-modal-price .current { color: #6366f1; font-weight: 800; font-size: 1.6rem; }

/* Responsive */
@media (max-width: 768px) {
  .cart-sidebar { width: 100%; right: -100%; }
  .pkg-modal-grid { grid-template-columns: 1fr; padding: 1.25rem; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid label.full { grid-column: 1; }
}
