/* ===================================
   BLOOMSCROLL CHECKOUT - MOBILE-FIRST
   Optimized for mobile conversion
   =================================== */

.checkout-flow {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  display: flex !important;
  align-items: flex-end !important;
  pointer-events: none !important;
  opacity: 0 !important;
  transition: opacity 0.3s ease !important;
}

.checkout-flow.open {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.checkout-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.95) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  cursor: pointer !important;
}

.checkout-sheet {
  position: relative !important;
  width: 100% !important;
  max-width: 600px !important;
  margin: 0 auto !important;
  background: #0a0a0a !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 24px 24px 0 0 !important;
  color: #ffffff !important;
  transform: translateY(100%) !important;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1) !important;
  max-height: 85vh !important;
  overflow-y: auto !important;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5) !important;
  display: flex !important;
  flex-direction: column !important;
}

.checkout-flow.open .checkout-sheet {
  transform: translateY(0) !important;
}

/* ===================================
   SHEET HEADER - Mobile Navigation
   =================================== */
.checkout-header {
  position: sticky !important;
  top: 0 !important;
  background: #0a0a0a !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding: 16px 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 60px !important;
  z-index: 10 !important;
}

.checkout-close-btn {
  width: 44px !important;
  height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  color: rgba(255, 255, 255, 0.7) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  font-size: 24px !important;
  line-height: 1 !important;
  padding: 0 !important;
  -webkit-tap-highlight-color: transparent !important;
  font-family: 'Berkeley Mono', monospace !important;
}

.checkout-close-btn:hover,
.checkout-close-btn:active {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: rgba(255, 255, 255, 0.9) !important;
  transform: scale(1.05) !important;
}

.checkout-progress {
  flex: 1 !important;
  text-align: center !important;
  font-family: 'Berkeley Mono', monospace !important;
  font-size: 13px !important;
  color: rgba(255, 255, 255, 0.5) !important;
  letter-spacing: 0.05em !important;
}

.checkout-progress-dots {
  display: flex !important;
  gap: 8px !important;
  justify-content: center !important;
  margin-top: 4px !important;
}

.progress-dot {
  width: 6px !important;
  height: 6px !important;
  border-radius: 3px !important;
  background: rgba(255, 255, 255, 0.2) !important;
  transition: all 0.3s ease !important;
}

.progress-dot.active {
  width: 20px !important;
  background: #ff5722 !important;
}

.sheet-handle {
  width: 48px !important;
  height: 4px !important;
  background: rgba(255, 255, 255, 0.3) !important;
  border-radius: 2px !important;
  margin: 12px auto 8px !important;
  display: none !important; /* Using header instead */
}

/* ===================================
   CHECKOUT STEPS
   =================================== */
.checkout-step {
  padding: 20px !important;
  display: none !important;
  background: transparent !important;
  flex: 1 !important;
  overflow-y: auto !important;
}

.checkout-step.active {
  display: flex !important;
  flex-direction: column !important;
}

.checkout-step h2 {
  font-family: 'Berkeley Mono', monospace !important;
  font-size: 20px !important;
  margin-bottom: 8px !important;
  color: #ffffff !important;
  font-weight: normal !important;
  letter-spacing: -0.5px !important;
}

.checkout-step-subtitle {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 14px !important;
  color: rgba(255, 255, 255, 0.5) !important;
  margin-bottom: 24px !important;
  line-height: 1.5 !important;
}

/* ===================================
   PRODUCTS GRID - Mobile-First
   =================================== */
.products-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  flex: 1 !important;
  overflow-y: auto !important;
  margin-bottom: 16px !important;
}

.product-card {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 2px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 16px !important;
  padding: 0 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  position: relative !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  min-height: 100px !important;
  -webkit-tap-highlight-color: transparent !important;
}

.product-card:active {
  transform: scale(0.98) !important;
}

.product-card.selected {
  border-color: #ff5722 !important;
  background: rgba(255, 87, 34, 0.08) !important;
  box-shadow: 0 0 0 1px rgba(255, 87, 34, 0.2) !important;
}

/* Product Mockup Container */
.product-mockup {
  width: 100px !important;
  height: 100px !important;
  background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  position: relative !important;
  flex-shrink: 0 !important;
  border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* Product mockup with pattern */
.product-mockup img {
  width: 70% !important;
  height: 70% !important;
  object-fit: cover !important;
  border-radius: 8px !important;
  opacity: 0.95 !important;
}

.product-mockup::before {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  background-size: 40px 40px !important;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px) !important;
  pointer-events: none !important;
}

.mockup-spinner {
  width: 30px !important;
  height: 30px !important;
  border: 2px solid rgba(255, 255, 255, 0.1) !important;
  border-top-color: rgba(255, 255, 255, 0.5) !important;
  border-radius: 50% !important;
  animation: spin 1s linear infinite !important;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Product Info */
.product-info {
  padding: 16px 20px !important;
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 4px !important;
}

.product-info-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 4px !important;
}

.product-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  font-size: 16px !important;
  color: rgba(255, 255, 255, 0.6) !important;
  margin-right: 12px !important;
  flex-shrink: 0 !important;
}

.product-info h3 {
  font-size: 16px !important;
  margin: 0 !important;
  color: #ffffff !important;
  font-family: 'Berkeley Mono', monospace !important;
  font-weight: 500 !important;
  flex: 1 !important;
}

.product-desc {
  font-size: 13px !important;
  color: rgba(255, 255, 255, 0.5) !important;
  margin: 0 !important;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif !important;
  line-height: 1.4 !important;
}

.product-price {
  font-size: 18px !important;
  color: #ff5722 !important;
  font-family: 'Berkeley Mono', monospace !important;
  font-weight: 600 !important;
}

.popular-badge {
  position: absolute !important;
  top: 8px !important;
  left: 108px !important;
  background: #ff5722 !important;
  color: #000000 !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  font-size: 10px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  font-weight: 700 !important;
  z-index: 10 !important;
  font-family: 'Berkeley Mono', monospace !important;
}

/* ===================================
   SIZE SELECTION STEP - Mobile Optimized
   =================================== */
.back-btn {
  width: 44px !important;
  height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  color: rgba(255, 255, 255, 0.7) !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  font-size: 20px !important;
  line-height: 1 !important;
  padding: 0 !important;
  margin-bottom: 16px !important;
  font-family: 'Berkeley Mono', monospace !important;
  -webkit-tap-highlight-color: transparent !important;
}

.back-btn:hover,
.back-btn:active {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: rgba(255, 255, 255, 0.9) !important;
}

.selected-product-preview {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  padding: 16px !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  margin-bottom: 24px !important;
}

.selected-product-preview img {
  width: 72px !important;
  height: 72px !important;
  object-fit: cover !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.selected-product-preview-info {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

#selectedProductName {
  color: #ffffff !important;
  font-family: 'Berkeley Mono', monospace !important;
  font-size: 16px !important;
  font-weight: 500 !important;
}

.selected-product-price {
  color: #ff5722 !important;
  font-family: 'Berkeley Mono', monospace !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}

.size-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)) !important;
  gap: 10px !important;
  margin-bottom: 20px !important;
}

.size-btn {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 2px solid rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.7) !important;
  padding: 0 !important;
  min-height: 52px !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  font-family: 'Berkeley Mono', monospace !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  text-align: center !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  -webkit-tap-highlight-color: transparent !important;
}

.size-btn:active {
  transform: scale(0.95) !important;
}

.size-btn.selected {
  background: rgba(255, 87, 34, 0.15) !important;
  border-color: #ff5722 !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 1px rgba(255, 87, 34, 0.3) !important;
}

.size-btn:disabled {
  opacity: 0.3 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

.size-guide {
  text-align: center !important;
  margin-bottom: 20px !important;
}

#sizeGuideBtn {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 12px !important;
  padding: 10px 16px !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  font-family: 'Berkeley Mono', monospace !important;
  transition: all 0.2s ease !important;
  -webkit-tap-highlight-color: transparent !important;
}

#sizeGuideBtn:hover,
#sizeGuideBtn:active {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: rgba(255, 255, 255, 0.9) !important;
}

/* ===================================
   PROCEED BUTTON - High-conversion CTA
   =================================== */
.proceed-btn {
  width: 100% !important;
  min-height: 56px !important;
  padding: 16px 24px !important;
  background: #ff5722 !important;
  border: none !important;
  color: #000000 !important;
  border-radius: 12px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  font-family: 'Berkeley Mono', monospace !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase !important;
  box-shadow: 0 4px 12px rgba(255, 87, 34, 0.3) !important;
  position: relative !important;
  overflow: hidden !important;
  -webkit-tap-highlight-color: transparent !important;
}

.proceed-btn::before {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 100%) !important;
  opacity: 0 !important;
  transition: opacity 0.2s ease !important;
}

.proceed-btn:hover::before {
  opacity: 1 !important;
}

.proceed-btn:active {
  transform: scale(0.98) !important;
  box-shadow: 0 2px 8px rgba(255, 87, 34, 0.3) !important;
}

.proceed-btn:disabled {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.4) !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Toast Messages */
.toast-message {
  position: fixed !important;
  bottom: 20px !important;
  left: 50% !important;
  transform: translateX(-50%) translateY(100px) !important;
  background: #1a1a1a !important;
  color: #ffffff !important;
  padding: 14px 24px !important;
  border-radius: 12px !important;
  opacity: 0 !important;
  transition: all 0.3s ease !important;
  z-index: 10001 !important;
  font-family: 'Berkeley Mono', monospace !important;
  font-size: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

.toast-message.show {
  transform: translateX(-50%) translateY(0) !important;
  opacity: 1 !important;
}

/* Scrollbar Styling */
.checkout-sheet::-webkit-scrollbar {
  width: 8px !important;
}

.checkout-sheet::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02) !important;
}

.checkout-sheet::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 4px !important;
}

.checkout-sheet::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15) !important;
}

/* ===================================
   TRUST SIGNALS & INFO
   =================================== */
.checkout-trust-signals {
  display: flex !important;
  gap: 12px !important;
  padding: 12px 16px !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border-radius: 8px !important;
  margin-bottom: 16px !important;
  flex-wrap: wrap !important;
}

.trust-signal {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 11px !important;
  color: rgba(255, 255, 255, 0.5) !important;
  font-family: 'Berkeley Mono', monospace !important;
}

.trust-signal-icon {
  font-size: 14px !important;
  color: #ff5722 !important;
}

/* ===================================
   RESPONSIVE ADJUSTMENTS
   =================================== */
@media (max-width: 480px) {
  .checkout-sheet {
    border-radius: 20px 20px 0 0 !important;
    max-height: 90vh !important;
  }

  .checkout-step {
    padding: 16px !important;
  }

  .checkout-step h2 {
    font-size: 18px !important;
  }

  .product-mockup {
    width: 90px !important;
    height: 90px !important;
  }

  .product-info {
    padding: 12px 16px !important;
  }

  .size-grid {
    grid-template-columns: repeat(auto-fit, minmax(65px, 1fr)) !important;
    gap: 8px !important;
  }

  .size-btn {
    min-height: 48px !important;
    font-size: 14px !important;
  }
}

@media (min-width: 481px) {
  .products-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .product-card {
    flex-direction: column !important;
    min-height: auto !important;
  }

  .product-mockup {
    width: 100% !important;
    height: 140px !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  }

  .product-info {
    text-align: center !important;
    align-items: center !important;
  }

  .popular-badge {
    top: 12px !important;
    left: auto !important;
    right: 12px !important;
  }
}

/* ===================================
   ANIMATIONS
   =================================== */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.checkout-step.active .product-card {
  animation: slideInUp 0.3s ease forwards !important;
}

.checkout-step.active .product-card:nth-child(1) {
  animation-delay: 0.05s !important;
}

.checkout-step.active .product-card:nth-child(2) {
  animation-delay: 0.1s !important;
}

.checkout-step.active .product-card:nth-child(3) {
  animation-delay: 0.15s !important;
}

.checkout-step.active .product-card:nth-child(4) {
  animation-delay: 0.2s !important;
}