/* Checkout page mobile enhancements */

/* Cart Items scroll area with inertia scrolling */
#checkout-items {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
}

#checkout-items::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

/* Touch state for inputs and buttons */
.active {
  opacity: 0.8;
}

/* Safe area bottom padding for buttons */
.pb-safe {
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}

/* Touch-friendly buttons with active state */
#back-to-billing, #finalize-sale {
  transition: transform 0.1s ease, opacity 0.2s ease;
}

#back-to-billing:active, #finalize-sale:active {
  transform: scale(0.98);
}

/* Improved form input styling for mobile */
input[type=number], input[type=text], input[type=tel], select {
  -webkit-appearance: none;
  appearance: none;
  font-size: 16px; /* Prevents iOS zoom on input focus */
}

/* Better number input visibility */
input[type=number] {
  appearance: textfield;
  -moz-appearance: textfield;
}

/* Remove default spinner */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Fix to ensure dropdowns are tappable across full width */
select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Larger tap targets for mobile */
@media (max-width: 768px) {
  #checkout-items .py-2 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }
  
  /* Increase contrast for better mobile readability */
  .text-sm {
    font-size: 0.9rem;
  }
  
  /* Help with one-handed use by adding extra bottom padding */
  #checkout-root {
    padding-bottom: 1.5rem;
  }
  
  /* Improve spacing and layout on narrow screens */
  .space-y-3 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.75rem;
  }
}