/* ==========================================================================
   CART & CHECKOUT FLOW STYLING (CraftedTech)
   ========================================================================== */

.cart-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

@media (max-width: 992px) {
  .cart-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 1.5rem;
  }
}

/* 1. Cart Items Table/List */
.cart-items-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cart-table-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.cart-item-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 20px;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
  align-items: center;
}
.cart-item-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.cart-item-row:first-child {
  padding-top: 0;
}

.cart-item-img {
  width: 90px;
  height: 90px;
  background-color: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.cart-item-details h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 5px;
}
.cart-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.cart-item-actions-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  height: 100%;
}

/* Coupon Card */
.coupon-card-widget {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  gap: 10px;
  margin-top: 1.5rem;
}
.coupon-card-widget input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

/* 2. Order Summary Sidebar */
.order-summary-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  height: fit-content;
  position: sticky;
  top: 120px;
}

.summary-heading {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.summary-row.grand-total {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  border-top: 1px dashed var(--border-color);
  padding-top: 1rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.checkout-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}
.checkout-tab-btn {
  flex: 1;
  padding: 10px 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.checkout-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* 3. Checkout Inputs Form Grid */
.checkout-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.form-group-full {
  grid-column: span 2;
}
.checkout-form-grid label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.checkout-form-grid input, .checkout-form-grid select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.95rem;
}

/* Payment selection option cards */
.payment-selector-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 1rem;
}
.payment-method-card {
  padding: 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: all var(--transition-fast);
}
.payment-method-card.active {
  border-color: var(--primary);
  background-color: rgba(var(--primary-rgb), 0.04);
}
.radio-indicator {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}
.payment-method-card.active .radio-indicator {
  border-color: var(--primary);
}
.payment-method-card.active .radio-indicator::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary);
}
.payment-details-panel {
  display: none;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-top: none;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: -10px;
  margin-bottom: 10px;
  animation: slideUp 0.3s ease;
}
.payment-details-panel.active {
  display: block;
}

/* 4. TRACK ORDER TIMELINE STEPS */
.track-container {
  max-width: 800px;
  margin: 4rem auto;
  padding: 0 2rem;
}
.track-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  box-shadow: var(--shadow-sm);
}

.timeline-track-wrapper {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 3rem 0;
}
.timeline-track-wrapper::before {
  content: '';
  position: absolute;
  top: 15px; left: 5%; right: 5%;
  height: 4px;
  background-color: var(--border-color);
  z-index: 1;
}
.timeline-progress-fill {
  position: absolute;
  top: 15px; left: 5%;
  height: 4px;
  background-color: var(--primary);
  z-index: 2;
  transition: width 1s ease;
}
.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3;
  width: 20%;
  text-align: center;
}
.timeline-bubble {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-surface);
  border: 3px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all 0.5s ease;
}
.timeline-step.active .timeline-bubble {
  border-color: var(--primary);
  background-color: var(--primary);
  color: #FFFFFF;
  box-shadow: var(--shadow-glow);
}
.timeline-step.completed .timeline-bubble {
  border-color: var(--success);
  background-color: var(--success);
  color: #FFFFFF;
}
.timeline-label {
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 10px;
  color: var(--text-secondary);
}
.timeline-step.active .timeline-label {
  color: var(--primary);
}
.timeline-step.completed .timeline-label {
  color: var(--success);
}
.timeline-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Success Card Animation Check */
.success-checkmark-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: rgba(16, 185, 129, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: var(--success);
}
.success-checkmark-circle svg {
  width: 40px;
  height: 40px;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: checkDraw 0.6s ease-out forwards 0.3s;
}

@keyframes checkDraw {
  to { stroke-dashoffset: 0; }
}
