/**
 * Quantity Controls Styles
 */

.cart-form-container {
  margin: 1rem 0;
}

.quantity {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.qty-label {
  font-weight: 600;
  color: #374151;
  font-size: 0.875rem;
}

.qty-controls {
  display: flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  overflow: hidden;
  background: #fff;
  max-width: 140px;
  transition: all 0.2s ease;
  position: relative;
}

.qty-controls:hover {
  border-color: #9ca3af;
}

.qty-controls:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.qty-controls.updating {
  opacity: 0.6;
  pointer-events: none;
}

.qty-controls.updating::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border: 2px solid #d1d5db;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.qty-btn:hover {
  background: #e5e7eb;
  color: #1f2937;
}

.qty-btn:active {
  background: #d1d5db;
  transform: scale(0.95);
}

.qty-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.qty-btn:disabled:hover {
  background: #f9fafb;
  transform: none;
}

.qty-btn-text {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1;
}

.qty-minus .qty-btn-text {
  font-size: 1.25rem;
}

.input-text.qty {
  width: 60px;
  height: 36px;
  border: none;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  background: #fff;
  color: #1f2937;
  outline: none;
  -moz-appearance: textfield; /* Firefox */
}

.input-text.qty::-webkit-outer-spin-button,
.input-text.qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.input-text.qty:focus {
  background: #f8fafc;
}

.qty-info {
  margin-top: 0.25rem;
}

.qty-help-text {
  color: #6b7280;
  font-size: 0.75rem;
  font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .qty-controls {
    max-width: 120px;
  }

  .qty-btn {
    width: 32px;
    height: 32px;
  }

  .input-text.qty {
    width: 50px;
    height: 32px;
    font-size: 0.8rem;
  }

  .qty-btn-text {
    font-size: 1rem;
  }

  .qty-minus .qty-btn-text {
    font-size: 1.1rem;
  }
}

/* Loading and transition states */
.product.transitioning {
  opacity: 0.7;
  transition: opacity 0.3s ease;
}
