/* cart.css - Premium Shopping Basket & Checkout Styling */

/* ── NAVBAR BASKET ICON & BADGE ── */
.nav-cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  background: linear-gradient(135deg, #e63946 0%, #d62828 100%);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(230, 57, 70, 0.4);
  animation: badgePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badgePop {
  0% { transform: scale(0); }
  80% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ── CART DRAWER OVERLAY & CONTAINER ── */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99990;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  height: 100vh;
  background: #ffffff;
  z-index: 99991;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Drawer Header */
.cart-drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

.cart-drawer-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.cart-drawer-header h3 i {
  color: #0066cc;
}

.cart-close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #64748b;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

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

/* Drawer Items List */
.cart-drawer-items {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}

.cart-empty-state {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-color: #94a3b8;
  text-align: center;
}

.cart-empty-state i {
  font-size: 3.5rem;
  color: #cbd5e1;
  margin-bottom: 1rem;
}

.cart-empty-state p {
  color: #64748b;
  font-size: 1rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  align-items: center;
}

.cart-item-img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: 8px;
  background: #f8fafc;
  padding: 4px;
  border: 1px solid #e2e8f0;
}

.cart-item-info {
  flex: 1;
}

.cart-item-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.cart-item-price {
  font-size: 1rem;
  font-weight: 700;
  color: #0066cc;
  margin-bottom: 8px;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qty-selector {
  display: flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  overflow: hidden;
  background: #f8fafc;
}

.qty-selector button {
  background: none;
  border: none;
  width: 28px;
  height: 28px;
  font-weight: bold;
  color: #334155;
  cursor: pointer;
  transition: background 0.2s;
}

.qty-selector button:hover {
  background: #e2e8f0;
}

.qty-selector span {
  width: 32px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
}

.cart-remove-btn {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;

}

.cart-remove-btn:hover {
  text-decoration: underline;
}

/* Drawer Footer */
.cart-drawer-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.cart-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1rem;
}

.cart-subtotal-row span:last-child {
  color: #0066cc;
  font-size: 1.25rem;
}

.btn-checkout-primary {
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(135deg, #0066cc 0%, #004488 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 102, 204, 0.3);
  transition: all 0.25s ease;
}

.btn-checkout-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

/* ── CHECKOUT MODAL ── */
.checkout-modal-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  z-index: 99995;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.checkout-modal-card {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
  animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.checkout-header {
  padding: 1.5rem 2rem 1rem 2rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.checkout-header h2 {
  margin: 0;
  font-size: 1.35rem;
  color: #0f172a;
  font-weight: 700;
}

.checkout-close-btn {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;

}

.checkout-body {
  padding: 1.5rem 2rem;
}

/* Progress Steps */
.checkout-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  position: relative;
}

.checkout-steps::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: #e2e8f0;
  z-index: 1;
}

.step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.step-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.step-item.active .step-icon {
  background: #0066cc;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.2);
}

.step-item.completed .step-icon {
  background: #10b981;
  color: #ffffff;
}

.step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}

.step-item.active .step-label {
  color: #0066cc;
}

/* Form Layout */
.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #0f172a;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

/* Order Summary Box in Checkout */
.checkout-summary-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #475569;
  margin-bottom: 6px;
}

.summary-row.total-row {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  border-top: 1px solid #cbd5e1;
  padding-top: 8px;
  margin-top: 8px;
  margin-bottom: 0;
}

.summary-row.total-row span:last-child {
  color: #0066cc;
}

/* Stripe Payment Box */
.stripe-element-container {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin-top: 8px;
  margin-bottom: 1.2rem;
}

#stripe-card-element {
  min-height: 20px;
}

.payment-security-note {
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 1.2rem;
}

.payment-security-note i {
  color: #10b981;
}

/* Success Step */
.checkout-success-view {
  text-align: center;
  padding: 2rem 1rem;
}

.success-icon {
  width: 70px;
  height: 70px;
  background: #d1fae5;
  color: #10b981;
  font-size: 2.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem auto;
}

.checkout-success-view h3 {
  font-size: 1.5rem;
  color: #0f172a;
  margin: 0 0 0.5rem 0;
}

.checkout-success-view p {
  color: #64748b;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.order-ref-badge {
  background: #f1f5f9;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-family: monospace;
  font-weight: bold;
  color: #0066cc;
  display: inline-block;
  margin-bottom: 1.5rem;
}
