/**
 * SCROLLABLE ORDER SUMMARY
 * Add to checkout-professional.css or create separate file
 */

/* ============================================
   ORDER SUMMARY - SCROLLABLE
   ============================================ */

.checkout-summary-section {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}

.checkout-summary-section h2 {
  flex-shrink: 0;
  margin: 0 0 20px 0;
  padding-bottom: 15px;
  border-bottom: 2px solid #e0e0e0;
}

#orderSummary {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  margin-bottom: 20px;
  padding-right: 10px; /* Space for scrollbar */
}

/* Custom Scrollbar */
#orderSummary::-webkit-scrollbar {
  width: 8px;
}

#orderSummary::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

#orderSummary::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

#orderSummary::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Firefox scrollbar */
#orderSummary {
  scrollbar-width: thin;
  scrollbar-color: #888 #f1f1f1;
}

/* Fade effect at top/bottom when scrolling */
.checkout-summary-section::before,
.checkout-summary-section::after {
  content: '';
  position: absolute;
  left: 0;
  right: 20px;
  height: 30px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1;
}

.checkout-summary-section::before {
  top: 80px;
  background: linear-gradient(to bottom, white, transparent);
}

.checkout-summary-section::after {
  bottom: 0;
  background: linear-gradient(to top, white, transparent);
}

.checkout-summary-section.has-scroll::before,
.checkout-summary-section.has-scroll::after {
  opacity: 1;
}

/* Order totals - always visible at bottom */
.order-totals {
  flex-shrink: 0;
  margin-top: 20px;
  padding: 20px;
  background: #f5f5f5;
  border-radius: 8px;
  position: sticky;
  bottom: 0;
  z-index: 2;
  box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
}

/* Individual order items */
.order-item {
  margin-bottom: 15px !important;
}

/* Scroll indicator */
.scroll-indicator {
  text-align: center;
  padding: 10px;
  color: #6c757d;
  font-size: 13px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .checkout-summary-section {
    position: static;
    max-height: none;
  }
  
  #orderSummary {
    max-height: 400px;
  }
}